/* assets/css/auth.css - Giao diện Trang Đăng Nhập & Đăng Ký (Authentication) */

.auth-page-content {
  min-height: calc(100vh - 280px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 80px 16px;
  position: relative;
}

/* Vầng hào quang ánh sáng phía sau thẻ đăng nhập */
.auth-bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-glow) 0%, var(--secondary-glow) 40%, transparent 70%);
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
  z-index: 1;
}

/* THẺ FORM XÁC THỰC CHÍNH */
.auth-card {
  width: 100%;
  max-width: 480px;
  background: rgba(18, 22, 34, 0.88);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 38px 32px;
  position: relative;
  z-index: 2;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(139, 92, 246, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 12px;
}

.auth-logo-badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: 6px;
}

.auth-logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
}

.auth-logo-text span {
  color: var(--secondary);
}

.auth-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* 1. NÚT ĐĂNG NHẬP GOOGLE NỔI BẬT */
.auth-social-group {
  margin-bottom: 22px;
}

.btn-google-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all var(--transition-fast);
}

.btn-google-login:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25), 0 0 15px rgba(66, 133, 244, 0.4);
}

.google-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Các nút mạng xã hội phụ */
.auth-social-secondary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.btn-social-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-social-sub:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--secondary);
  color: var(--text-main);
}

.btn-social-sub.discord i { color: #7289da; }
.btn-social-sub.facebook i { color: #1877f2; }
.btn-social-sub.apple i { color: #fff; }

/* Đường kẻ phân cách */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 12px;
}

/* 2. BỘ TAB CHUYỂN ĐỔI ĐĂNG NHẬP / ĐĂNG KÝ */
.auth-tabs-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab-btn {
  flex: 1;
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  box-shadow: 0 2px 10px var(--secondary-glow);
}

/* 3. CÁC Ô NHẬP LIỆU FORM */
.auth-form-panel {
  display: none;
}

.auth-form-panel.active {
  display: block;
}

.auth-form-group {
  margin-bottom: 18px;
}

.auth-form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.auth-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 11px 40px 11px 40px;
  font-size: 0.92rem;
  color: var(--text-main);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.auth-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 12px var(--secondary-glow);
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

.auth-input:focus + .auth-input-icon,
.auth-input:focus ~ .auth-input-icon {
  color: var(--secondary);
}

/* Nút ẩn/hiện mật khẩu */
.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  transition: color var(--transition-fast);
}

.btn-toggle-password:hover {
  color: var(--text-main);
}

/* Hàng ghi nhớ & Quên mật khẩu */
.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.auth-remember-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.auth-remember-check input {
  accent-color: var(--secondary);
  width: 15px;
  height: 15px;
}

.btn-forgot-password {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.btn-forgot-password:hover {
  text-decoration: underline;
  color: #fff;
}

/* Nút Submit */
.btn-auth-submit {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px var(--secondary-glow);
  transition: all var(--transition-fast);
}

.btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

/* 4. MODAL MÔ PHỎNG ĐĂNG NHẬP GOOGLE (POPUP CHỌN TÀI KHOẢN GOOGLE) */
.google-sim-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.google-sim-modal-overlay.active {
  display: flex;
}

.google-sim-modal {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  color: #1f2937;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  text-align: center;
}

.google-sim-header {
  margin-bottom: 20px;
}

.google-sim-header svg {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
}

.google-sim-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.google-sim-sub {
  font-size: 0.85rem;
  color: #6b7280;
}

.google-account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  text-align: left;
}

.google-account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.google-account-item:hover {
  background: #f3f4f6;
  border-color: #4285f4;
  transform: translateX(3px);
}

.google-acc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.google-acc-info {
  flex: 1;
}

.google-acc-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
}

.google-acc-email {
  font-size: 0.78rem;
  color: #6b7280;
}

.btn-google-sim-close {
  background: #f3f4f6;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-google-sim-close:hover {
  background: #e5e7eb;
  color: #111827;
}

/* =========================================================
   ĐỒNG BỘ CHẾ ĐỘ BAN NGÀY (LIGHT MODE)
   ========================================================= */
body.theme-light .auth-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.06);
}

body.theme-light .auth-title {
  color: #0f172a;
}

body.theme-light .auth-tabs-switcher {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .auth-tab-btn {
  color: #64748b;
}

body.theme-light .auth-tab-btn.active {
  color: #ffffff;
}

body.theme-light .btn-google-login {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.theme-light .btn-social-sub {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

body.theme-light .btn-social-sub.apple i {
  color: #000;
}

body.theme-light .auth-form-label {
  color: #1e293b;
}

body.theme-light .auth-input {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

/* =========================================================
   CỬA SỔ NỔI ĐĂNG NHẬP & ĐĂNG KÝ (FLOATING AUTH MODAL)
   ========================================================= */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-modal-window {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(18, 22, 34, 0.96);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg, 20px);
  padding: 36px 30px 30px 30px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: scale(0.9) translateY(24px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
}

/* Custom scrollbar bên trong modal */
.auth-modal-window::-webkit-scrollbar {
  width: 6px;
}
.auth-modal-window::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
.auth-modal-window::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 999px;
}
.auth-modal-window::-webkit-scrollbar-thumb:hover {
  background: var(--secondary, #06b6d4);
}

.auth-modal-overlay.active .auth-modal-window {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Nút tắt cửa sổ nổi [ ✕ ] */
.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s ease;
}

.auth-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  transform: rotate(90deg) scale(1.08);
}

/* Thích ứng Light mode cho Cửa Sổ Nổi */
body.theme-light .auth-modal-overlay {
  background: rgba(15, 23, 42, 0.65);
}

body.theme-light .auth-modal-window {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 0 35px rgba(139, 92, 246, 0.15);
}

body.theme-light .auth-modal-close {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

body.theme-light .auth-modal-close:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
}

@media (max-width: 540px) {
  .auth-card {
    padding: 24px 16px;
    margin: 20px auto;
  }

  .auth-modal-overlay {
    padding: 10px;
  }

  .auth-modal-window {
    padding: 24px 16px 20px 16px;
    border-radius: 16px;
    max-height: 94vh;
  }

  .auth-title {
    font-size: 1.25rem;
  }

  .auth-subtitle {
    font-size: 0.8rem;
  }

  .btn-google-login {
    font-size: 0.85rem;
    padding: 9px 14px;
  }

  .auth-social-secondary {
    flex-direction: column;
  }

  .btn-social-sub {
    width: 100%;
    justify-content: center;
  }

  .auth-options-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .btn-auth-submit {
    padding: 11px 18px;
    font-size: 0.9rem;
  }
}
