.imperial-auth-modal {
    --auth-gold: #f0b90b;
    --auth-gold-soft: #ffe071;
    --auth-gold-muted: #d9bd67;
    --auth-panel: #12141a;
    --auth-panel-2: #181b22;
    --auth-field: #0d0f13;
    --auth-text: #f8f4e7;
    --auth-danger: #ff4d68;
}

.imperial-auth-modal .modal-dialog {
    max-width: 520px;
}

.imperial-auth-modal--register .modal-dialog {
    max-width: 540px;
}

.imperial-auth-modal__content {
    position: relative;
    overflow: hidden;
    color: var(--auth-text);
    background:
        radial-gradient(circle at top right, rgba(240, 185, 11, 0.16), transparent 34%),
        linear-gradient(145deg, var(--auth-panel-2), #0a0b0e 72%);
    border: 3px solid rgba(240, 185, 11, 0.82);
    border-radius: 10px;
    box-shadow:
        0 0 0 1px rgba(255, 224, 126, 0.16),
        0 22px 60px rgba(0, 0, 0, 0.72),
        0 0 34px rgba(240, 185, 11, 0.18);
}

.imperial-auth-modal__header,
.imperial-auth-modal__footer {
    border-color: rgba(240, 185, 11, 0.24);
    background: rgba(9, 10, 12, 0.46);
}

.imperial-auth-modal__header {
    align-items: flex-start;
    padding: 1.25rem 1.35rem 1rem;
}

.imperial-auth-modal__body {
    padding: 1.25rem 1.35rem 0.9rem;
}

.imperial-auth-modal--register .imperial-auth-modal__body {
    max-height: min(68vh, 620px);
    overflow-y: auto;
    scrollbar-color: rgba(240, 185, 11, 0.55) rgba(255, 255, 255, 0.05);
    scrollbar-width: thin;
}

.imperial-auth-modal--register .imperial-auth-modal__body::-webkit-scrollbar {
    width: 8px;
}

.imperial-auth-modal--register .imperial-auth-modal__body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

.imperial-auth-modal--register .imperial-auth-modal__body::-webkit-scrollbar-thumb {
    background: rgba(240, 185, 11, 0.55);
    border-radius: 999px;
}

.imperial-auth-modal__footer {
    gap: 0.55rem;
    padding: 1rem 1.35rem 1.2rem;
}

.imperial-auth-modal__eyebrow {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--auth-gold);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.imperial-auth-modal__title {
    color: var(--auth-text);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0;
}

.imperial-auth-modal__close {
    width: 2rem;
    height: 2rem;
    padding: 0.45rem;
    border: 1px solid rgba(240, 185, 11, 0.42);
    border-radius: 8px;
    background-color: rgba(240, 185, 11, 0.08);
    filter: invert(84%) sepia(86%) saturate(867%) hue-rotate(348deg) brightness(99%) contrast(91%);
    opacity: 0.88;
}

.imperial-auth-modal__close:hover,
.imperial-auth-modal__close:focus {
    opacity: 1;
    box-shadow: 0 0 0 0.18rem rgba(240, 185, 11, 0.18);
}

.imperial-auth-modal__label {
    color: var(--auth-gold-muted);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.45rem;
}

.imperial-auth-modal__input {
    min-height: 46px;
    color: var(--auth-text) !important;
    background: var(--auth-field) !important;
    border: 1px solid rgba(240, 185, 11, 0.58) !important;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    caret-color: var(--auth-gold);
}

.imperial-auth-modal__input::placeholder {
    color: rgba(217, 189, 103, 0.58);
}

.imperial-auth-modal__input:focus {
    color: var(--auth-text) !important;
    background: #101216 !important;
    border-color: var(--auth-gold) !important;
    box-shadow: 0 0 0 0.2rem rgba(240, 185, 11, 0.18), 0 0 18px rgba(240, 185, 11, 0.12);
}

.imperial-auth-modal__input:-webkit-autofill,
.imperial-auth-modal__input:-webkit-autofill:hover,
.imperial-auth-modal__input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-text);
    box-shadow: 0 0 0 1000px var(--auth-field) inset, 0 0 0 0.2rem rgba(240, 185, 11, 0.12);
    caret-color: var(--auth-gold);
    transition: background-color 9999s ease-out;
}

.imperial-auth-modal__error {
    margin-top: 0.35rem;
    color: var(--auth-danger);
    font-size: 0.82rem;
    font-weight: 700;
}

.imperial-auth-modal__btn {
    min-width: 92px;
    border-radius: 8px;
    font-weight: 800;
    letter-spacing: 0;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.imperial-auth-modal__btn:hover {
    transform: translateY(-1px);
}

.imperial-auth-modal__btn--ghost {
    color: var(--auth-text);
    border: 1px solid rgba(240, 185, 11, 0.72);
    background: rgba(240, 185, 11, 0.04);
}

.imperial-auth-modal__btn--ghost:hover,
.imperial-auth-modal__btn--ghost:focus {
    color: var(--auth-gold);
    border-color: var(--auth-gold);
    background: rgba(240, 185, 11, 0.1);
}

.imperial-auth-modal__btn--gold {
    color: #151008;
    border: 1px solid #ffd86a;
    background: linear-gradient(135deg, #ffe07a 0%, var(--auth-gold) 48%, #b87b00 100%);
    box-shadow: 0 0 18px rgba(240, 185, 11, 0.26);
}

.imperial-auth-modal__btn--gold:hover,
.imperial-auth-modal__btn--gold:focus {
    color: #0d0b08;
    border-color: #ffe8a8;
    box-shadow: 0 0 24px rgba(240, 185, 11, 0.36);
}

.imperial-auth-modal__btn--gold:disabled {
    color: rgba(21, 16, 8, 0.72);
    opacity: 0.72;
    transform: none;
}

.imperial-auth-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    display: grid;
    gap: 0.6rem;
    width: min(360px, calc(100vw - 2rem));
}

.imperial-auth-toast {
    color: var(--auth-text, #f8f4e7);
    background: linear-gradient(145deg, #14171d, #090a0d);
    border: 1px solid rgba(240, 185, 11, 0.55);
    border-radius: 10px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.5);
}

.imperial-auth-toast .toast-body {
    font-weight: 700;
}

.imperial-auth-toast .btn-close {
    filter: invert(84%) sepia(86%) saturate(867%) hue-rotate(348deg) brightness(99%) contrast(91%);
}

@media (max-width: 575.98px) {
    .imperial-auth-modal .modal-dialog {
        margin: 0.85rem;
    }

    .imperial-auth-modal--register .imperial-auth-modal__body {
        max-height: 68vh;
    }

    .imperial-auth-modal__footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .imperial-auth-modal__btn {
        width: 100%;
        min-width: 0;
    }
}
