/* =========================================================
   XRayVless Registration
   Isolated visual layer. Registration logic lives in
   /js/register.js and is intentionally not duplicated here.
   ========================================================= */

:root {
    --bg: #0B0E17;
    --bg-soft: #10141f;
    --card: #141825;
    --card-light: #1C2033;

    --gold: #C9A84C;
    --gold-light: #DFC06A;
    --gold-dark: #9A7C35;

    --text: #F0EDE6;
    --muted: #9A96A6;
    --muted-dark: #6F6C79;

    --border: rgba(212, 168, 83, 0.14);
    --border-active: rgba(212, 168, 83, 0.58);

    --error: #FCA5A5;
    --error-bg: rgba(239, 68, 68, 0.08);
    --error-border: rgba(239, 68, 68, 0.20);

    --success: #34D399;

    --radius-card: 22px;
    --radius-input: 13px;

    --shadow:
        0 28px 80px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.01);

    --transition: 180ms ease;
}


* {
    box-sizing: border-box;
}


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


body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;

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

    color: var(--text);
    background:
        radial-gradient(
            circle at 50% -120px,
            rgba(201, 168, 76, 0.11),
            transparent 410px
        ),
        var(--bg);

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


button,
input {
    font: inherit;
}


button,
a {
    -webkit-tap-highlight-color: transparent;
}


a {
    color: inherit;
    text-decoration: none;
}


.auth-page {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    padding:
        max(28px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));

    display: flex;
    justify-content: center;
}


.auth-shell {
    width: 100%;
    max-width: 520px;
    margin: auto 0;
}


/* ---------------- Brand ---------------- */

.brand {
    margin: 0 0 25px;
}


.brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    width: fit-content;
    margin: 0 auto;
}


.brand-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(223, 192, 106, 0.32);
    border-radius: 13px;

    color: var(--gold-light);
    background:
        linear-gradient(
            145deg,
            rgba(223, 192, 106, 0.13),
            rgba(201, 168, 76, 0.025)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.18);

    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
}


.brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}


.brand-name {
    font-size: 19px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}


.brand-name span {
    color: var(--gold);
}


.brand-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
}


/* ---------------- Card ---------------- */

.auth-card {
    position: relative;

    padding: 31px;

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

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.018),
            rgba(255, 255, 255, 0)
        ),
        var(--card);

    box-shadow: var(--shadow);
}


.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(223, 192, 106, 0.52),
        transparent
    );
}


/* ---------------- Stepper ---------------- */

.stepper {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 11px;

    margin-bottom: 29px;
}


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

    color: var(--muted-dark);
}


.step.active {
    color: var(--text);
}


.step.complete {
    color: var(--gold-light);
}


.step-number {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(154, 150, 166, 0.22);
    border-radius: 50%;

    font-size: 11px;
    font-weight: 800;
}


.step.active .step-number {
    color: #0B0E17;
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
}


.step.complete .step-number {
    border-color: rgba(201, 168, 76, 0.42);
    background: rgba(201, 168, 76, 0.09);
}


.step-label {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}


.step-line {
    height: 1px;
    background: rgba(154, 150, 166, 0.18);
}


.step-line.complete {
    background: rgba(201, 168, 76, 0.38);
}


/* ---------------- Heading ---------------- */

.card-heading {
    margin-bottom: 24px;
}


.card-heading.centered {
    text-align: center;
}


.eyebrow {
    margin: 0 0 7px;

    color: var(--gold);
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}


.card-heading h1,
.success-card h1 {
    margin: 0;

    color: var(--text);
    font-size: clamp(25px, 7vw, 31px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.035em;
}


.card-description {
    margin: 10px 0 0;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}


.card-description strong {
    color: var(--text);
    font-weight: 700;
    overflow-wrap: anywhere;
}


/* ---------------- Form ---------------- */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


.name-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}


.field {
    min-width: 0;
}


.field label {
    display: block;
    margin: 0 0 7px;

    color: #C7C3CB;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 650;
}


.field .center-label {
    text-align: center;
}


.field input,
.captcha-input {
    width: 100%;
    min-height: 49px;

    padding: 0 14px;

    border: 1px solid rgba(154, 150, 166, 0.18);
    border-radius: var(--radius-input);
    outline: none;

    color: var(--text);
    background: var(--bg);

    font-size: 16px;

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}


.field input::placeholder,
.captcha-input::placeholder {
    color: #676572;
    opacity: 1;
}


.field input:hover,
.captcha-input:hover {
    border-color: rgba(201, 168, 76, 0.28);
}


.field input:focus,
.captcha-input:focus {
    border-color: var(--border-active);

    box-shadow:
        0 0 0 3px rgba(201, 168, 76, 0.075);
}


.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
    transition: background-color 9999s ease-out 0s;
}


.field-hint {
    display: block;
    margin-top: 6px;

    color: var(--muted-dark);
    font-size: 10px;
    line-height: 1.3;
}


input[type="date"] {
    color: var(--text);
}


input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.7;
    cursor: pointer;
}


/* ---------------- CAPTCHA ---------------- */

.captcha-box {
    padding: 15px;

    border: 1px solid rgba(201, 168, 76, 0.14);
    border-radius: 15px;

    background: rgba(11, 14, 23, 0.58);
}


.captcha-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}


.captcha-label {
    display: block;
    margin-bottom: 3px;

    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


.captcha-top p {
    margin: 0;

    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}


.captcha-refresh {
    min-height: 32px;
    padding: 0 9px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    border: 1px solid rgba(154, 150, 166, 0.15);
    border-radius: 9px;

    color: var(--muted);
    background: transparent;

    font-size: 10px;
    font-weight: 650;

    cursor: pointer;
    transition: var(--transition);
}


.captcha-refresh:hover {
    color: var(--gold-light);
    border-color: rgba(201, 168, 76, 0.35);
    background: rgba(201, 168, 76, 0.04);
}


.captcha-challenge {
    margin: 14px 0 11px;
    min-height: 27px;

    color: var(--text);
    font-size: 18px;
    line-height: 1.35;
    font-weight: 750;
}


.captcha-input {
    min-height: 46px;

    text-align: center;
    font-weight: 700;
    letter-spacing: 0.09em;
}


/* ---------------- Error ---------------- */

.form-error {
    margin: 0;
    padding: 11px 12px;

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

    color: var(--error);
    background: var(--error-bg);

    font-size: 11px;
    line-height: 1.45;
}


/* ---------------- Primary button ---------------- */

.primary-button {
    width: 100%;
    min-height: 51px;

    padding: 0 17px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border: 0;
    border-radius: 13px;

    color: #0B0E17;
    background: linear-gradient(
        135deg,
        var(--gold-light) 0%,
        #C9A84C 48%,
        #B8943F 100%
    );

    box-shadow:
        0 8px 24px rgba(201, 168, 76, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);

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

    cursor: pointer;

    transition:
        transform var(--transition),
        filter var(--transition),
        box-shadow var(--transition);
}


.primary-button:hover {
    filter: brightness(1.055);
    transform: translateY(-1px);

    box-shadow:
        0 11px 28px rgba(201, 168, 76, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.30);
}


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


.primary-button:focus-visible {
    outline: 3px solid rgba(223, 192, 106, 0.25);
    outline-offset: 3px;
}


.button-arrow {
    font-size: 17px;
    line-height: 1;
}


/* ---------------- Login ---------------- */

.login-link {
    margin-top: 21px;

    color: var(--muted);
    text-align: center;

    font-size: 11px;
}


.login-link a {
    margin-left: 4px;
    color: var(--gold-light);
    font-weight: 750;
}


.login-link a:hover {
    text-decoration: underline;
}


/* ---------------- Verification ---------------- */

.verification-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 17px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 17px;

    color: var(--gold-light);
    background: rgba(201, 168, 76, 0.07);

    font-size: 23px;
}


.verification-code {
    min-height: 57px !important;

    text-align: center;
    font-size: 23px !important;
    font-weight: 800;
    letter-spacing: 0.32em;

    padding-left: calc(14px + 0.32em) !important;
}


.verification-note {
    margin: 17px 0 0;

    color: var(--muted-dark);
    text-align: center;

    font-size: 10px;
    line-height: 1.4;
}


/* ---------------- Success ---------------- */

.success-card {
    padding-top: 39px;
    padding-bottom: 39px;
    text-align: center;
}


.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(52, 211, 153, 0.26);
    border-radius: 50%;

    color: var(--success);
    background: rgba(52, 211, 153, 0.07);

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

    box-shadow: 0 0 35px rgba(52, 211, 153, 0.05);
}


.success-description {
    margin: 13px auto 25px;
    max-width: 390px;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}


.success-button {
    max-width: 330px;
    margin: 0 auto;
}


.app-waiting {
    max-width: 390px;
    margin: 24px auto 0;
    padding: 14px 15px;

    display: flex;
    align-items: center;
    gap: 12px;

    border: 1px solid rgba(154, 150, 166, 0.15);
    border-radius: 13px;

    text-align: left;
    background: var(--bg);
}


.app-waiting strong,
.app-waiting span:not(.pulse-dot) {
    display: block;
}


.app-waiting strong {
    margin-bottom: 3px;

    color: var(--text);
    font-size: 11px;
}


.app-waiting span:not(.pulse-dot) {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}


.pulse-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;

    border-radius: 50%;
    background: var(--success);

    box-shadow: 0 0 0 rgba(52, 211, 153, 0.35);

    animation: pulse 1.8s infinite;
}


@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.35);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}


/* ---------------- Footer ---------------- */

.auth-footer {
    padding: 20px 8px 0;

    color: var(--muted-dark);
    text-align: center;

    font-size: 9px;
}


.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;

    margin-bottom: 7px;
}


.auth-footer a:hover {
    color: var(--gold-light);
}


.auth-footer p {
    margin: 0;
}


/* ---------------- Utility ---------------- */

.hidden {
    display: none !important;
}


.honeypot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;

    width: 1px !important;
    height: 1px !important;

    opacity: 0 !important;
    overflow: hidden !important;

    pointer-events: none !important;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 560px) {

    body {
        background:
            radial-gradient(
                circle at 50% -90px,
                rgba(201, 168, 76, 0.085),
                transparent 310px
            ),
            var(--bg);
    }


    .auth-page {
        padding-top: max(19px, env(safe-area-inset-top));
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }


    .auth-shell {
        margin: 0;
    }


    .brand {
        margin-bottom: 18px;
    }


    .brand-mark {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
        border-radius: 11px;
    }


    .brand-name {
        font-size: 17px;
    }


    .brand-subtitle {
        font-size: 9px;
    }


    .auth-card {
        padding: 22px 18px;
        border-radius: 18px;
    }


    .auth-card::before {
        left: 20px;
        right: 20px;
    }


    .stepper {
        margin-bottom: 23px;
        gap: 7px;
    }


    .step-label {
        font-size: 9px;
    }


    .step-number {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        font-size: 9px;
    }


    .card-heading {
        margin-bottom: 20px;
    }


    .card-description {
        font-size: 12px;
    }


    .name-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }


    .field input,
    .captcha-input {
        min-height: 50px;
    }


    .captcha-box {
        padding: 14px;
    }


    .captcha-refresh {
        min-height: 34px;
    }


    .primary-button {
        min-height: 52px;
    }


    .success-card {
        padding-top: 31px;
        padding-bottom: 31px;
    }


    .footer-links {
        line-height: 1.6;
    }
}


/* Very narrow devices */

@media (max-width: 370px) {

    .auth-page {
        padding-left: 9px;
        padding-right: 9px;
    }


    .auth-card {
        padding-left: 15px;
        padding-right: 15px;
    }


    .brand-subtitle {
        display: none;
    }


    .step-label {
        font-size: 8px;
    }


    .captcha-refresh span:last-child {
        display: none;
    }
}


/* Short desktop/mobile landscape */

@media (min-width: 561px) and (max-height: 850px) {

    .auth-shell {
        margin: 0;
    }
}


/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
