:root {
    --auth-bg: #f5f6f8;
    --auth-surface: #ffffff;
    --auth-text: #252b36;
    --auth-muted: #727b89;
    --auth-border: #dfe3e8;
    --auth-navy: #151c27;
    --auth-gold: var(--Rewista-firstColor, #fbbe2c);
    --auth-danger: #c93646;
}

.auth-shell,
.auth-shell * {
    box-sizing: border-box;
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: "Poppins", "Titillium Web", sans-serif;
}

.auth-header {
    position: sticky;
    top: 0;
    z-index: 12000;
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 10px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: var(--auth-navy);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-brand:hover {
    color: #fff;
}

.auth-brand img {
    width: 29px;
    height: 29px;
}

.auth-brand > span > span {
    color: var(--auth-gold);
}

.auth-header__actions,
.auth-header__switch {
    display: flex;
    align-items: center;
}

.auth-header .culture-combobox {
    width: 108px !important;
    min-height: 36px !important;
    border-color: rgba(255, 255, 255, .13) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, .055) !important;
}

.auth-header .culture-combobox:hover,
.auth-header .culture-combobox:focus-within {
    border-color: rgba(251, 190, 44, .42) !important;
    background: rgba(255, 255, 255, .085) !important;
}

.auth-header .culture-combobox .dxbl-edit-btn-dropdown {
    border-left: 0 !important;
}

.auth-header__actions {
    gap: 14px;
}

.auth-header__switch {
    gap: 7px;
    color: rgba(255, 255, 255, .62);
    font-size: .76rem;
}

.auth-header__link {
    position: relative;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--auth-gold);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: color .16s ease;
}

.auth-header__link::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: currentColor;
    content: "";
    opacity: 0;
    transform: scaleX(.6);
    transition: opacity .16s ease, transform .16s ease;
}

.auth-header__link:hover,
.auth-header__link:focus-visible {
    color: #ffd064;
    outline: none;
}

.auth-header__link:hover::after,
.auth-header__link:focus-visible::after {
    opacity: .8;
    transform: scaleX(1);
}

.auth-header__divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, .11);
}

.auth-main {
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    flex: none !important;
}

.auth-stage {
    display: flex;
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
    flex-direction: column;
    padding: clamp(48px, 8vh, 76px) 24px 20px;
}

.auth-stage__content {
    display: flex;
    flex: 1 0 auto;
    align-items: flex-start;
    justify-content: center;
}

.auth-card {
    width: min(100%, 580px);
    padding: 32px;
    border: 1px solid #e2e5e9;
    border-radius: 12px;
    background: var(--auth-surface);
    box-shadow: 0 10px 30px rgba(21, 28, 39, .055);
}

.auth-card--compact {
    width: min(100%, 460px);
}

.auth-card--wide {
    width: min(100%, 780px);
}

.auth-card__header {
    margin-bottom: 28px;
}

.auth-card__header h1 {
    margin: 0 0 7px;
    color: var(--auth-text);
    font-size: clamp(1.6rem, 3vw, 1.85rem);
    font-weight: 600;
    line-height: 1.25;
}

.auth-card__header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: .84rem;
    line-height: 1.6;
}

.auth-heading-with-back {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.auth-heading-with-back .auth-card__header {
    flex: 1;
}

.auth-form {
    display: grid;
    gap: 21px;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
}

.auth-form-grid__full {
    grid-column: 1 / -1;
}

.auth-control {
    min-width: 0;
}

.auth-card .rw-form-group {
    min-height: 44px;
    margin-bottom: 0;
}

.auth-card .rw-auth-input {
    height: 44px;
    border-color: #cfd5dd;
    border-radius: 6px;
    font-family: "Poppins", sans-serif;
    font-size: .87rem;
}

.auth-card .rw-auth-input:hover {
    border-color: #aeb6c1;
}

.auth-card .rw-auth-input:focus {
    border-color: var(--auth-gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(251, 190, 44, .14);
}

.auth-card .rw-auth-combo {
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-color: #cfd5dd !important;
    border-radius: 6px !important;
    font-family: "Poppins", sans-serif !important;
    font-size: .87rem !important;
}

.auth-card .rw-auth-combo:focus-within {
    border-color: var(--auth-gold) !important;
    box-shadow: 0 0 0 3px rgba(251, 190, 44, .14) !important;
}

.auth-card .field__validation-message,
.auth-card .validation-message {
    display: block;
    margin-top: 5px;
    color: var(--auth-danger) !important;
    font-size: .72rem;
    line-height: 1.4;
}

.auth-form-options {
    display: flex;
    justify-content: flex-end;
    margin-top: -11px;
}

.auth-link-button,
.auth-text-link {
    color: #8b5a00;
    font: inherit;
    font-size: .77rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-link-button {
    padding: 2px 0;
    border: 0;
    background: transparent;
}

.auth-link-button:hover,
.auth-text-link:hover {
    color: #5f3e00;
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    margin-top: 1px;
}

.auth-submit .rounded-rewista-button,
.auth-actions .rounded-rewista-button,
.auth-status .rounded-rewista-button,
.auth-heading-with-back .rounded-rewista-button {
    border-radius: 6px !important;
}

.auth-button-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-button-spinner,
.auth-loader__spinner {
    display: inline-block;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

.auth-button-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
}

.auth-loader__spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e2e6ea;
    border-top-color: var(--auth-gold);
}

.auth-form-hint {
    margin: -10px 0 0;
    color: var(--auth-muted);
    font-size: .72rem;
    line-height: 1.5;
}

.auth-alert {
    padding: 10px 12px;
    border: 1px solid rgba(201, 54, 70, .22);
    border-radius: 6px;
    background: rgba(201, 54, 70, .05);
    color: #a72938;
    font-size: .76rem;
    line-height: 1.5;
}

.auth-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 2px;
}

.auth-stepper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 30px;
    border-bottom: 1px solid var(--auth-border);
}

.auth-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 8px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #8a929e;
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
}

.auth-step > span {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    background: #e8ebef;
    color: #69727f;
    font-size: .69rem;
}

.auth-step.is-active,
.auth-step.is-complete {
    border-bottom-color: var(--auth-gold);
    color: var(--auth-text);
}

.auth-step.is-active > span,
.auth-step.is-complete > span {
    background: var(--auth-gold);
    color: #29220e;
}

.auth-step:disabled {
    cursor: default;
}

.auth-status,
.auth-loader {
    display: flex;
    min-height: 245px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.auth-loader {
    gap: 12px;
    color: var(--auth-muted);
    font-size: .8rem;
}

.auth-status > i {
    margin-bottom: 14px;
    color: var(--auth-gold);
    font-size: 2.3rem;
}

.auth-status h1,
.auth-status h2 {
    margin: 0 0 9px;
    color: var(--auth-text);
    font-size: 1.55rem;
    font-weight: 600;
}

.auth-status p {
    max-width: 410px;
    margin: 0 0 23px;
    color: var(--auth-muted);
    font-size: .82rem;
    line-height: 1.6;
}

.auth-code-control .rw-auth-input {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .35em;
}

.auth-mobile-switch {
    display: none;
    margin: 22px 0 0;
    color: var(--auth-muted);
    font-size: .78rem;
    text-align: center;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin-top: 30px;
    color: #89919c;
    font-size: .67rem;
}

.auth-toasts,
.auth-country-dropdown,
.culture-dropdown {
    z-index: 14010 !important;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
    .auth-header {
        min-height: 56px;
        padding: 9px 15px;
    }

    .auth-brand {
        font-size: .94rem;
    }

    .auth-brand img {
        width: 26px;
        height: 26px;
    }

    .auth-header__switch {
        display: none;
    }

    .auth-header__actions {
        gap: 8px;
    }

    .auth-header__divider {
        display: none;
    }

    .auth-header .culture-combobox {
        width: 58px !important;
    }

    .auth-main,
    .auth-stage {
        min-height: calc(100vh - 56px);
        min-height: calc(100dvh - 56px);
    }

    .auth-main {
        height: calc(100vh - 56px);
        height: calc(100dvh - 56px);
        background: #fff;
    }

    .auth-stage {
        justify-content: flex-start;
        padding: 32px 20px 16px;
    }

    .auth-stage__content {
        align-items: flex-start;
    }

    .auth-card {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .auth-card__header {
        margin-bottom: 26px;
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
    }

    .auth-form-grid__full {
        grid-column: auto;
    }

    .auth-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .auth-actions > :first-child {
        order: 2;
    }

    .auth-actions .rounded-rewista-button {
        width: 100% !important;
    }

    .auth-mobile-switch {
        display: block;
    }

    .auth-footer {
        justify-content: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-button-spinner,
    .auth-loader__spinner {
        animation: none;
    }
}
