
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

:root {
  --black:   #0a0a0a;
  --g3:      #3a3a3c;
  --g4:      #636366;
  --g5:      #aeaeb2;
  --g6:      #d1d1d6;
  --g7:      #f2f2f7;
  --w:       #ffffff;
  --green:   #34c759;
  --gd:      #248a3d;
  --gl:      #d1f2d9;
  --red:     #ff3b30;
  --err-bg:  #fff0ef;
  --err-bd:  #ffc9c7;
  --err-tx:  #cc1f1a;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--w);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─ NAV ─────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  background: rgba(255,255,255,0.88);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-wrap {
  max-width: 1080px; margin: 0 auto;
  padding: 0 2rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; text-decoration: none; line-height: 1;
}
.nav-logo img { display: block; height: 30px; width: auto; }
.nav-logo-name {
  font-family: Arial, 'Helvetica Neue', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  background: linear-gradient(135deg, #1a7a30 0%, #34c759 60%, #248a3d 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
}
.nav-back {
  font-size: 14px; font-weight: 500; color: var(--g4);
  text-decoration: none; transition: color 0.15s;
  display: flex; align-items: center; gap: 5px;
}
.nav-back:hover { color: var(--black); }

/* ─ LAYOUT ───────────────────────────── */
.page {
  flex: 1; display: flex;
  align-items: center; justify-content: center;
  padding: 100px 1.5rem 60px;
}
.card {
  width: 100%; max-width: 420px;
  animation: up 0.5s ease forwards;
}
@keyframes up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─ ICON ─────────────────────────────── */
.card-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin-bottom: 20px;
  transition: background 0.4s;
}
.card-icon.lock  { background: #fff3e0; }
.card-icon.email { background: var(--gl); }

/* ─ HEADER ───────────────────────────── */
.card-title {
  font-size: 28px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.2; margin-bottom: 10px;
  transition: opacity 0.3s;
}
.card-subtitle {
  font-size: 15px; color: var(--g4); line-height: 1.6;
  margin-bottom: 32px;
}
.card-subtitle strong { color: var(--black); font-weight: 600; }

/* ─ FORM ─────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 500; color: var(--g3);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--g6);
  border-radius: 12px;
  font-family: inherit; font-size: 15px;
  color: var(--black); background: var(--w);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input::placeholder { color: var(--g5); }
.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.12);
}
.form-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
}
.form-error {
  font-size: 12px; color: var(--red);
  margin-top: 5px; display: none;
}
.form-error.visible { display: block; }

/* ─ BUTTON ───────────────────────────── */
.btn-primary {
  width: 100%; padding: 13px;
  background: var(--green); color: var(--w);
  border: none; border-radius: 12px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; letter-spacing: -0.01em;
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--gd); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  width: 100%; padding: 13px;
  background: var(--g7); color: var(--black);
  border: none; border-radius: 12px;
  font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  margin-top: 10px;
}
.btn-secondary:hover { background: var(--g6); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); }

/* ─ SPINNER ──────────────────────────── */
.spinner {
  display: none; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop  { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ─ BACK LINK ────────────────────────── */
.back-link {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--g4);
  text-decoration: none; margin-top: 20px;
  transition: color 0.15s; width: fit-content;
}
.back-link:hover { color: var(--black); }

/* ─ SUCCESS STATE ────────────────────── */
#successPanel { display: none; }
#formPanel    { display: block; }

/* ─ CODE INPUT ROW ───────────────────── */
.code-row {
  display: flex; gap: 10px; justify-content: center;
  margin-bottom: 24px;
}
.code-box {
  width: 52px; height: 58px;
  border: 1.5px solid var(--g6);
  border-radius: 12px;
  font-family: inherit; font-size: 22px; font-weight: 700;
  color: var(--black); text-align: center;
  outline: none; background: var(--w);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.code-box:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.12);
}
.code-box.filled { border-color: var(--gd); }

/* ─ NEW PASSWORD SECTION ─────────────── */
.password-wrap { position: relative; }
.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--g5); font-size: 13px; font-weight: 500;
  padding: 4px; transition: color 0.15s;
}
.password-toggle:hover { color: var(--g3); }

/* Password strength */
.strength-bar { display: flex; gap: 4px; margin-top: 8px; }
.strength-segment {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--g6); transition: background 0.3s;
}
.strength-label {
  font-size: 12px; color: var(--g5);
  margin-top: 4px; text-align: right; transition: color 0.3s;
}

/* ─ RESEND ───────────────────────────── */
.resend-row {
  text-align: center; margin-top: 18px;
  font-size: 13px; color: var(--g5);
}
.resend-btn {
  background: none; border: none;
  color: var(--gd); font-size: 13px; font-weight: 500;
  cursor: pointer; padding: 0;
  transition: opacity 0.15s;
}
.resend-btn:hover { opacity: 0.7; }
.resend-btn:disabled { color: var(--g5); cursor: default; opacity: 1; }

/* ─ STEP INDICATORS ──────────────────── */
.step-bar {
  display: flex; gap: 6px; margin-bottom: 28px;
}
.step-seg {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--g6); transition: background 0.4s;
}
.step-seg.active { background: var(--green); }

/* ─ SECURITY NOTE ────────────────────── */
.security-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 24px; font-size: 12px; color: var(--g5);
}

/* ─ FOOTER ───────────────────────────── */
footer {
  text-align: center; padding: 24px;
  font-size: 13px; color: var(--g5);
}
footer a { color: var(--g4); text-decoration: none; }
footer a:hover { color: var(--black); }

@media (max-width: 480px) {
  .card-title { font-size: 24px; }
  .code-box { width: 44px; height: 52px; font-size: 20px; }
}

/* Success checkmark animation */
.success-icon svg .circle { stroke-dasharray:213; stroke-dashoffset:213; animation:stroke-circle 0.5s cubic-bezier(0.65,0,0.45,1) forwards; }
.success-icon svg .check  { stroke-dasharray:48;  stroke-dashoffset:48;  animation:stroke-check  0.4s cubic-bezier(0.65,0,0.45,1) 0.5s forwards; }
@keyframes stroke-circle { to { stroke-dashoffset:0; } }
@keyframes stroke-check  { to { stroke-dashoffset:0; } }

/* Lucide icon sizing */
[data-lucide]{display:inline-block;vertical-align:middle}
