/* ============================================
   CareAnchor Auth Pages
   Large touch targets for caregivers 60-80+
   Uses same design tokens as theme.css
   ============================================ */

body.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.auth-nav {
  padding: 20px 40px;
  border-bottom: 1px solid var(--cream-dark);
}
.auth-nav__inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-nav__logo {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.auth-nav__back {
  font-size: 0.9rem;
  color: var(--ink-light);
  text-decoration: none;
}
.auth-nav__back:hover { color: var(--teal); }

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--cream-dark);
  width: 100%;
  max-width: 480px;
}

.auth-card__icon {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.auth-card__title {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-card__sub {
  font-size: 0.95rem;
  color: var(--ink-light);
  text-align: center;
  margin-bottom: 36px;
  line-height: 1.5;
}

/* Error banner */
.auth-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #B91C1C;
  font-size: 0.9rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Inline field-level errors */
.field-error {
  display: none;
  font-size: 0.83rem;
  color: #B91C1C;
  margin-top: -2px;
  line-height: 1.4;
}
.field-error a {
  color: #B91C1C;
  font-weight: 600;
  text-decoration: underline;
}

/* Form fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field__label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.form-field__hint {
  font-size: 0.8rem;
  color: var(--ink-light);
  line-height: 1.4;
}

/* Large inputs — 48px+ for touch accessibility */
.form-field input,
.form-field select {
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.12);
}

.form-field input::placeholder {
  color: #A0A0A0;
}

/* Password field */
.password-wrapper {
  position: relative;
}
.password-wrapper input {
  padding-right: 52px;
}
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light);
  font-size: 1.1rem;
  padding: 4px;
  line-height: 1;
}

/* Password strength */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.strength-bar {
  height: 4px;
  flex: 1;
  background: var(--cream-dark);
  border-radius: 2px;
  transition: background 0.2s;
}
.strength-bar.weak { background: #EF4444; }
.strength-bar.fair { background: #F59E0B; }
.strength-bar.good { background: #22C55E; }
.strength-label {
  font-size: 0.75rem;
  color: var(--ink-light);
  margin-top: 4px;
}

/* Primary button — large, accessible */
.btn-auth {
  height: 52px;
  width: 100%;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 8px;
}
.btn-auth:hover { background: var(--teal-light); }
.btn-auth:active { transform: scale(0.98); }
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-light);
  font-size: 0.85rem;
  margin: 8px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cream-dark);
}

/* Link under form */
.auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-top: 20px;
}
.auth-switch a {
  color: var(--teal);
  font-weight: 500;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* Loading state on button */
.btn-auth.loading {
  position: relative;
  color: transparent;
}
.btn-auth.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}