/* ── Reset & Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #e85c2a;
  --primary-dk:  #c94e20;
  --surface:     #ffffff;
  --bg:          #f5f5f5;
  --text:        #1a1a1a;
  --text-muted:  #6b7280;
  --border:      #e0e0e0;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(0,0,0,.10);
  --input-h:     48px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* ── Card ───────────────────────────────────────────────────────────── */
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  padding: 32px 28px;
}

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

.auth-card header .logo {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.auth-card header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

/* ── Steps ──────────────────────────────────────────────────────────── */
/* Each step is a separate div; only the active one is shown. */
.step { display: none; }
.step.active { display: block; }

/* ── Form elements ──────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="tel"],
input[type="text"],
input[type="email"] {
  width: 100%;
  height: var(--input-h);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 16px;
  outline: none;
  transition: border-color .2s;
}

input:focus { border-color: var(--primary); }

/* OTP input row: 6 individual digit boxes */
.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0;
}

.otp-row input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  padding: 0;
  transition: border-color .2s;
}

.otp-row input:focus { border-color: var(--primary); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: var(--input-h);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dk); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { border-color: #999; }

/* Social login buttons */
.btn-social { margin-bottom: 10px; }

.btn-google { background: #fff; border: 1.5px solid var(--border); color: #3c4043; }
.btn-google:hover { background: #f8f8f8; }

.btn-apple  { background: #000; color: #fff; }
.btn-apple:hover  { background: #222; }

/* ── Divider ─────────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 18px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Error / Info banners ────────────────────────────────────────────── */
.banner {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.banner.error   { background: #fff0f0; color: #c00; border: 1px solid #fcc; display: block; }
.banner.success { background: #f0fff4; color: #166534; border: 1px solid #bbf7d0; display: block; }
.banner.info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; display: block; }

/* ── Back link ───────────────────────────────────────────────────────── */
.back-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.back-link:hover { color: var(--text); }

/* ── Resend row ──────────────────────────────────────────────────────── */
.resend-row {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}
.resend-row button,
.btn-resend-inline {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}
.resend-row button:disabled,
.btn-resend-inline:disabled { color: var(--text-muted); cursor: not-allowed; }

/* ── Spinner ─────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Phone input: country-code select + local digits input ───────────── */
.phone-input-wrap {
  display: flex;
  gap: 8px;
}

.phone-input-wrap input[type="tel"] {
  flex: 1;
}

.country-select {
  height: var(--input-h);
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fafafa;
  cursor: pointer;
  outline: none;
  /* Shrink to content width so the local-digits input gets most of the space. */
  width: auto;
  flex-shrink: 0;
  transition: border-color .2s;
}

.country-select:focus { border-color: var(--primary); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .auth-card { padding: 24px 18px; }
  .otp-row input { width: 40px; height: 48px; font-size: 20px; }
}
