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

:root {
    --bg: #0a0a0f;
    --card: rgba(20, 20, 30, 0.92);
    --card-border: rgba(255, 255, 255, 0.06);
    --text: #ffffff;
    --muted: #8888a8;
    --accent: #7c6cff;
    --accent-2: #a78bfa;
    --success: #34d399;
    --danger: #f87171;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#app {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: #7c6cff;
    top: -100px;
    left: -80px;
    opacity: 0.2;
}

.orb-2 {
    width: 260px;
    height: 260px;
    background: #ff6b6b;
    bottom: -60px;
    right: -60px;
    opacity: 0.15;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #ffd93d;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.08;
    filter: blur(100px);
}

.container {
    position: relative;
    z-index: 1;
    background: var(--card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 32px 24px 28px;
    box-shadow: var(--shadow);
    text-align: center;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(124, 108, 255, 0.05), transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(255, 107, 107, 0.05), transparent 60%);
    pointer-events: none;
}

.screen {
    display: none;
    animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    z-index: 1;
}

.screen.active { display: block; }

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

/* Баннер с фото */
.banner-wrap {
    margin: 0 -24px 24px -24px;
    padding: 0 6px;
}

.banner-border {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #ff4444, #ff6b6b, #ff4444, #ff6b6b);
    padding: 4px;
    box-shadow: 
        0 0 40px rgba(255, 50, 50, 0.2),
        inset 0 0 40px rgba(255, 50, 50, 0.05);
}

.banner-border::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 50, 50, 0.1), rgba(255, 50, 50, 0.3), rgba(255, 50, 50, 0.1));
    pointer-events: none;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.banner-photo {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 17px;
    background: #0a0a0f;
}

.welcome-text h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.hint {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
    opacity: 0.7;
    letter-spacing: 0.02em;
}

.timer-hint {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #8888a8;
    transition: color 0.3s;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.step-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-2);
    background: rgba(124, 108, 255, 0.12);
    border: 1px solid rgba(124, 108, 255, 0.2);
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.lock-icon {
    font-size: 44px;
    margin-bottom: 8px;
    display: block;
}

.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, #9b7dff 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 32px rgba(124, 108, 255, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(124, 108, 255, 0.45);
}

.btn-primary:active:not(:disabled) { transform: scale(0.97); }

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon { font-size: 18px; }

.btn-ghost {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    color: var(--muted);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}

.code-digit {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    outline: none;
    transition: all 0.25s;
    caret-color: var(--accent);
}

.code-digit:focus {
    border-color: var(--accent);
    background: rgba(124, 108, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.15);
    transform: scale(1.02);
}

.code-digit:not(:placeholder-shown) {
    border-color: var(--accent);
}

.input-wrap { margin-bottom: 20px; }

.input-wrap input,
input[type="password"],
input[type="text"]:not(.code-digit) {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    font-size: 16px;
    color: var(--text);
    text-align: center;
    outline: none;
    transition: all 0.25s;
}

.input-wrap input:focus,
input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.12);
}

input::placeholder { color: var(--muted); }

.spinner-wrap { margin: 16px auto 24px; }

.spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-label {
    color: var(--muted);
    font-size: 15px;
}

.success-circle {
    width: 88px;
    height: 88px;
    margin: 12px auto 24px;
}

.checkmark {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: block;
    stroke-width: 2.5;
    stroke: var(--success);
    stroke-miterlimit: 10;
    animation: fill 0.4s ease-in-out 0.35s forwards, scale 0.3s ease-in-out 0.8s both;
}

.checkmark circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2.5;
    stroke: var(--success);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark path {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    stroke: var(--success);
    animation: stroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale(1.06); }
}
@keyframes fill {
    100% { box-shadow: inset 0 0 0 40px rgba(52, 211, 153, 0.1); }
}

@media (max-width: 420px) {
    .container {
        padding: 24px 16px 20px;
        border-radius: 24px;
    }
    .banner-wrap {
        margin: 0 -16px 20px -16px;
        padding: 0 4px;
    }
    .code-digit {
        width: 44px;
        height: 52px;
        font-size: 20px;
    }
    .welcome-text h1 { font-size: 22px; }
}