*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: #09090b;
    color: #e4e4e7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: 1.5rem 1rem;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(139,92,246,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 90% 80%, rgba(139,92,246,0.08) 0%, transparent 60%);
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.step { display: none; animation: fadeUp 0.4s ease both; }
.step.active { display: block; }

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

.brand {
    display: flex; align-items: center; justify-content: center;
    gap: 0.6rem; margin-bottom: 2rem; text-decoration: none;
}
.brand svg { width: 28px; height: 28px; stroke: #8b5cf6; }
.brand-text { font-size: 1.2rem; font-weight: 700; color: #e4e4e7; letter-spacing: -0.02em; }

.auth-card {
    background: #111113; border: 1px solid #27272a;
    border-radius: 16px; padding: 2rem;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.icon-circle {
    width: 52px; height: 52px; border-radius: 12px;
    background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.25);
    display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem;
}
.icon-circle svg { width: 24px; height: 24px; stroke: #8b5cf6; }

.auth-card h1 { font-size: 1.4rem; font-weight: 700; color: #f4f4f5; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.auth-card .subtitle { font-size: 0.875rem; color: #71717a; margin-bottom: 1.75rem; line-height: 1.55; }
.auth-card .subtitle strong { color: #a1a1aa; }

.field { margin-bottom: 1.1rem; }
.field label {
    display: block; font-size: 0.8rem; font-weight: 500; color: #a1a1aa;
    margin-bottom: 0.45rem; letter-spacing: 0.02em; text-transform: uppercase;
}
.field input {
    width: 100%; padding: 0.75rem 1rem;
    background: #18181b; border: 1px solid #27272a; border-radius: 8px;
    color: #e4e4e7; font-size: 0.95rem; font-family: inherit;
    outline: none; transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none; min-height: 44px;
}
.field input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.field input::placeholder { color: #52525b; }

/* OTP row */
.otp-row {
    display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 1.25rem;
    flex-wrap: nowrap;
}
.otp-row input {
    width: 44px; height: 50px; flex: 1; max-width: 56px;
    text-align: center; font-size: 1.2rem; font-weight: 700;
    background: #18181b; border: 1px solid #27272a; border-radius: 8px;
    color: #e4e4e7; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
    caret-color: #8b5cf6; -webkit-appearance: none; min-height: 44px;
}
.otp-row input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }

/* Password strength */
.strength-bar { height: 3px; background: #27272a; border-radius: 2px; margin-top: 0.5rem; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 2px; width: 0%; transition: width 0.3s, background 0.3s; }
.strength-label { font-size: 0.72rem; color: #52525b; margin-top: 0.3rem; }

.error-msg {
    display: none; padding: 0.7rem 1rem;
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.35);
    border-radius: 8px; color: #f87171; font-size: 0.875rem; margin-bottom: 1.1rem;
}
.success-msg {
    display: none; padding: 0.7rem 1rem;
    background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.35);
    border-radius: 8px; color: #4ade80; font-size: 0.875rem; margin-bottom: 1.1rem;
}

.btn-submit {
    width: 100%; padding: 0.8rem;
    background: #8b5cf6; color: #fff; border: none; border-radius: 8px;
    font-size: 0.95rem; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s; min-height: 46px;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-submit:hover  { background: #7c3aed; box-shadow: 0 4px 20px rgba(139,92,246,0.35); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-submit .spinner {
    display: none; width: 16px; height: 16px; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.resend-row { text-align: center; margin-top: 1rem; font-size: 0.8rem; color: #71717a; }
.resend-row button {
    background: none; border: none; color: #8b5cf6; font-size: 0.8rem;
    font-weight: 500; cursor: pointer; padding: 0; font-family: inherit;
    min-height: 32px;
}
.resend-row button:hover { color: #a78bfa; text-decoration: underline; }
.resend-row button:disabled { color: #52525b; cursor: not-allowed; text-decoration: none; }

.progress-dots { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.75rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #27272a; transition: background 0.3s, transform 0.3s; }
.dot.active { background: #8b5cf6; transform: scale(1.2); }
.dot.done   { background: #22c55e; }

.auth-footer { text-align: center; font-size: 0.875rem; color: #71717a; margin-top: 1.5rem; }
.auth-footer a { color: #8b5cf6; text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

.back-home {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    margin-top: 1.5rem; font-size: 0.8rem; color: #52525b;
    text-decoration: none; transition: color 0.2s; min-height: 36px;
}
.back-home:hover { color: #a1a1aa; }
.back-home svg { width: 14px; height: 14px; }

/* ============================================
   RESPONSIVE — Small Mobile (max-width: 400px)
   ============================================ */
@media (max-width: 400px) {
    body { padding: 1rem 0.75rem; justify-content: flex-start; padding-top: 2rem; }
    .auth-card { padding: 1.35rem; border-radius: 12px; }
    .auth-card h1 { font-size: 1.25rem; }

    /* OTP inputs smaller on tiny screens */
    .otp-row { gap: 0.35rem; }
    .otp-row input { font-size: 1.05rem; height: 44px; }
}