/* Fleep — модалка входа / регистрации (#authModal)
   Отдельная стилистика: не двухколоночный Dune, а компактная карточка Fleep. */

body.fleep-ui #authModal.modal {
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 10, 12, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.fleep-ui #authModal .modal-backdrop,
body.fleep-ui #authModal #modalBackdrop {
    background: transparent !important;
    backdrop-filter: none !important;
}

body.fleep-ui #authModal .modal-dialog.auth-modal-box,
body.fleep-ui #authModal .fleep-auth-shell {
    display: flex;
    flex-direction: column;
    width: min(420px, calc(100vw - 32px));
    max-width: none !important;
    max-height: min(92vh, 900px);
    margin: 0;
    padding: 0;
    border-radius: var(--fleep-radius-lg, 12px);
    background: var(--fleep-surface, #1D1E20) !important;
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06)) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48) !important;
    overflow: hidden;
    position: relative;
}

body.fleep-ui #authModal .auth-modal-box::before {
    display: none !important;
}

body.fleep-ui #authModal .modal-dialog.auth-modal-box--register {
    width: min(480px, calc(100vw - 32px));
}

body.fleep-ui #authModal .modal-close {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: var(--fleep-radius, 8px);
    background: var(--fleep-elevated, #262628) !important;
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06)) !important;
    color: var(--fleep-text-muted, #83898E) !important;
    font-size: 1.35rem;
    line-height: 1;
    z-index: 5;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

body.fleep-ui #authModal .modal-close:hover {
    color: var(--fleep-text, #fff) !important;
    background: var(--fleep-panel-hover, #2e3034) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.fleep-ui #authModal .auth-modal-form {
    flex: 1 1 auto;
    width: 100% !important;
    max-width: none !important;
    min-height: 0;
    padding: 24px 22px 22px !important;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
}

body.fleep-ui #authModal .fleep-auth-brand {
    display: flex;
    justify-content: center;
    margin: 0 0 18px;
}

body.fleep-ui #authModal .fleep-auth-brand__logo {
    display: block;
    height: 32px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

body.fleep-ui #authModal .auth-modal-title {
    display: none;
    margin: 0 0 14px;
    font-family: var(--fleep-font, Roboto, sans-serif);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--fleep-text, #fff);
    text-align: center;
}

body.fleep-ui #authModal:has(#forgotPasswordForm:not(.hidden)) .auth-modal-title,
body.fleep-ui #authModal:has(#resetPasswordForm:not(.hidden)) .auth-modal-title {
    display: block;
}

body.fleep-ui #authModal:has(#forgotPasswordForm:not(.hidden)) .auth-tabs,
body.fleep-ui #authModal:has(#resetPasswordForm:not(.hidden)) .auth-tabs,
body.fleep-ui #authModal:has(#forgotPasswordForm:not(.hidden)) .fleep-auth-brand,
body.fleep-ui #authModal:has(#resetPasswordForm:not(.hidden)) .fleep-auth-brand {
    display: none;
}

/* Segmented tabs */
body.fleep-ui #authModal .auth-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 20px;
    background: var(--fleep-elevated, #262628);
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--fleep-radius, 8px);
    flex-shrink: 0;
}

body.fleep-ui #authModal .auth-tabs .tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--fleep-text-muted, #83898E);
    font-family: var(--fleep-font, Roboto, sans-serif);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body.fleep-ui #authModal .auth-tabs .tab:hover {
    color: var(--fleep-text, #fff);
}

body.fleep-ui #authModal .auth-tabs .tab.active {
    background: var(--fleep-red, #D91000);
    color: #fff;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.15);
    border-bottom: none;
}

/* Forms */
body.fleep-ui #authModal .auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

body.fleep-ui #authModal .auth-form.hidden {
    display: none !important;
}

body.fleep-ui #authModal .reg-field-wrap,
body.fleep-ui #authModal .auth-totp-wrap {
    margin: 0;
}

body.fleep-ui #authModal .input-wrap {
    display: block;
    width: 100%;
    position: relative;
}

body.fleep-ui #authModal .input-icon {
    display: none !important;
}

body.fleep-ui #authModal .auth-input,
body.fleep-ui #authModal .auth-currency-trigger,
body.fleep-ui #authModal .auth-gender-trigger {
    width: 100%;
    min-height: 44px;
    padding: 0 14px !important;
    border-radius: var(--fleep-radius, 8px) !important;
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06)) !important;
    background: var(--fleep-elevated, #262628) !important;
    color: var(--fleep-text, #fff) !important;
    font-family: var(--fleep-font, Roboto, sans-serif);
    font-size: 14px;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.fleep-ui #authModal .input-wrap:focus-within .auth-input,
body.fleep-ui #authModal .auth-currency-trigger:focus,
body.fleep-ui #authModal .auth-gender-trigger:focus {
    outline: none;
    border-color: rgba(217, 16, 0, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(217, 16, 0, 0.14) !important;
}

body.fleep-ui #authModal .auth-input::placeholder {
    color: var(--fleep-text-muted, #83898E);
    opacity: 1;
}

body.fleep-ui #authModal .input-wrap--with-toggle .auth-input {
    padding-right: 44px !important;
}

body.fleep-ui #authModal .auth-clear-field,
body.fleep-ui #authModal .auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--fleep-text-muted, #83898E);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

body.fleep-ui #authModal .auth-clear-field:hover,
body.fleep-ui #authModal .auth-password-toggle:hover {
    color: var(--fleep-text, #fff);
    background: rgba(255, 255, 255, 0.05);
}

body.fleep-ui #authModal .auth-submit,
body.fleep-ui #authModal #btnLogin,
body.fleep-ui #authModal #btnForgotSend,
body.fleep-ui #authModal #btnRecoverSubmit,
body.fleep-ui #authModal #btnRegisterOneClick,
body.fleep-ui #authModal #btnRegister {
    width: 100%;
    min-height: 46px;
    margin-top: 4px;
    padding: 0 18px;
    border: none !important;
    border-radius: var(--fleep-radius, 8px) !important;
    background: var(--fleep-red, #D91000) !important;
    color: #fff !important;
    font-family: var(--fleep-font, Roboto, sans-serif);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

body.fleep-ui #authModal .auth-submit:hover:not(:disabled),
body.fleep-ui #authModal #btnLogin:hover:not(:disabled),
body.fleep-ui #authModal #btnRegister:hover:not(:disabled) {
    background: var(--fleep-red-light, #F3372B) !important;
}

body.fleep-ui #authModal .auth-submit:disabled,
body.fleep-ui #authModal .auth-submit.is-loading {
    opacity: 0.55;
    cursor: not-allowed;
}

body.fleep-ui #authModal .auth-forgot-row,
body.fleep-ui #authModal .auth-switch,
body.fleep-ui #authModal .auth-forgot-lead {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fleep-text-muted, #83898E);
    text-align: center;
}

body.fleep-ui #authModal .auth-forgot-lead {
    text-align: left;
    margin-bottom: 4px;
}

body.fleep-ui #authModal .auth-switch-link,
body.fleep-ui #authModal .auth-promo-link,
body.fleep-ui #authModal .auth-link {
    border: none;
    background: none;
    padding: 0;
    color: var(--fleep-red, #D91000);
    font-weight: 600;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    text-decoration: none;
}

body.fleep-ui #authModal .auth-switch-link:hover,
body.fleep-ui #authModal .auth-promo-link:hover,
body.fleep-ui #authModal .auth-link:hover {
    color: var(--fleep-red-light, #F3372B);
    text-decoration: underline;
}

body.fleep-ui #authModal .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 4px;
    font-size: 12px;
    color: var(--fleep-text-muted, #83898E);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.fleep-ui #authModal .auth-divider::before,
body.fleep-ui #authModal .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--fleep-border, rgba(255, 255, 255, 0.06));
}

body.fleep-ui #authModal .auth-social-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.fleep-ui #authModal .auth-social-btn {
    min-height: 42px;
    padding: 0 12px;
    border-radius: var(--fleep-radius, 8px);
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06)) !important;
    background: var(--fleep-elevated, #262628) !important;
    color: var(--fleep-text, #fff) !important;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

body.fleep-ui #authModal .auth-social-btn:hover {
    border-color: rgba(255, 255, 255, 0.12) !important;
    background: var(--fleep-panel-hover, #2e3034) !important;
}

body.fleep-ui #authModal .error-msg {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--fleep-radius, 8px);
    background: rgba(217, 16, 0, 0.12);
    border: 1px solid rgba(217, 16, 0, 0.28);
    color: #F8B4B4;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

body.fleep-ui #authModal .auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--fleep-text-muted, #83898E);
}

body.fleep-ui #authModal .auth-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--fleep-red, #D91000);
    flex-shrink: 0;
}

body.fleep-ui #authModal .password-strength-bar {
    height: 4px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--fleep-muted, #383C41);
    overflow: hidden;
}

body.fleep-ui #authModal .password-strength-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--fleep-red, #D91000);
    transition: width 0.2s ease, background 0.2s ease;
}

body.fleep-ui #authModal .password-strength-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--fleep-text-muted, #83898E);
}

body.fleep-ui #authModal .password-requirements {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--fleep-text-muted, #83898E);
}

body.fleep-ui #authModal .auth-currency-select {
    position: relative;
}

body.fleep-ui #authModal .auth-currency-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}

body.fleep-ui #authModal .auth-currency-symbol {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(217, 16, 0, 0.16);
    color: var(--fleep-red-light, #F3372B);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

body.fleep-ui #authModal .auth-currency-label {
    flex: 1;
    min-width: 0;
}

body.fleep-ui #authModal .auth-currency-chevron {
    color: var(--fleep-text-muted, #83898E);
    font-size: 10px;
}

body.fleep-ui #authModal .auth-currency-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: var(--fleep-radius, 8px);
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06));
    background: var(--fleep-surface, #1D1E20);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.fleep-ui #authModal .auth-currency-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--fleep-text, #fff);
}

body.fleep-ui #authModal .auth-currency-option:hover,
body.fleep-ui #authModal .auth-currency-option.selected {
    background: var(--fleep-elevated, #262628);
}

body.fleep-ui #authModal .auth-keyboard-hints {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--fleep-text-dim, #5C6369);
    text-align: center;
}

body.fleep-ui #authModal .auth-keyboard-hints kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06));
    background: var(--fleep-elevated, #262628);
    font-size: 10px;
    font-family: inherit;
}

/* Promo: сверху формы, не боковая колонка Dune */
body.fleep-ui #authModal .auth-modal-promo {
    order: -1;
    width: 100% !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    align-self: stretch !important;
    display: flex !important;
    padding: 18px 22px !important;
    background: var(--fleep-elevated, #262628) !important;
    border-bottom: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06)) !important;
    border-right: none !important;
}

body.fleep-ui #authModal .auth-modal-box--login .auth-modal-promo {
    display: none !important;
}

body.fleep-ui #authModal .auth-promo-idle-title,
body.fleep-ui #authModal .auth-promo-title {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fleep-red-light, #F3372B);
}

body.fleep-ui #authModal .auth-promo-idle-text,
body.fleep-ui #authModal .auth-promo-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fleep-text-muted, #83898E);
}

body.fleep-ui #authModal .auth-promo-preview-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

body.fleep-ui #authModal .auth-promo-hero {
    margin-bottom: 10px;
}

body.fleep-ui #authModal .auth-promo-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(217, 16, 0, 0.16);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

body.fleep-ui #authModal .auth-promo-amount {
    display: block;
    margin-top: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fleep-text, #fff);
    letter-spacing: -0.02em;
}

body.fleep-ui #authModal .auth-promo-meta,
body.fleep-ui #authModal .auth-promo-requirements {
    font-size: 12px;
    color: var(--fleep-text-muted, #83898E);
}

body.fleep-ui #authModal .reg-bonus-mobile-card {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: var(--fleep-radius, 8px);
    background: var(--fleep-elevated, #262628);
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06));
}

body.fleep-ui #authModal .reg-bonus-mobile-card__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fleep-red-light, #F3372B);
}

body.fleep-ui #authModal .reg-oneclick-success {
    padding: 14px;
    border-radius: var(--fleep-radius, 8px);
    background: var(--fleep-elevated, #262628);
    border: 1px solid var(--fleep-border, rgba(255, 255, 255, 0.06));
}

body.fleep-ui #authModal .reg-cred-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

body.fleep-ui #authModal .reg-cred-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--fleep-text, #fff);
    word-break: break-all;
}

body.fleep-ui #authModal .auth-close-btn,
body.fleep-ui #authModal #regFormClose {
    display: none !important;
}

body.fleep-ui #authModal .auth-telegram-wrap,
body.fleep-ui #authModal .auth-google-wrap {
    display: flex;
    justify-content: center;
}

@media (max-width: 767px) {
    body.fleep-ui #authModal.modal {
        align-items: flex-end;
        padding: 0;
    }

    body.fleep-ui #authModal .modal-dialog.auth-modal-box,
    body.fleep-ui #authModal .fleep-auth-shell {
        width: 100%;
        max-height: min(94vh, 94dvh);
        border-radius: 16px 16px 0 0;
    }

    body.fleep-ui #authModal .auth-modal-form {
        padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.fleep-ui #authModal .auth-modal-promo {
        padding: 16px !important;
    }
}

html[data-theme="light"] body.fleep-ui #authModal .modal-dialog.auth-modal-box,
html[data-theme="light"] body.fleep-ui #authModal .fleep-auth-shell {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="light"] body.fleep-ui #authModal .auth-input,
html[data-theme="light"] body.fleep-ui #authModal .auth-currency-trigger,
html[data-theme="light"] body.fleep-ui #authModal .auth-gender-trigger {
    background: #F2F1EF !important;
    color: #1A1B1E !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] body.fleep-ui #authModal .auth-tabs {
    background: #F2F1EF;
    border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] body.fleep-ui #authModal .auth-tabs .tab {
    color: #5C6369;
}

html[data-theme="light"] body.fleep-ui #authModal .auth-modal-promo,
html[data-theme="light"] body.fleep-ui #authModal .reg-bonus-mobile-card {
    background: #F2F1EF !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
