/* MAXW1N — premium auth modals */

.maxwin-popup.mw-auth-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(5, 7, 13, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10050;
}

.maxwin-popup.mw-auth-modal .popup-inner.mw-auth-shell {
    position: relative;
    width: calc(100vw - 32px);
    max-width: 920px;
    height: auto;
    max-height: calc(100vh - 36px);
    margin: 0;
    padding: 0;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(8, 11, 18, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.maxwin-popup.mw-auth-modal .popup-inner.mw-auth-shell--register {
    max-width: 960px;
}

.maxwin-popup.mw-auth-modal .register-form,
.maxwin-popup.mw-auth-modal .login-form,
.maxwin-popup.mw-auth-modal .restore-form {
    max-height: none;
    overflow: visible;
}

.maxwin-popup.mw-auth-modal .row {
    display: contents;
}

.maxwin-popup.mw-auth-modal .bg-popup {
    display: none !important;
}

/* Close */
.mw-auth-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.68);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.mw-auth-close i {
    font-size: 22px;
    line-height: 1;
}

.mw-auth-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Layout */
.mw-auth-layout {
    display: grid;
    grid-template-columns: 42% 58%;
    min-height: 0;
    max-height: calc(100vh - 36px);
}

.mw-auth-layout--register {
    grid-template-columns: 40% 60%;
}

/* Visual panel */
.mw-auth-visual {
    padding: 28px 30px;
    background:
        radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.18), transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.2), transparent 36%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(22, 18, 48, 0.96));
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    position: relative;
}

.mw-auth-visual::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.1), transparent 70%);
    pointer-events: none;
}

.mw-auth-visual__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mw-auth-visual__logo {
    width: auto;
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.mw-auth-visual__title {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #fff;
}

.mw-auth-visual__subtitle {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.68);
    max-width: 300px;
}

.mw-auth-visual__benefits {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mw-auth-visual__benefits li {
    position: relative;
    padding-left: 20px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
}

.mw-auth-visual__benefits li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22d3ee, #6366f1);
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}

.mw-auth-visual__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
    padding-top: 12px;
}

.mw-auth-visual__chip {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.82);
}

/* Form panel */
.mw-auth-panel {
    min-width: 0;
    min-height: 0;
    max-height: calc(100vh - 36px);
    background: rgba(8, 11, 18, 0.98);
}

.mw-auth-panel.login-section {
    padding: 0 !important;
    background: transparent !important;
}

.mw-auth-panel__scroll {
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 36px 40px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.mw-auth-shell--register .mw-auth-panel__scroll {
    padding: 28px 34px 32px;
}

.mw-auth-panel__scroll::-webkit-scrollbar {
    width: 5px;
}

.mw-auth-panel__scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 99px;
}

.mw-auth-heading {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.mw-auth-heading--compact {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.mw-auth-subheading {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.68);
}

.mw-auth-subheading--compact {
    margin-bottom: 16px;
    font-size: 13px;
}

.mw-auth-guard-context {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(34, 211, 238, 0.25);
    background: rgba(34, 211, 238, 0.08);
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.82);
}

.mw-auth-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(127, 29, 29, 0.25);
    font-size: 12px;
    line-height: 1.45;
    color: #fecaca;
}

.mw-auth-field {
    margin-bottom: 14px;
}

.mw-auth-label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
}

/* Inputs */
.mw-auth-input,
.mw-auth-select {
    height: 46px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.mw-auth-input--reg,
.mw-auth-select--reg {
    height: 44px;
    font-size: 13px;
}

.mw-auth-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.mw-auth-input:focus,
.mw-auth-select:focus {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.mw-auth-input.is-error,
.mw-auth-select.is-error {
    border-color: rgba(239, 68, 68, 0.65);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password field + toggle */
.mw-password-field {
    position: relative;
}

.mw-password-field .mw-auth-input {
    width: 100%;
    padding-right: 44px;
}

.mw-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: none;
    font-size: 14px;
    line-height: 1;
}

.mw-password-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.mw-auth-forgot {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.mw-auth-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.48);
    max-width: 100%;
}

.mw-auth-link {
    font-size: 12px;
    font-weight: 600;
    color: #22d3ee;
    text-decoration: none;
}

.mw-auth-link:hover {
    text-decoration: underline;
}

/* Register grid */
.mw-register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mw-register-grid .mw-auth-field {
    margin-bottom: 0;
}

.mw-register-grid .mw-full {
    grid-column: 1 / -1;
}

/* Captcha */
.mw-auth-captcha {
    display: flex;
    justify-content: flex-start;
    margin: 4px 0 2px;
    overflow: hidden;
}

/* Checkbox */
.mw-auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.68);
    cursor: pointer;
    user-select: none;
}

.mw-auth-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.mw-checkbox-box {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.04);
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}

.mw-auth-checkbox input:checked + .mw-checkbox-box {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-color: transparent;
}

.mw-auth-checkbox input:checked + .mw-checkbox-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mw-checkbox-text a {
    color: #22d3ee;
    text-decoration: none;
}

.mw-checkbox-text a:hover {
    text-decoration: underline;
}

/* Submit */
.mw-auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    margin-top: 20px;
    padding: 0 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 45%, #8b5cf6 100%);
    color: #fff !important;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(59, 130, 246, 0.3);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.mw-auth-submit--reg {
    margin-top: 14px;
    height: 48px;
    font-size: 13px;
}

.mw-auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.4);
}

.mw-auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.mw-auth-switch {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.68);
}

.mw-auth-switch a {
    color: #22d3ee;
    font-weight: 700;
    text-decoration: none;
}

.mw-auth-switch a:hover {
    text-decoration: underline;
}

/* ── Legacy maxwin.css overrides (critical) ── */
.maxwin-popup.mw-auth-modal .login-section {
    padding: 0 !important;
}

.maxwin-popup.mw-auth-modal .login-section h3.mw-auth-heading {
    color: #fff;
    font-size: inherit;
    font-weight: inherit;
    margin: inherit;
}

.maxwin-popup.mw-auth-modal .login-section label.mw-auth-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.48);
}

.maxwin-popup.mw-auth-modal .login-section input.mw-auth-input,
.maxwin-popup.mw-auth-modal .login-section select.mw-auth-select {
    display: block;
    width: 100%;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(0, 0, 0, 0.28) !important;
    border-radius: 14px;
    padding: 0 14px;
    box-sizing: border-box;
}

.maxwin-popup.mw-auth-modal .login-section input.mw-auth-input::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

.maxwin-popup.mw-auth-modal .login-section button.mw-auth-submit {
    display: flex;
    width: 100%;
    margin-top: 20px;
    padding: 0 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 45%, #8b5cf6 100%) !important;
    border: none !important;
    border-radius: 14px;
    color: #fff !important;
    text-align: center;
}

.maxwin-popup.mw-auth-modal .login-section button.mw-password-toggle {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    min-height: 28px;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.45) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
}

.maxwin-popup.mw-auth-modal .login-section button.mw-password-toggle:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
}

.maxwin-popup.mw-auth-modal .login-section p.mw-auth-switch {
    display: block;
    width: 100%;
    margin-top: 14px;
    text-align: center;
    color: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    font-weight: 400;
}

.maxwin-popup.mw-auth-modal .login-section p.mw-auth-switch a {
    color: #22d3ee;
    font-weight: 700;
}

.maxwin-popup.mw-auth-modal .login-section .mw-auth-hint {
    display: block;
    text-align: left;
    width: auto !important;
    margin-top: 4px !important;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.48);
}

.maxwin-popup.mw-auth-modal .login-section label.mw-auth-checkbox {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    width: auto;
    margin: 0;
    cursor: pointer;
}

.maxwin-popup.mw-auth-modal .login-section span.mw-checkbox-box {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    flex: 0 0 18px !important;
    margin-top: 1px !important;
    margin-bottom: 0 !important;
    text-align: left !important;
    box-sizing: border-box;
}

.maxwin-popup.mw-auth-modal .login-section span.mw-checkbox-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    max-width: none;
    margin: 0 !important;
    text-align: left !important;
    text-transform: none;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.68);
}

.maxwin-popup.mw-auth-modal .login-section span.mw-checkbox-text a {
    color: #22d3ee !important;
    font-weight: 600 !important;
    text-decoration: none;
}

.maxwin-popup.mw-auth-modal .login-section span.mw-checkbox-text a:hover {
    text-decoration: underline;
}

.maxwin-popup.mw-auth-modal .login-section .mw-auth-forgot {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.maxwin-popup.mw-auth-modal .login-section .mw-auth-forgot a {
    color: #22d3ee;
}

/* Mobile */
@media (max-width: 768px) {
    .maxwin-popup.mw-auth-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .maxwin-popup.mw-auth-modal .popup-inner.mw-auth-shell {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 22px;
    }

    .mw-auth-layout,
    .mw-auth-layout--register {
        grid-template-columns: 1fr;
    }

    .mw-auth-visual {
        display: none;
    }

    .mw-auth-close {
        width: 36px;
        height: 36px;
        top: 12px;
        right: 12px;
    }

    .mw-auth-close i {
        font-size: 20px;
    }

    .mw-auth-panel__scroll {
        padding: 22px 18px 24px;
        max-height: calc(100vh - 20px);
    }

    .mw-auth-shell--register .mw-auth-panel__scroll {
        padding: 22px 18px 24px;
    }

    .mw-register-grid {
        grid-template-columns: 1fr;
    }

    .mw-auth-input,
    .mw-auth-select,
    .mw-auth-input--reg,
    .mw-auth-select--reg {
        height: 44px;
    }
}

@media (max-width: 430px) {
    .mw-auth-captcha {
        transform: scale(0.88);
        transform-origin: left top;
        height: 70px;
        margin-bottom: 4px;
    }
}
