/* ═══════════════════════════════════════════════
   auth.css — Google Login + Auth Pages
   ═══════════════════════════════════════════════ */

/* ── Header Login Button (compact) ── */
.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.google-login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(66,133,244,0.06), rgba(234,67,53,0.06));
  opacity: 0;
  transition: opacity 0.2s;
}
.google-login-btn:hover::before { opacity: 1; }
.google-login-btn:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  border-color: #c0c0c0;
  transform: translateY(-1px);
}
.google-login-btn:active { transform: translateY(0); }
.google-login-btn svg { flex-shrink: 0; position: relative; z-index: 1; }
.google-login-btn span { position: relative; z-index: 1; }

[data-theme="dark"] .google-login-btn {
  background: #303134;
  color: #e8eaed;
  border-color: #5f6368;
}
[data-theme="dark"] .google-login-btn:hover {
  background: #3c4043;
  border-color: #80868b;
}

/* Header login text button (compact alternative) */
.header-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--primary, #2563EB);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}
.header-login-btn:hover {
  background: var(--primary-dark, #1D4ED8);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
  transform: translateY(-1px);
}
.header-signup-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: transparent;
  color: var(--text, #0F172A);
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}
.header-signup-btn:hover {
  border-color: var(--primary, #2563EB);
  color: var(--primary, #2563EB);
  background: var(--primary-light, #DBEAFE);
}

/* ── User Avatar (after sign in) ── */
.user-avatar-wrap { position: relative; }
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border, #e2e8f0);
  object-fit: cover;
  transition: all 0.2s;
}
.user-avatar:hover {
  border-color: var(--primary, #2563EB);
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  min-width: 260px;
  padding: 14px;
  z-index: 9999;
  display: none;
  animation: dropdownFade 0.15s ease;
}
@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-dropdown.open { display: block; }

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin-bottom: 8px;
}
.user-info-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-info-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text, #1a202c);
  line-height: 1.3;
}
.user-info-email {
  font-size: 12px;
  color: var(--text-secondary, #718096);
  word-break: break-all;
}

.user-signout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text, #1a202c);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.user-signout-btn:hover {
  background: var(--red-light, #FEE2E2);
  color: var(--red, #EF4444);
}

.auth-setup-hint {
  font-size: 12px;
  color: var(--text-secondary, #718096);
}
.auth-setup-hint a {
  color: var(--primary, #2563EB);
  text-decoration: underline;
}

#credential_picker_container { z-index: 99999 !important; }

#authContainer {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .google-login-btn span { display: none; }
  .google-login-btn { padding: 7px 9px; }
  .header-signup-btn { display: none; }
}

/* ═══════════════════════════════════════════════
   AUTH PAGES (login.html / register.html)
   ═══════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg, #F8FAFC);
}

/* Left brand panel */
.auth-brand-panel {
  flex: 1;
  background: linear-gradient(135deg, #2563EB 0%, #667eea 50%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 50px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-brand-panel::before {
  content: '';
  position: absolute;
  top: -20%; right: -20%;
  width: 500px; height: 500px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.auth-brand-panel::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -10%;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.auth-brand-content {
  position: relative;
  z-index: 1;
  max-width: 380px;
  text-align: center;
}
.auth-brand-logo {
  width: 64px; height: 64px;
  border-radius: 16px;
  margin-bottom: 24px;
}
.auth-brand-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.auth-brand-subtitle {
  font-size: 15px;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 32px;
}
.auth-brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  opacity: 0.9;
}
.auth-brand-feature svg {
  flex-shrink: 0;
  opacity: 0.9;
}

/* Right form panel */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  overflow-y: auto;
}
.auth-form-wrapper {
  width: 100%;
  max-width: 400px;
}

/* Mobile logo (hidden on desktop) */
.auth-mobile-logo {
  display: none;
  text-align: center;
  margin-bottom: 24px;
}
.auth-mobile-logo img {
  width: 48px; height: 48px;
  border-radius: 12px;
}

.auth-form-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text, #0F172A);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.auth-form-subtitle {
  font-size: 14px;
  color: var(--text-secondary, #475569);
  margin-bottom: 28px;
}

/* Google button on auth pages (large) */
.google-btn-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  background: #fff;
  color: #3c4043;
  border: 2px solid #dadce0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.google-btn-large:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  border-color: #b0b0b0;
  transform: translateY(-1px);
}
.google-btn-large:active { transform: translateY(0); }
.google-btn-large svg { flex-shrink: 0; }

[data-theme="dark"] .google-btn-large {
  background: #303134;
  color: #e8eaed;
  border-color: #5f6368;
}
[data-theme="dark"] .google-btn-large:hover {
  background: #3c4043;
  border-color: #80868b;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted, #94A3B8);
  font-size: 13px;
  font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #E2E8F0);
}

/* Form fields */
.auth-field-group {
  margin-bottom: 18px;
}
.auth-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #0F172A);
  margin-bottom: 6px;
}
.auth-field-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 10px;
  background: var(--bg-input, #F1F5F9);
  color: var(--text, #0F172A);
  font-family: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
}
.auth-field-input:focus {
  outline: none;
  border-color: var(--primary, #2563EB);
  background: var(--bg-card, #fff);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.auth-field-input::placeholder {
  color: var(--text-muted, #94A3B8);
}

/* Password field with toggle */
.auth-password-wrap {
  position: relative;
}
.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #94A3B8);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-password-toggle:hover { color: var(--text, #0F172A); }

/* Submit button */
.auth-submit-btn {
  width: 100%;
  padding: 13px 20px;
  background: var(--primary, #2563EB);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 6px;
}
.auth-submit-btn:hover {
  background: var(--primary-dark, #1D4ED8);
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
  transform: translateY(-1px);
}
.auth-submit-btn:active { transform: translateY(0); }
.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Remember me + forgot password row */
.auth-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  font-size: 13px;
}
.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-secondary, #475569);
}
.auth-checkbox-label input {
  width: 16px; height: 16px;
  accent-color: var(--primary, #2563EB);
  cursor: pointer;
}
.auth-forgot-link {
  color: var(--primary, #2563EB);
  text-decoration: none;
  font-weight: 500;
}
.auth-forgot-link:hover { text-decoration: underline; }

/* Footer link */
.auth-footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary, #475569);
}
.auth-footer-link a {
  color: var(--primary, #2563EB);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-link a:hover { text-decoration: underline; }

/* Error message */
.auth-error {
  background: var(--red-light, #FEE2E2);
  color: var(--red, #EF4444);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.auth-error.show { display: flex; }

/* Success message */
.auth-success {
  background: var(--green-light, #D1FAE5);
  color: var(--green, #10B981);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.auth-success.show { display: flex; }

/* Terms text */
.auth-terms {
  font-size: 12px;
  color: var(--text-muted, #94A3B8);
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}
.auth-terms a {
  color: var(--primary, #2563EB);
  text-decoration: none;
}

/* Back to home link */
.auth-back-home {
  position: absolute;
  top: 24px;
  left: 24px;
  font-size: 13px;
  color: var(--text-secondary, #475569);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: color 0.2s;
}
.auth-back-home:hover { color: var(--primary, #2563EB); }

/* Theme toggle on auth page */
.auth-theme-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 50%;
  width: 38px; height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #475569);
  transition: all 0.2s;
}
.auth-theme-toggle:hover {
  border-color: var(--primary, #2563EB);
  color: var(--primary, #2563EB);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .auth-brand-panel { display: none; }
  .auth-mobile-logo { display: block; }
  .auth-form-panel { padding: 60px 24px 40px; }
}

@media (max-width: 480px) {
  .auth-form-panel { padding: 56px 18px 32px; }
  .auth-form-title { font-size: 22px; }
  .auth-form-wrapper { max-width: 100%; }
}

/* ── Mobile Auth Links (in hamburger menu) ── */
.mobile-auth-links {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
  margin-top: 8px;
}
.mobile-auth-links.show { display: flex; }

.mobile-auth-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  color: var(--text, #0F172A);
  background: var(--bg-input, #F1F5F9);
}
.mobile-auth-link:hover {
  background: var(--primary-light, #DBEAFE);
  color: var(--primary, #2563EB);
}
.mobile-auth-signup {
  background: var(--primary, #2563EB) !important;
  color: #fff !important;
}
.mobile-auth-signup:hover {
  background: var(--primary-dark, #1D4ED8) !important;
}

/* When logged in, hide mobile auth links */
.mobile-auth-links.hide { display: none !important; }

