:root {
    --bg: #08080a;
    --surface: #101012;
    --surface-hover: #151518;

    --border: #252529;
    --border-hover: #38383f;

    --text: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-light: #a78bfa;

    --accent-soft: rgba(139, 92, 246, 0.1);
    --accent-glow: rgba(139, 92, 246, 0.18);

    --green: #34d399;

    --radius: 16px;
    --radius-small: 10px;
}


/* ─────────────────────────────
   RESET
───────────────────────────── */

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

html {
    min-height: 100%;
    background: var(--bg);
    color-scheme: dark;
}

body {
    min-height: 100vh;

    background:
        radial-gradient(
            700px 400px at 50% -180px,
            rgba(139, 92, 246, 0.2),
            transparent
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
}


/* ─────────────────────────────
   PAGE
───────────────────────────── */

.page {
    width: min(100% - 40px, 720px);
    margin: 0 auto;
    padding: 28px 0 60px;
}


/* ─────────────────────────────
   HEADER
───────────────────────────── */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    height: 44px;

    margin-bottom: 90px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--text);

    font-size: 15px;
    font-weight: 700;

    text-decoration: none;
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border-radius: 8px;

    background: var(--accent);
    color: white;

    font-size: 14px;
    font-weight: 800;

    box-shadow:
        0 0 24px rgba(139, 92, 246, 0.3);
}


/* ─────────────────────────────
   LANGUAGE
───────────────────────────── */

.language-switcher {
    display: flex;
    align-items: center;
    gap: 2px;

    padding: 3px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 8px;
}

.language-switcher a {
    padding: 5px 8px;

    border-radius: 5px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;

    text-decoration: none;

    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.language-switcher a:hover {
    color: var(--text-secondary);
}

.language-switcher a[aria-current="true"] {
    background: var(--surface-hover);
    color: var(--text);
}


/* ─────────────────────────────
   HERO
───────────────────────────── */

.hero {
    margin-bottom: 38px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 6px 10px;

    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 999px;

    background: var(--accent-soft);

    color: var(--accent-light);

    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.02em;

    margin-bottom: 18px;
}

.hero-badge span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 10px rgba(52, 211, 153, 0.5);
}

.hero h1 {
    display: flex;
    align-items: center;
    gap: 12px;

    font-size: clamp(42px, 8vw, 64px);
    font-weight: 800;
    line-height: 1;

    letter-spacing: -0.055em;

    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--accent);

    font-weight: 400;

    transform: translateY(-2px);
}

.hero-description {
    max-width: 570px;

    color: var(--text-secondary);

    font-size: 18px;
    line-height: 1.6;

    margin-bottom: 16px;
}

.hero-help {
    color: var(--text-muted);

    font-size: 13px;
    line-height: 1.6;
}

.hero a {
    color: var(--accent-light);
    text-decoration: none;
}

.hero a:hover {
    text-decoration: underline;
}


/* ─────────────────────────────
   CARD
───────────────────────────── */

.card {
    position: relative;

    padding: 28px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.025),
            transparent
        ),
        var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow:
        0 1px 1px rgba(255, 255, 255, 0.02),
        0 24px 70px rgba(0, 0, 0, 0.3);

    margin-bottom: 16px;
}

.card::before {
    content: "";

    position: absolute;

    top: -1px;
    left: 40px;
    right: 40px;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(139, 92, 246, 0.5),
            transparent
        );
}


/* ─────────────────────────────
   STEP HEADER
───────────────────────────── */

.step-header {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 28px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border-radius: 10px;

    background: var(--accent-soft);
    border: 1px solid rgba(139, 92, 246, 0.18);

    color: var(--accent-light);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.step-header h2 {
    color: var(--text);

    font-size: 16px;
    font-weight: 700;

    margin-bottom: 3px;
}

.step-header p {
    color: var(--text-muted);

    font-size: 12px;
}


/* ─────────────────────────────
   FORM
───────────────────────────── */

.form-fields {
    display: grid;
    gap: 18px;

    margin-bottom: 22px;
}

.field label,
.test-fields label {
    display: block;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 600;

    margin-bottom: 7px;
}

label a {
    color: var(--accent-light);
    text-decoration: none;

    margin-left: 4px;
}

label a:hover {
    text-decoration: underline;
}

input {
    display: block;

    width: 100%;
    height: 46px;

    padding: 0 13px;

    background: #0b0b0e;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    color: var(--text);

    font: inherit;
    font-size: 14px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

input::placeholder {
    color: #52525a;
}

input:hover {
    border-color: var(--border-hover);
}

input:focus {
    background: #0d0d10;

    border-color: var(--accent);

    box-shadow:
        0 0 0 3px var(--accent-glow);
}


/* ─────────────────────────────
   BUTTONS
───────────────────────────── */

button,
.primary-button,
.secondary-button,
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    height: 46px;

    border-radius: var(--radius-small);

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.15s ease;
}

.primary-button {
    border: 1px solid rgba(255, 255, 255, 0.08);

    background: var(--accent);
    color: white;

    box-shadow:
        0 6px 20px rgba(139, 92, 246, 0.18);
}

.primary-button:hover {
    background: var(--accent-hover);

    box-shadow:
        0 8px 28px rgba(139, 92, 246, 0.3);
}

.primary-button:active {
    transform: translateY(1px);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.button-arrow {
    font-size: 16px;
    font-weight: 400;
}

.secondary-button {
    background: var(--surface-hover);

    border: 1px solid var(--border);

    color: var(--text-secondary);
}

.secondary-button:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: #1b1b1f;
}


/* ─────────────────────────────
   CODE
───────────────────────────── */

.code-wrapper {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    margin-bottom: 12px;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    height: 34px;

    padding: 0 12px;

    background: #0c0c0f;

    border-bottom: 1px solid var(--border);

    color: var(--text-muted);

    font-family: monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.code-dots {
    display: flex;
    gap: 5px;
}

.code-dots span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #3f3f46;
}

pre {
    margin: 0;

    padding: 18px;

    background: #09090b;

    overflow-x: auto;

    color: #c4b5fd;

    font-family:
        "SFMono-Regular",
        "Cascadia Code",
        "Roboto Mono",
        Consolas,
        monospace;

    font-size: 12px;
    line-height: 1.7;
}

code {
    font-family: inherit;
}


/* ─────────────────────────────
   TEST
───────────────────────────── */

.test-section {
    margin-top: 30px;
    padding-top: 28px;

    border-top: 1px solid var(--border);
}

.test-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 16px;
}

.test-header h3 {
    color: var(--text);

    font-size: 14px;
    font-weight: 700;

    margin-bottom: 4px;
}

.test-header p {
    color: var(--text-muted);

    font-size: 12px;
}

.test-badge {
    padding: 4px 7px;

    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 5px;

    color: var(--green);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.test-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;

    margin-bottom: 14px;
}


/* ─────────────────────────────
   FOOTER
───────────────────────────── */

footer {
    display: flex;
    justify-content: center;
    gap: 8px;

    padding-top: 30px;

    color: var(--text-muted);

    font-size: 11px;
}

footer span:first-child {
    color: var(--text-secondary);
    font-weight: 600;
}


/* ─────────────────────────────
   SUCCESS PAGE
───────────────────────────── */

.success-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.success-card {
    width: min(100%, 460px);

    padding: 48px 40px;

    text-align: center;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.025),
            transparent
        ),
        var(--surface);

    border: 1px solid var(--border);
    border-radius: 20px;

    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.4);

    animation: success-in 0.35s ease-out;
}

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;

    margin: 0 auto 24px;

    border-radius: 50%;

    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);

    color: var(--green);

    box-shadow:
        0 0 40px rgba(52, 211, 153, 0.08);
}

.success-icon svg {
    width: 28px;
    height: 28px;
}

.success-label {
    display: block;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    margin-bottom: 10px;
}

.success-content h1 {
    color: var(--text);

    font-size: 28px;
    font-weight: 750;
    letter-spacing: -0.03em;

    margin-bottom: 12px;
}

.success-content p {
    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.7;

    margin-bottom: 30px;
}

.back-button {
    background: var(--surface-hover);

    border: 1px solid var(--border);

    color: var(--text-secondary);
}

.back-button:hover {
    background: #1c1c20;

    border-color: var(--border-hover);

    color: var(--text);
}

@keyframes success-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ─────────────────────────────
   MOBILE
───────────────────────────── */

@media (max-width: 600px) {
    .page {
        width: min(100% - 28px, 720px);
        padding-top: 18px;
    }

    .site-header {
        margin-bottom: 60px;
    }

    .hero h1 {
        font-size: 44px;
    }

    .hero-description {
        font-size: 16px;
    }

    .card {
        padding: 22px;
    }

    .card::before {
        left: 28px;
        right: 28px;
    }

    .test-fields {
        grid-template-columns: 1fr;
    }

    .success-card {
        padding: 38px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before {
        animation: none !important;
        transition: none !important;
    }
}