/* Auth pages shared stylesheet — login, sign-up, forgot, reset */
/* Loaded via <link> in each auth view; requires Inter font */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Page shell ─────────────────────────────────────────────── */
body.auth-page {
  margin: 0;
  padding-top: 50px;          /* mobile top-bar height */
  min-height: 100vh;
  background: linear-gradient(135deg, #357aff 0%, #ffd7bb 70%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  color: #1f2937;
  box-sizing: border-box;
}

.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 32px;
}

/* ── Card ───────────────────────────────────────────────────── */
.auth-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 26px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.40) inset;
  width: 100%;
  max-width: 380px;
  animation: authSlideUp 0.3s ease-out;
}

.auth-card-wide { max-width: 440px; }

@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Branding ───────────────────────────────────────────────── */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.auth-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 20%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-brand-name {
  font-size: 13px;
  color: #718096;
}

.auth-brand-name b {
  color: #f78929;
  font-weight: 700;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin: 14px 0 6px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.auth-sub {
  font-size: 13px;
  color: #718096;
  margin: 0 0 22px;
  line-height: 1.5;
}

/* ── Fields ─────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field-mb8 { margin-bottom: 8px; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.field-label > span {
  font-size: 11px;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field-hint {
  font-size: 10px;
  color: #a0aec0;
  font-style: italic;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  color: #1f2937;
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus {
  border-color: #357aff;
  box-shadow: 0 0 0 3px rgba(53,122,255,0.12);
}

.field input.is-error  { border-color: #ef4444; }
.field input.is-success { border-color: #10b981; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}

/* ── Strength bars ──────────────────────────────────────────── */
.strength-bars {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.strength-bars span {
  flex: 1;
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
  transition: background 0.25s;
}

.strength-bars span.s-weak   { background: #ef4444; }
.strength-bars span.s-medium { background: #f59e0b; }
.strength-bars span.s-strong { background: #10b981; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #357aff, #5b9bff);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(53,122,255,0.30);
  width: 100%;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) { opacity: 0.92; }
.btn-primary:active:not(:disabled) { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
.btn-primary.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Remember / forgot row ──────────────────────────────────── */
.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #718096;
  cursor: pointer;
  user-select: none;
}

.auth-remember input[type="checkbox"] { accent-color: #357aff; width: 13px; height: 13px; }

.auth-forgot {
  font-size: 12px;
  color: #357aff;
  font-weight: 500;
  text-decoration: none;
}

/* ── Divider + social ───────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #a0aec0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.btn-social {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: #1f2937;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.btn-social:hover { border-color: #cbd5e0; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

/* ── Alerts ─────────────────────────────────────────────────── */
.auth-alert {
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.auth-alert-success {
  background: #ecfdf5;
  border: 1px solid rgba(16,185,129,0.25);
  color: #065f46;
}

.auth-alert-error {
  background: #fef2f2;
  border: 1px solid rgba(239,68,68,0.25);
  color: #dc2626;
}

.auth-alert i { margin-top: 1px; flex-shrink: 0; }

/* ── Password rules ─────────────────────────────────────────── */
.pw-rules {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.pw-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #718096;
  margin-bottom: 6px;
}

.pw-rule:last-child { margin-bottom: 0; }

/* ── Footer link ────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: #718096;
  margin-top: 18px;
}

.auth-footer a {
  color: #357aff;
  font-weight: 600;
  text-decoration: none;
}

/* ── Inline error text ──────────────────────────────────────── */
.field-error {
  font-size: 11px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}
.field-error.show { display: block; }

/* ── 2-col name grid ────────────────────────────────────────── */
.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

/* ── Phone row with country code ────────────────────────────── */
.phone-row { display: flex; gap: 8px; }
.phone-row select { width: 84px; flex-shrink: 0; }
.phone-row input  { flex: 1; }

/* ── Conditional section ────────────────────────────────────── */
.cond-section {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.cond-section.active { max-height: 600px; opacity: 1; }

/* ── Toggle container ───────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 14px;
  cursor: pointer;
}

.auth-option-card {
  margin: 16px 0 18px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.auth-option-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #526279;
  margin-bottom: 6px;
}

.auth-option-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.auth-option-copy {
  font-size: 11.5px;
  line-height: 1.5;
  color: #718096;
  margin-bottom: 10px;
}

.auth-option-card .toggle-row {
  margin-bottom: 0;
  background: #ffffff;
}

.auth-option-card .cond-section.active {
  margin-top: 12px;
}

.field-note {
  font-size: 11px;
  color: #718096;
  margin-top: 4px;
  line-height: 1.45;
}

.toggle-label-text {
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: #cbd5e0;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.25s;
}

.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-track { background: #357aff; }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); }

/* ── Terms checkbox ─────────────────────────────────────────── */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #718096;
  margin-bottom: 18px;
  line-height: 1.5;
}

.terms-row input[type="checkbox"] { accent-color: #357aff; width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; }
.terms-row a { color: #357aff; }

/* ── Desktop breakpoint ─────────────────────────────────────── */
@media (min-width: 640px) {
  body.auth-page { padding-top: 56px; }
  .auth-card { padding: 34px 38px; }
  .auth-title { font-size: 26px; }
}
