:root {
    --nex-navy: #020914;
    --nex-blue: #07182f;
    --nex-gold: #d9a12d;
    --nex-gold-light: #ffe386;
    --nex-muted: #9ba3b6;
    --nex-border: rgba(219, 164, 55, .5);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--nex-navy);
    color: #fff;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

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

.nex-page {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
    gap: clamp(24px, 4vw, 72px);
    min-height: 100svh;
    padding: clamp(22px, 4.1vh, 52px) clamp(30px, 5vw, 96px);
    background:
        linear-gradient(90deg, rgba(3, 10, 20, .03) 0%, rgba(3, 10, 20, .28) 43%, rgba(2, 6, 14, .74) 100%),
        url("../images/cover.png") left center / cover no-repeat;
}

.nex-page::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 215, 119, .58), transparent 1px, transparent calc(100% - 1px), rgba(255, 196, 69, .42)),
        radial-gradient(circle at 41% 0%, rgba(255, 210, 107, .55), transparent 9%),
        radial-gradient(circle at 31% 53%, rgba(255, 206, 90, .16), transparent 18%);
}

.nex-hero,
.nex-auth-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
}

.nex-hero {
    justify-content: center;
}

.nex-hero-inner {
    width: min(100%, 780px);
    text-align: center;
}

.nex-main-logo {
    display: block;
    width: min(40vh, 380px);
    max-width: 68%;
    margin: 0 auto clamp(6px, 1.4vh, 16px);
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .55)) drop-shadow(0 0 18px rgba(222, 158, 36, .18));
}

.nex-kicker {
    width: min(100%, 740px);
    margin: 0 auto;
    color: #fff;
    font-size: clamp(18px, 2.15vh, 26px);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: .08em;
    text-shadow: 0 3px 16px rgba(0, 0, 0, .58);
}

.nex-separator {
    display: block;
    width: 190px;
    height: 1px;
    margin: clamp(10px, 1.8vh, 16px) auto;
    background: linear-gradient(90deg, transparent, var(--nex-gold-light), transparent);
    box-shadow: 0 0 16px rgba(255, 218, 115, .85);
}

.nex-copy {
    width: min(100%, 560px);
    margin: 0 auto;
    color: rgba(255, 255, 255, .92);
    font-size: clamp(15px, 1.82vh, 20px);
    line-height: 1.38;
    letter-spacing: .035em;
}

.nex-pillars {
    display: grid;
    grid-template-columns: repeat(7, minmax(70px, 1fr));
    gap: clamp(10px, 1.25vw, 18px);
    margin: clamp(22px, 4vh, 38px) auto clamp(22px, 4vh, 40px);
}

.nex-pillar {
    display: flex;
    min-height: clamp(88px, 11vh, 112px);
    padding: 11px 7px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    border: 1px solid var(--nex-border);
    border-radius: 8px;
    background: rgba(5, 16, 32, .62);
    box-shadow: inset 0 0 20px rgba(255, 210, 99, .04), 0 14px 30px rgba(0, 0, 0, .28);
    color: #fff;
}

.nex-pillar i {
    color: var(--nex-gold-light);
    font-size: clamp(25px, 3.3vh, 36px);
    text-shadow: 0 0 16px rgba(255, 195, 64, .62);
}

.nex-pillar span {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(11px, 1.28vh, 13px);
    line-height: 1.15;
}

.nex-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.nex-btn,
.nex-submit,
.nex-new-card button {
    border: 0;
    cursor: pointer;
    text-decoration: none;
}

.nex-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(100%, 360px);
    min-height: clamp(52px, 6.4vh, 62px);
    padding: 0 36px;
    border-radius: 8px;
    border: 1px solid var(--nex-border);
    color: var(--nex-gold-light);
    font-weight: 600;
    letter-spacing: .23em;
    text-transform: uppercase;
    gap: 20px;
}

.nex-btn-primary,
.nex-submit {
    color: #120c02;
    background: linear-gradient(180deg, #ffdf78 0%, #daa333 48%, #be841a 100%);
    box-shadow: 0 14px 32px rgba(219, 151, 29, .32), inset 0 1px 0 rgba(255, 255, 255, .62);
}

.nex-btn-ghost {
    min-width: 250px;
    background: rgba(4, 13, 27, .56);
}

.nex-auth-wrap {
    justify-content: center;
}

.nex-auth-card {
    width: min(100%, 640px);
    max-height: calc(100svh - clamp(44px, 8.2vh, 104px));
    border: 1px solid var(--nex-border);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(12, 31, 60, .86), rgba(4, 13, 29, .82)),
        rgba(3, 13, 29, .76);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .48), inset 0 0 48px rgba(33, 89, 164, .12);
    overflow: hidden;
}

.nex-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: clamp(74px, 9.2vh, 90px);
    align-items: center;
    padding: 0 clamp(28px, 4vw, 54px);
}

.nex-tabs::after {
    content: "";
    position: absolute;
    left: clamp(42px, 7vw, 92px);
    right: clamp(42px, 7vw, 92px);
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 223, 129, .9), transparent);
    box-shadow: 0 0 18px rgba(255, 211, 92, .85);
}

.nex-tab {
    height: 100%;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .46);
    cursor: pointer;
    font-size: clamp(18px, 2.5vh, 23px);
    font-weight: 600;
    letter-spacing: .12em;
}

.nex-tab.is-active {
    color: var(--nex-gold-light);
}

.nex-card-body {
    position: relative;
    max-height: calc(100svh - clamp(118px, 17.4vh, 194px));
    overflow-y: auto;
    padding: clamp(18px, 2.5vh, 28px) clamp(28px, 4vw, 54px) clamp(18px, 2.7vh, 28px);
    scrollbar-width: thin;
    scrollbar-color: rgba(224, 165, 45, .7) rgba(255, 255, 255, .06);
}

.nex-card-body::-webkit-scrollbar {
    width: 8px;
}

.nex-card-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .06);
}

.nex-card-body::-webkit-scrollbar-thumb {
    background: rgba(224, 165, 45, .72);
    border-radius: 999px;
}

.nex-mini-brand {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 26px;
    align-items: center;
    margin-bottom: clamp(12px, 1.8vh, 18px);
}

.nex-mini-brand span {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 207, 77, .74));
}

.nex-mini-brand span:last-child {
    background: linear-gradient(90deg, rgba(255, 207, 77, .74), transparent);
}

.nex-mini-brand img {
    width: clamp(70px, 9.5vh, 92px);
    aspect-ratio: 1;
    object-fit: contain;
    object-position: top;
    filter: drop-shadow(0 0 14px rgba(255, 190, 49, .36));
}

.nex-form {
    display: none;
}

.nex-form.is-active {
    display: block;
}

.nex-form label {
    display: block;
    margin-bottom: clamp(12px, 1.65vh, 16px);
}

.nex-form label > span,
.nex-check span {
    display: block;
    color: var(--nex-gold-light);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .28em;
    text-transform: uppercase;
}

.nex-field {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    height: clamp(52px, 6.1vh, 58px);
    margin-top: 9px;
    padding: 0 18px 0 22px;
    border: 1px solid rgba(207, 153, 48, .42);
    border-radius: 11px;
    background: rgba(3, 10, 22, .55);
    box-shadow: inset 0 0 18px rgba(12, 36, 78, .24);
}

.nex-field:focus-within {
    border-color: rgba(255, 218, 107, .78);
    box-shadow: 0 0 0 3px rgba(219, 161, 45, .12), inset 0 0 18px rgba(12, 36, 78, .24);
}

.nex-field input,
.nex-field select {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: clamp(16px, 1.95vh, 18px);
}

.nex-field select option {
    color: #091121;
}

.nex-field input::placeholder {
    color: rgba(213, 218, 232, .55);
}

.nex-field input:-webkit-autofill,
.nex-field input:-webkit-autofill:hover,
.nex-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    transition: background-color 999999s ease-in-out 0s;
    box-shadow: 0 0 0 1000px rgba(3, 10, 22, .55) inset;
}

.nex-field > i,
.nex-field-btn {
    color: rgba(229, 235, 252, .58);
}

.nex-field-btn {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 17px;
}

.nex-phone-code {
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    letter-spacing: .08em;
}

.nex-phone-code img {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(255, 211, 92, .2);
}

.nex-reset-intro {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, .76);
    line-height: 1.45;
    text-align: center;
}

.nex-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.nex-check {
    display: flex !important;
    gap: 12px;
    align-items: flex-start;
    color: rgba(255, 255, 255, .78);
}

.nex-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--nex-gold);
}

.nex-check span {
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    letter-spacing: .04em;
    line-height: 1.35;
    text-transform: none;
}

.nex-legal-link {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--nex-gold-light);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nex-submit {
    width: 100%;
    min-height: clamp(52px, 6.1vh, 58px);
    border-radius: 11px;
    font-weight: 800;
    letter-spacing: .28em;
    text-transform: uppercase;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: clamp(16px, 2.1vh, 19px);
}

.nex-submit[disabled] {
    cursor: wait;
    filter: grayscale(.18) brightness(.9);
}

.nex-link-btn,
.nex-auth-switch button {
    border: 0;
    background: transparent;
    color: var(--nex-gold-light);
    cursor: pointer;
    font-weight: 700;
}

.nex-link-btn {
    display: block;
    margin: clamp(14px, 2.2vh, 20px) auto 0;
    font-size: 16px;
}

.nex-auth-switch {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: clamp(18px, 3vh, 26px) 0 clamp(15px, 2.4vh, 22px);
    padding-top: clamp(16px, 2.5vh, 22px);
    color: rgba(232, 235, 244, .58);
}

.nex-auth-switch::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 207, 77, .65), transparent);
}

.nex-auth-switch::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    width: 7px;
    height: 7px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: var(--nex-gold-light);
    box-shadow: 0 0 11px rgba(255, 218, 113, .95);
}

.nex-new-card {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(207, 153, 48, .38);
    border-radius: 12px;
    background: rgba(3, 12, 27, .46);
}

.nex-new-preview {
    height: 64px;
    overflow: hidden;
    border-radius: 7px;
    border: 1px solid rgba(222, 168, 58, .24);
}

.nex-new-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

.nex-new-card strong {
    display: block;
    color: var(--nex-gold-light);
    margin-bottom: 8px;
}

.nex-new-card p {
    margin: 0;
    color: rgba(229, 233, 246, .62);
    line-height: 1.45;
    font-size: 15px;
}

.nex-new-card button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid rgba(207, 153, 48, .46);
    border-radius: 999px;
    background: rgba(3, 12, 27, .38);
    color: var(--nex-gold-light);
    white-space: nowrap;
}

body.nex-register-open .nex-new-card {
    display: none;
}

body.nex-reset-open .nex-new-card,
body.nex-reset-open .nex-auth-switch {
    display: none;
}

.nex-swal-popup {
    border: 1px solid rgba(219, 164, 55, .52);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .48);
}

.nex-swal-field {
    width: 100%;
    height: 48px;
    margin: 14px 0 0;
    border: 1px solid rgba(207, 153, 48, .5);
    border-radius: 10px;
    background: rgba(3, 10, 22, .55);
    color: #fff;
    padding: 0 14px;
    outline: 0;
}

.nex-swal-field::placeholder {
    color: rgba(229, 235, 252, .58);
}

.nex-code-countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    min-height: 32px;
    margin-top: 12px;
    border-radius: 999px;
    color: #120c02;
    background: linear-gradient(180deg, #ffdf78 0%, #daa333 100%);
    font-weight: 800;
}

.nex-legal-modal {
    width: min(92vw, 860px);
    max-height: 78vh;
    overflow: auto;
    padding: 30px;
    border-radius: 16px;
    background: #07182f;
    color: #fff;
    line-height: 1.6;
}

.nex-legal-modal h2,
.nex-legal-modal h3 {
    color: var(--nex-gold-light);
}

.nex-legal-modal h2 {
    margin: 0 0 22px;
    text-align: center;
}

.nex-legal-modal section + section {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(217, 161, 45, .34);
}

.nex-legal-fancybox .fancybox__slide {
    padding: 24px;
}

@media (max-width: 1180px) {
    .nex-page {
        grid-template-columns: .92fr minmax(390px, .8fr);
        gap: 26px;
        padding: 24px;
    }

    .nex-pillars {
        grid-template-columns: repeat(4, minmax(76px, 1fr));
    }

    .nex-pillar:nth-child(n+5) {
        display: none;
    }

    .nex-actions {
        gap: 14px;
    }

    .nex-btn {
        min-width: 0;
        flex: 1;
        padding: 0 18px;
        letter-spacing: .14em;
    }
}

@media (max-width: 900px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .nex-page {
        display: block;
        min-height: 100svh;
        padding: 16px 14px 24px;
        background-position: 18% center;
    }

    .nex-page::before {
        position: fixed;
    }

    .nex-hero {
        display: block;
        align-items: flex-start;
    }

    .nex-hero-inner {
        width: 100%;
        padding-bottom: 18px;
    }

    .nex-main-logo {
        width: clamp(126px, 20svh, 190px);
        max-width: 52%;
        margin-bottom: 4px;
    }

    .nex-kicker {
        font-size: clamp(15px, 2.1svh, 19px);
    }

    .nex-copy {
        display: block;
        width: min(100%, 620px);
        font-size: 14px;
        line-height: 1.45;
    }

    .nex-pillars {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 16px auto 18px;
        width: min(100%, 520px);
    }

    .nex-pillar {
        display: grid;
        grid-template-columns: 46px 1fr;
        grid-template-areas: "icon title";
        min-height: 58px;
        gap: 0 12px;
        padding: 12px 14px;
        text-align: left;
    }

    .nex-pillar:nth-child(n+5) {
        display: grid;
    }

    .nex-pillar i {
        grid-area: icon;
        align-self: center;
        justify-self: center;
        font-size: 27px;
    }

    .nex-pillar span {
        grid-area: title;
        font-size: 15px;
        font-weight: 800;
    }

    .nex-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: min(100%, 520px);
        margin: 0 auto 20px;
    }

    .nex-auth-wrap {
        display: block;
        align-items: stretch;
    }

    .nex-auth-card {
        width: 100%;
        max-height: none;
        border-radius: 18px;
        overflow: visible;
    }

    .nex-card-body {
        max-height: none;
        overflow: visible;
        padding: 18px;
    }

    .nex-tabs {
        height: 62px;
        padding: 0 22px;
    }

    .nex-tab {
        font-size: 16px;
    }

    .nex-mini-brand {
        margin-bottom: 14px;
    }

    .nex-mini-brand img {
        width: 70px;
    }

    .nex-new-card {
        grid-template-columns: 72px 1fr;
    }

    .nex-new-card button {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .nex-page {
        padding: 10px;
    }

    .nex-main-logo {
        width: 116px;
        max-width: 48%;
    }

    .nex-kicker {
        letter-spacing: .04em;
        line-height: 1.22;
    }

    .nex-separator {
        margin: 6px auto;
    }

    .nex-pillars {
        grid-template-columns: 1fr;
    }

    .nex-pillar:nth-child(n+3) {
        display: grid;
    }

    .nex-card-body {
        max-height: none;
        padding: 15px;
    }

    .nex-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .nex-form label > span,
    .nex-check span {
        letter-spacing: .16em;
    }

    .nex-field {
        height: 52px;
        border-radius: 9px;
    }

    .nex-new-card {
        display: none;
    }
}

@media (max-height: 760px) and (min-width: 901px) {
    .nex-copy {
        display: none;
    }

    .nex-pillars {
        margin: 18px 0 20px;
    }

    .nex-pillar {
        min-height: 78px;
    }
}

@media (max-height: 660px) and (min-width: 901px) {
    .nex-main-logo {
        width: min(30vh, 280px);
    }

    .nex-pillars {
        display: none;
    }
}
