/* auth.css — Login page styles
   Inherits all design tokens from base.css (:root variables)
   Vintage Indian democracy aesthetic — stamp card, form fields */

/* --- Page Layout --- */
.auth-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
}

/* --- Login Card --- */
.auth-card {
  background: var(--khadi);
  border: 2px solid var(--sepia);
  border-radius: var(--radius-md);
  padding: var(--space-2xl) var(--space-xl);
  width: 100%;
  max-width: 420px;
  box-shadow:
    var(--shadow-md),
    0 0 0 6px rgba(245, 236, 215, 0.8),
    0 0 0 8px rgba(123, 94, 58, 0.15);
  position: relative;
  /* Ruled-line texture matching other cards */
  background-image: repeating-linear-gradient(
    transparent, transparent 31px,
    rgba(123, 94, 58, 0.05) 32px
  );
  animation: pageEntry var(--transition-slow) ease forwards;
}

/* Inner decorative stamp border */
.auth-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--sepia-light);
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0.6;
}

/* --- Card Header --- */
.auth-card-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.auth-logo-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px dashed var(--sepia);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  position: relative;
  background: rgba(245, 236, 215, 0.6);
}

.auth-logo-circle::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(123, 94, 58, 0.3);
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: var(--space-xs);
}

.auth-logo-text em {
  color: var(--saffron);
  font-style: normal;
}

.auth-tagline {
  font-family: var(--font-stamp);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--sepia);
  margin-bottom: var(--space-md);
}

/* Thin tricolor divider */
.auth-tricolor {
  height: 3px;
  display: flex;
  margin: 0 var(--space-lg) var(--space-lg);
  border-radius: 2px;
  overflow: hidden;
}
.auth-tricolor span { flex: 1; }
.auth-tricolor span:nth-child(1) { background: var(--saffron); }
.auth-tricolor span:nth-child(2) { background: rgba(245,236,215,0.8); border: 1px solid var(--sepia-light); }
.auth-tricolor span:nth-child(3) { background: var(--india-green); }

/* --- Google Sign-In Button --- */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: 13px var(--space-lg);
  background: var(--khadi);
  border: 2px solid var(--sepia);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  min-height: 52px;
  transition: background var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
  margin-bottom: var(--space-lg);
}

.btn-google:hover:not(:disabled) {
  background: var(--saffron);
  color: var(--white);
  border-color: var(--saffron-dark);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Google "G" icon container */
.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- OR Divider --- */
.auth-or {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  border-top: 1px dashed var(--sepia-light);
}

.auth-or span {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--ash);
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Email/Password Form --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Expand section for register extra field */
.auth-register-extra {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}
.auth-register-extra.expanded {
  max-height: 100px;
}

/* Form field — bottom-border only style */
.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sepia);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--sepia);
  padding: var(--space-sm) 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--navy);
  outline: none;
  border-radius: 0;
  width: 100%;
  min-height: 44px;
  transition: border-color var(--transition-fast);
}

.form-input::placeholder {
  color: var(--ash);
  font-style: italic;
}

.form-input:focus {
  border-bottom-color: var(--saffron);
}

/* Password field wrapper (for show/hide toggle) */
.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrap .form-input {
  padding-right: var(--space-xl);
}

.btn-pw-toggle {
  position: absolute;
  right: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--ash);
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  justify-content: flex-end;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}
.btn-pw-toggle:hover { color: var(--saffron); }

/* --- Submit Button --- */
.btn-auth-submit {
  width: 100%;
  padding: 14px var(--space-lg);
  background: var(--saffron);
  color: var(--white);
  border: 2px solid var(--sepia);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: background var(--transition-fast), transform var(--transition-fast);
  letter-spacing: 0.02em;
}

.btn-auth-submit:hover:not(:disabled) {
  background: var(--saffron-dark);
  transform: translateY(-1px);
}

.btn-auth-submit:disabled {
  background: var(--ash);
  border-color: var(--ash);
  cursor: not-allowed;
  transform: none;
}

/* --- Toggle Link (Sign In ↔ Register) --- */
.auth-toggle-link {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--ash);
  margin-top: var(--space-md);
}

.auth-toggle-link button {
  background: none;
  border: none;
  color: var(--saffron);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-weight: 600;
}
.auth-toggle-link button:hover { color: var(--saffron-dark); }

/* --- Inline Spinner (CSS only) --- */
.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.btn-google .auth-spinner {
  border-color: rgba(224, 123, 57, 0.3);
  border-top-color: var(--saffron);
}

/* --- Error Card --- */
.auth-error {
  background: rgba(192, 57, 43, 0.06);
  border-left: 3px solid var(--ballot-red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ballot-red);
  display: none;
  animation: stampIn 200ms ease-out;
  line-height: 1.5;
  margin-top: var(--space-sm);
}
.auth-error.visible { display: block; }

/* --- Verification Notice --- */
.auth-verify-notice {
  background: rgba(45, 106, 79, 0.06);
  border: 1px dashed var(--india-green);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  display: none;
  text-align: center;
  animation: stampIn 300ms ease-out;
  margin-top: var(--space-md);
}
.auth-verify-notice.visible { display: block; }

.auth-verify-notice p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--india-green);
  margin: var(--space-sm) 0 0;
  line-height: 1.5;
}

.verify-icon {
  color: var(--india-green);
  font-size: 1.5rem;
  display: block;
}

.btn-resend {
  background: none;
  border: none;
  color: var(--saffron);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: var(--space-sm);
  display: inline-block;
}
.btn-resend:hover { color: var(--saffron-dark); }


.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #FAF3E0;
  border: 1.5px solid #7B5E3A;
  border-radius: 6px;
  box-shadow: 4px 4px 16px rgba(123, 94, 58, 0.25);
  padding: 16px;
  z-index: 1000;
  animation: dropdownIn 200ms ease forwards;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-avatar {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #E07B39;
  margin: 0 auto 10px auto;
  object-fit: cover;
}

.profile-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #E07B39;
  color: #FAF3E0;
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin: 0 auto 10px auto;
  border: 2px solid #7B5E3A;
}

.profile-name {
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  color: #1A1A2E;
  text-align: center;
  margin-bottom: 4px;
}

.profile-email {
  font-family: 'Hind', sans-serif;
  font-size: 12px;
  color: #9E9E9E;
  text-align: center;
  margin-bottom: 12px;
  word-break: break-all;
}

.profile-divider {
  border: none;
  border-top: 1px dashed #7B5E3A;
  margin: 8px 0 12px 0;
}

.profile-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 1.5px solid #7B5E3A;
  border-radius: 4px;
  font-family: 'Hind', sans-serif;
  font-size: 14px;
  color: #7B5E3A;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, 
              border-color 200ms ease;
}

.profile-signout-btn:hover {
  background: #C0392B;
  color: #FAF3E0;
  border-color: #C0392B;
}

.profile-signout-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.profile-trigger {
  position: relative;
  cursor: pointer;
}


/* ─── Top Profile Image (Trigger) ─── */
.user-avatar-btn {
  width: 48px;
  height: 48px;
  border: 1.5px solid #7B5E3A;
  background: #FAF3E0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #E07B39;
  padding: 0;
  overflow: hidden;
}

.user-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
