*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8edf8 0%, #f5f0fb 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 20px;
}
.card { background: #fff; border-radius: 20px; padding: 48px 40px 40px; width: 100%; max-width: 420px; box-shadow: 0 8px 40px rgba(74,124,252,.12), 0 2px 8px rgba(0,0,0,.06); }
.logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.logo-icon { width: 38px; height: 38px; background: linear-gradient(135deg,#4a7cfc,#7c3aed); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.logo-text { font-size: 20px; font-weight: 700; color: #111; letter-spacing: -.3px; }
.step-title { font-size: 22px; font-weight: 700; color: #111; margin-bottom: 6px; }
.step-sub { font-size: 14px; color: #888; margin-bottom: 28px; line-height: 1.5; }
.field { position: relative; margin-bottom: 6px; }
.field input { width: 100%; padding: 14px 16px; border: 1.5px solid #e5e7eb; border-radius: 12px; font-size: 15px; color: #111; outline: none; transition: border-color .2s, box-shadow .2s; background: #fafafa; font-family: inherit; }
.field input::placeholder { color: #bbb; }
.field input:focus { border-color: #4a7cfc; background: #fff; box-shadow: 0 0 0 3px rgba(74,124,252,.12); }
.field input.invalid { border-color: #ef4444; }
.field input.code-input { font-size: 26px; font-weight: 700; letter-spacing: 8px; text-align: center; padding: 16px; color: #4a7cfc; }
.error-msg { font-size: 13px; color: #ef4444; min-height: 20px; padding: 4px 2px 0; }
.attempts-bar { display: flex; gap: 6px; margin: 12px 0 4px; }
.attempt-dot { width: 8px; height: 8px; border-radius: 50%; background: #4a7cfc; transition: background .3s; }
.attempt-dot.used { background: #e5e7eb; }
.btn { width: 100%; padding: 14px; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .15s, transform .1s; font-family: inherit; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn-primary { background: linear-gradient(135deg,#4a7cfc,#6366f1); color: #fff; margin-top: 16px; }
.btn-primary:hover:not(:disabled) { opacity: .9; }
.btn-secondary { background: #f3f4f6; color: #555; margin-top: 10px; font-size: 14px; padding: 12px; }
.btn-secondary:hover:not(:disabled) { background: #e9eaf0; }
.success-screen { text-align: center; padding: 16px 0 8px; }
.success-icon { width: 64px; height: 64px; background: linear-gradient(135deg,#22c55e,#16a34a); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.success-title { font-size: 22px; font-weight: 700; color: #111; margin-bottom: 8px; }
.success-sub { font-size: 14px; color: #888; margin-bottom: 28px; }
.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; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.step { display: none; }
.step.active { display: block; }
.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.countdown { font-size: 13px; color: #9ca3af; margin-top: 8px; text-align: center; min-height: 18px; }
