/* ==========================================================================
   Paynex — auth
   Contained split card, centred on the page
   ========================================================================== */
body.auth-body { background: var(--bg); }

.auth {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 30px;
}

.shell {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 0.84fr 1fr;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(65, 30, 110, .12);
}

/* ==========================================================================
   LEFT — brand panel
   ========================================================================== */
.side {
    position: relative;
    overflow: hidden;
    padding: 40px 34px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(155deg, #301650 0%, #5b21b6 55%, #8b5cf6 100%);
}

.side::after {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    right: -180px;
    top: -140px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .07);
}

.side > * { position: relative; z-index: 2; }

.side__brand { margin-bottom: 30px; }

.side__title {
    margin: 0;
    font-size: 25px;
    line-height: 1.32;
    font-weight: 700;
    letter-spacing: -.5px;
}

.side__title em { font-style: normal; color: #c4b5fd; }

.side__text {
    margin: 13px 0 26px;
    font-size: 12.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .6);
}

/* check points */
.point {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .85);
}

.point i {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: rgba(124, 58, 237, .2);
    color: #c4b5fd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.point i :is(svg, .ui-image) { width: 10px; height: 10px; }

/* stat band */
.side__stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .13);
}

.side__stats div b {
    display: block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.side__stats div span {
    font-size: 10.5px;
    line-height: 1.35;
    color: rgba(255, 255, 255, .5);
    display: block;
    margin-top: 2px;
}

/* ==========================================================================
   RIGHT — form column
   ========================================================================== */
.formcol {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 44px 28px;
}

.auth__inner { width: 100%; max-width: 380px; margin: 0 auto; }

.auth__title {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--heading);
}

.auth__sub {
    margin: 5px 0 16px;
    font-size: 12.5px;
    color: var(--muted);
}

/* segmented control */
.seg {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border-radius: 11px;
    background: var(--field);
    margin-bottom: 16px;
}

.seg__thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 1px 4px rgba(2, 10, 22, .4);
    transition: transform .24s cubic-bezier(.4, 0, .2, 1);
}

.seg[data-active="register"] .seg__thumb { transform: translateX(100%); }

.seg__btn {
    position: relative;
    z-index: 2;
    padding: 8px 0 9px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 8px;
    transition: color .2s ease;
}

.seg__btn.is-active { color: var(--primary); }

/* fields */
.fld { margin-bottom: 11px; }

.fld__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
}

.fld__hint { font-size: 11px; font-weight: 600; color: var(--primary); }
.fld__hint:hover { text-decoration: underline; }

.fld__box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 6px 0 13px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.fld__box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .18);
}

.fld__prefix {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted-2);
    padding-right: 10px;
    border-right: 1px solid var(--line);
    white-space: nowrap;
}

.fld__box input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--ink);
}

.fld__box input::placeholder,
.fld__box textarea::placeholder { color: var(--muted-2); }

/* role dropdown */
.fld__box--select { position: relative; padding-right: 12px; }

.fld__box--select select {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.fld__box--select :is(svg, .ui-image) {
    width: 15px;
    height: 15px;
    color: var(--muted-2);
    flex: 0 0 auto;
    pointer-events: none;
}

/* address */
.fld__box--area { height: auto; align-items: flex-start; padding: 10px 13px; }

.fld__box--area textarea {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    resize: vertical;
    min-height: 40px;
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink);
}

/* username availability hint */
.fld__hint--ok { color: #15803d !important; }
.fld__hint--bad { color: var(--danger) !important; }

.fld__box--bad,
.fld__box--bad:focus-within {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}

.fld__otp {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 11px;
    margin-right: 2px;
    border-radius: 7px;
    background: rgba(124, 58, 237, .14);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.fld__otp:hover { background: rgba(124, 58, 237, .22); }
.fld__otp:disabled { cursor: default; opacity: .8; }
.fld__otp.is-ok { background: var(--primary); color: #ffffff; }

/* ---- toast (social-login placeholder, etc.) ---- */
.auth-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 200;
    max-width: min(92vw, 360px);
    padding: 12px 18px;
    border-radius: 11px;
    background: var(--field);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 12px 32px rgba(65, 30, 110, .12);
    transform: translate(-50%, 12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
}

.auth-toast.is-on { transform: translate(-50%, 0); opacity: 1; }

.fld__eye {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-right: 2px;
    border-radius: 7px;
    color: var(--muted-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fld__eye :is(svg, .ui-image) { width: 17px; height: 17px; }
.fld__eye:hover { color: var(--primary); background: rgba(255, 255, 255, .06); }

.fld-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 11px; }

/* options + submit */
.opts {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 14px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1.45;
}

.check input {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--line);
    border-radius: 4px;
    flex: 0 0 auto;
    position: relative;
    margin: 0;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.check input:checked { background: var(--primary); border-color: var(--primary); }

.check input:checked::after {
    content: '';
    position: absolute;
    left: 4.6px;
    top: 1.4px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(43deg);
}

.check a { color: var(--primary); font-weight: 600; }
.opts__link { font-size: 11.5px; font-weight: 600; color: var(--primary); }
.opts__link:hover { text-decoration: underline; }

.submit {
    width: 100%;
    height: 44px;
    border-radius: 11px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    transition: background .18s ease, transform .12s ease;
}

.submit:hover { background: var(--primary-dark); }
.submit:active { transform: translateY(1px); }

/* socials */
.or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0 11px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.socials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.socials a {
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    transition: border-color .16s ease, background .16s ease;
}

.socials a:hover { border-color: var(--line); background: rgba(255, 255, 255, .05); }
.socials :is(svg, .ui-image) { width: 17px; height: 17px; }

.auth__copy {
    margin-top: 15px;
    text-align: center;
    font-size: 11px;
    color: var(--muted-2);
}

.backhome {
    position: absolute;
    top: 22px;
    left: 26px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.backhome:hover { border-color: rgba(124, 58, 237, .45); color: var(--primary); }
.backhome :is(svg, .ui-image) { width: 14px; height: 14px; transform: rotate(180deg); }

.lang {
    position: absolute;
    top: 22px;
    right: 26px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.lang:hover { border-color: rgba(124, 58, 237, .45); color: var(--primary); }
.lang .icon { width: 15px; height: 15px; }
.lang .icon:last-child { width: 13px; height: 13px; opacity: .7; }

/* alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 16px;
}

.alert :is(svg, .ui-image) { width: 16px; height: 16px; flex: 0 0 auto; }
.alert--success { background: rgba(124, 58, 237, .14); color: #15803d; border: 1px solid rgba(124, 58, 237, .35); }
.alert--error { background: rgba(248, 113, 113, .14); color: #b91c1c; border: 1px solid rgba(248, 113, 113, .32); }

/* ==========================================================================
   responsive
   ========================================================================== */
@media (max-width: 940px) {
    .shell { grid-template-columns: 1fr; max-width: 440px; }
    .side { padding: 30px 28px 26px; }
    .side__brand { margin-bottom: 20px; }
    .side__title { font-size: 21px; }
    .side__text { margin-bottom: 18px; }
    .point:nth-child(n+3) { display: none; }
    .side__stats { gap: 18px; padding-top: 18px; }
    .formcol { padding: 30px 26px 28px; }
}

@media (max-width: 520px) {
    .auth { padding: 66px 14px 24px; }
    .formcol { padding: 26px 18px 24px; }
    .fld-row { grid-template-columns: 1fr; gap: 0; }
    .socials a span { display: none; }
    .lang { top: 16px; right: 14px; }
    .backhome { top: 16px; left: 14px; }
}

/* ==========================================================================
   Desktop: the page itself never scrolls — the card is pinned to the viewport
   and only the form column scrolls inside it.
   Kept last in the file: these override base rules of the same specificity.
   ========================================================================== */
@media (min-width: 941px) {
    html, body.auth-body { height: 100%; overflow: hidden; }

    .auth {
        height: 100vh;
        height: 100dvh;   /* keeps mobile browser chrome out of the maths */
        padding: 22px 24px;
        overflow: hidden;
    }

    /*
     * minmax(0, 1fr) on the row is the important bit: an implicit `auto` row is
     * sized to its content, so the columns would stay full height and simply get
     * clipped by the card instead of scrolling.
     */
    .shell { max-height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); }

    /* both columns are their own scroll area, so neither can push the card taller */
    .side, .formcol { min-height: 0; overflow-y: auto; }

    /*
     * Centring must NOT happen on the scroll container: a centred flex container
     * pushes overflowing content above its scroll origin, where it can never be
     * scrolled back into view. So the column is a plain block that scrolls, and
     * the inner box does the centring — it stretches to full height when the
     * form is short, and just grows (no free space to centre, hence no clipping)
     * when the form is tall.
     */
    .formcol { display: block; }

    .formcol .auth__inner {
        min-height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .side { scrollbar-width: none; }
    .side::-webkit-scrollbar { width: 0; }

    .formcol { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
    .formcol::-webkit-scrollbar { width: 7px; }
    .formcol::-webkit-scrollbar-track { background: transparent; }
    .formcol::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
    .formcol::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, .45); }
}

/* ==========================================================================
   Password requirement checklist + inline field notes
   ========================================================================== */
.pwhint {
    margin: -2px 0 12px;
    padding: 10px 12px;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.pwhint__eg { font-size: 11px; color: var(--muted); }
.pwhint__eg b { color: var(--primary-deep); font-weight: 700; letter-spacing: .3px; }

.pwhint__list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 7px 0 0;
    padding: 0;
    list-style: none;
}

.pwhint__list li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: var(--muted-2);
    transition: color .15s ease;
}

.pwhint__list :is(svg, .ui-image) {
    width: 11px;
    height: 11px;
    color: var(--line);
    transition: color .15s ease;
}

.pwhint__list li.is-ok { color: #15803d; }
.pwhint__list li.is-ok :is(svg, .ui-image) { color: #15803d; }

.fld__note {
    margin: 5px 0 0;
    font-size: 10.5px;
    line-height: 1.45;
    color: var(--danger);
}
