/* ==========================================================
   AUTH MODAL SYSTEM â€” Glassmorphic login/OTP/signup modals
   Adapted from Medical Insurance design reference
   ========================================================== */

/* Auth tokens now live in theme.tokens.css (single source of truth) */

/* ==========================================================
   OVERLAY
   ========================================================== */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    animation: authModalFadeIn 0.3s ease;
}

.auth-modal-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: var(--auth-overlay-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================
   GLASS CARD
   ========================================================== */
.auth-modal {
    position: relative;
    width: var(--auth-card-width);
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    border-radius: var(--auth-card-radius);
    background: var(--auth-glass-bg);
    border: 1px solid var(--auth-glass-border);
    box-shadow: var(--auth-glass-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 24px 36px 28px;
    overflow: hidden;
    animation: authModalScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gradient border overlay */
.auth-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--auth-card-radius);
    padding: 1px;
    background: linear-gradient(135deg,
    color-mix(in srgb, var(--n0) 80%, transparent) 0%,
    transparent 50%,
    color-mix(in srgb, var(--n0) 40%, transparent) 100%);
    -webkit-mask: linear-gradient(var(--n0) 0 0) content-box,
    linear-gradient(var(--n0) 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================
   BLUR CIRCLES (decorative background)
   ========================================================== */
.auth-modal__blur-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--auth-card-radius);
    pointer-events: none;
    z-index: 0;
}

.auth-modal__blur-circle {
    position: absolute;
    width: 338px;
    height: 338px;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.auth-modal__blur-circle--1 {
    background: var(--brand-primary);
    top: -100px;
    left: -80px;
    opacity: 0.5;
}

.auth-modal__blur-circle--2 {
    background: var(--brand-primary-light);
    top: -102px;
    left: 209px;
    mix-blend-mode: hard-light;
    opacity: 0.4;
}

.auth-modal__blur-circle--3 {
    background: var(--brand-primary-dark);
    top: 272px;
    left: -85px;
    mix-blend-mode: hard-light;
    opacity: 0.35;
}

.auth-modal__blur-circle--4 {
    background: var(--brand-primary-lighter);
    top: -82px;
    left: -78px;
    mix-blend-mode: hard-light;
    opacity: 0.3;
}

.auth-modal__blur-circle--5 {
    background: var(--brand-primary-hover);
    top: -128px;
    left: -138px;
    mix-blend-mode: hard-light;
    opacity: 0.35;
}

.auth-modal__blur-circle--6 {
    background: var(--brand-primary-border);
    top: 256px;
    left: 253px;
    mix-blend-mode: hard-light;
    opacity: 0.25;
}

/* ==========================================================
   DECORATIVE IMAGES
   ========================================================== */
.auth-modal__decor {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.auth-modal__decor--bg {
    bottom: -36px;
    right: -47px;
    width: 475px;
    height: 403px;
    opacity: 0.3;
}

.auth-modal__decor--leaf {
    top: -78px;
    right: -99px;
    width: 475px;
    height: 403px;
    opacity: 0.3;
}

.auth-modal__decor--shape {
    bottom: 0;
    right: 0;
    width: 120px;
    opacity: 0.3;
}

/* ==========================================================
   HEADER ROW (close + logo)
   ========================================================== */
.auth-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 10;
    margin-bottom: 0;
}

.auth-modal__close {
    background: color-mix(in srgb, var(--n0) 12%, transparent);
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--auth-text-primary);
    opacity: 0.8;
    transition: opacity 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.auth-modal__close:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--n0) 20%, transparent);
}

.auth-modal__close svg {
    width: 18px;
    height: 18px;
}

.auth-modal__logo {
    padding: 0;
    pointer-events: none;
}

.auth-modal__logo img {
    width: 32px;
    height: 28px;
    opacity: 0.7;
}

/* ==========================================================
   TYPOGRAPHY
   ========================================================== */
.auth-modal__title {
    font-weight: 700;
    font-size: 24px;
    line-height: 32px;
    color: var(--auth-text-primary);
    text-align: center;
    letter-spacing: -0.5px;
    margin: 0;
    position: relative;
    z-index: 2;
}

.auth-modal__subtitle {
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: var(--auth-text-muted);
    text-align: center;
    letter-spacing: -0.08px;
    margin: 4px 0 14px 0;
    position: relative;
    z-index: 2;
}

.auth-modal__subtitle strong {
    font-weight: 500;
    color: var(--auth-text-primary);
}

/* ==========================================================
   INPUT GROUPS
   ========================================================== */
.auth-input-group {
    text-align: left;
    margin-top: 12px;
    position: relative;
    z-index: 2;
}

.auth-input-label {
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: var(--auth-text-primary);
    display: block;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.auth-input {
    width: 100%;
    height: var(--auth-input-height);
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: var(--auth-input-radius);
    padding: 0 20px;
    font-weight: 400;
    font-size: 16px;
    color: var(--auth-input-text);
    outline: none;
    box-sizing: border-box;
    letter-spacing: -0.08px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input::placeholder {
    color: var(--auth-input-placeholder);
}

.auth-input:focus {
    border-color: var(--brand-green);
    box-shadow: var(--shadow-md);
}

.auth-input--error {
    border-color: var(--auth-error);
}

.auth-input--disabled {
    background: color-mix(in srgb, var(--n0) 8%, transparent);
    color: var(--auth-text-muted);
    cursor: not-allowed;
}

/* Select dropdown */
.auth-select {
    width: 100%;
    height: var(--auth-input-height);
    background: var(--auth-input-bg);
    border: 0.5px solid var(--auth-input-border);
    border-radius: var(--auth-input-radius);
    padding: 0 20px;
    font-weight: 400;
    font-size: 16px;
    color: var(--auth-input-text);
    outline: none;
    box-sizing: border-box;
    letter-spacing: -0.08px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23505F79' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.auth-select:focus {
    border-color: var(--brand-green);
}

/* Error message */
.auth-error-message {
    display: none;
    font-size: 13px;
    color: var(--auth-error);
    margin-top: 4px;
    letter-spacing: -0.08px;
}

.auth-error-message--visible {
    display: block;
}

/* Alert banner â€” form-level error / warning */
.auth-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--n20);
    border: 1.5px solid var(--error);
    border-radius: 10px;
    margin-top: 16px;
    animation: authAlertSlideDown 0.3s ease;
}

.auth-alert-banner__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    color: var(--auth-error);
}

.auth-alert-banner__text {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-error);
    line-height: 1.5;
}

@keyframes authAlertSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================
   CAPTCHA ROW
   ========================================================== */
/* ==========================================================
   IBS-RECAPTURE — single CAPTCHA component used everywhere
   (search forms + register form + OTP step-up). Renders as a
   regular form field with an IbsInputText for the answer plus
   a small canvas as a visual prefix on the same row.
   ========================================================== */
.ibs-recapture {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.ibs-recapture__label {
    font-size: 13px;
    color: var(--auth-input-placeholder);
    margin-inline-start: 4px;
}

.ibs-recapture__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ibs-recapture__canvas {
    flex: 0 0 120px;
    height: 56px;
    border: 1px solid var(--auth-input-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-input-bg);
    user-select: none;
}

.ibs-recapture__canvas canvas {
    width: 100%;
    height: 100%;
}

.ibs-recapture__input-slot {
    flex: 1;
    min-width: 0;
}

[data-theme="dark"] .ibs-recapture__canvas {
    background: var(--auth-input-bg);
    border-color: var(--auth-input-border);
}

/* ==========================================================
   CAPTCHA GATE — wraps insurance-search forms behind a CAPTCHA.
   Standalone styles (no auth-modal overlay) so it lays out
   correctly inside any wizard step that wraps its content in
   <CaptchaGate>. Reuses the .auth-captcha-row* styles above
   for the canvas + input + refresh row.
   ========================================================== */
.captcha-gate {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 320px;
    padding: 24px 16px;
}

.captcha-gate__card {
    width: 100%;
    max-width: 480px;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.captcha-gate__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--auth-input-text);
    text-align: center;
}

.captcha-gate__description {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--auth-input-placeholder);
    text-align: center;
    line-height: 1.5;
}

.captcha-gate__error {
    margin: 0;
    font-size: 13px;
    color: var(--auth-error);
    text-align: center;
}

.captcha-gate__message {
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--auth-input-placeholder);
    text-align: center;
}

[data-theme="dark"] .captcha-gate__card {
    background: var(--auth-input-bg);
    border-color: var(--auth-input-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================================================
   PRIMARY BUTTON
   ========================================================== */
.auth-btn {
    width: 100%;
    height: 46px;
    background: var(--brand-primary);
    border-radius: var(--auth-btn-radius);
    font-weight: 600;
    font-size: 15px;
    color: var(--n0);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 2;
    margin-top: 16px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--brand-primary-hover);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-btn--loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0.85;
    pointer-events: none;
}

.auth-btn__spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid color-mix(in srgb, var(--n0) 40%, transparent);
    border-top-color: var(--n0);
    border-radius: 50%;
    animation: authBtnSpin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes authBtnSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================
   FOOTER LINKS
   ========================================================== */
.auth-link {
    font-weight: 400;
    font-size: 13px;
    color: var(--auth-text-muted);
    text-align: center;
    margin-top: 10px;
    flex-shrink: 0;
    letter-spacing: -0.08px;
    position: relative;
    z-index: 2;
}

.auth-link a,
.auth-link button {
    text-decoration: underline;
    color: var(--auth-text-primary);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    transition: opacity 0.2s;
}

.auth-link a:hover,
.auth-link button:hover {
    opacity: 0.8;
}

/* Spacer to push footer content down */
.auth-spacer {
    flex: 1;
}

/* ==========================================================
   OTP INPUT
   ========================================================== */
.auth-otp-container {
    display: flex;
    direction: ltr;
    gap: 22px;
    justify-content: center;
    margin-top: 24px;
    position: relative;
    z-index: 2;
}

.auth-otp-input {
    width: 58px;
    height: 58px;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: var(--auth-input-radius);
    text-align: center;
    font-weight: 700;
    font-size: 26px;
    color: var(--auth-input-text);
    outline: none;
    caret-color: var(--brand-green);
    transition: all 0.2s;
    padding: 0;
    padding-inline: 0;
    text-indent: 0;
    direction: ltr;
    unicode-bidi: plaintext;
    line-height: 58px;
}

.auth-otp-input:focus {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-green);
}

.auth-otp-input--filled {
    box-shadow: var(--shadow-md);
    border-color: var(--brand-green);
}

.auth-otp-input--error {
    background: var(--n20);
    border: 1.5px solid var(--auth-error);
    box-shadow: 0 0 0 2px var(--auth-input-bg);
}

.auth-otp-input--success {
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-success);
    box-shadow: 0 0 0 2px var(--auth-input-bg);
}

/* OTP Status */
.auth-otp-status {
    min-height: 24px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--auth-text-secondary);
    position: relative;
    z-index: 2;
}

.auth-otp-status__success {
    color: var(--auth-success);
}

.auth-otp-status__error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--auth-error);
}

.auth-otp-status__error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--n20);
    flex-shrink: 0;
}

/* OTP Timer */
.auth-otp-timer {
    font-weight: 500;
    font-size: 16px;
    color: var(--auth-text-primary);
    text-align: center;
    margin-top: 16px;
    letter-spacing: -0.08px;
    position: relative;
    z-index: 2;
}

.auth-otp-timer strong {
    font-weight: 700;
}

/* OTP Edit link */
.auth-otp-edit {
    text-align: center;
    margin-top: 16px;
    font-weight: 400;
    font-size: 14px;
    color: var(--auth-text-muted);
    position: relative;
    z-index: 2;
}

.auth-otp-edit a,
.auth-otp-edit button {
    color: var(--auth-text-secondary);
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.auth-otp-edit strong,
.auth-otp-edit button strong {
    font-weight: 700;
    color: var(--auth-text-primary);
    text-decoration: underline;
}

/* OTP Resend button */
.auth-otp-resend {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    position: relative;
    z-index: 2;
}

.auth-otp-resend button {
    background: none;
    border: none;
    color: var(--auth-text-primary);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.auth-otp-resend button:hover {
    opacity: 0.8;
}

/* ==========================================================
   PASSWORD VALIDATION HINTS
   ========================================================== */
.auth-password-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 8px;
    position: relative;
    z-index: 2;
}

.auth-password-hint {
    font-size: 12px;
    color: var(--auth-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-password-hint--valid {
    color: var(--auth-success);
}

.auth-password-hint--invalid {
    color: var(--auth-error);
}

.auth-password-hint svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ==========================================================
   ROW LAYOUT (side-by-side fields)
   ========================================================== */
.auth-row {
    display: flex;
    gap: 16px;
}

.auth-row>.auth-input-group {
    flex: 1;
    min-width: 0;
}

/* ==========================================================
   SEARCHABLE SELECT (AuthSearchSelect)
   ========================================================== */
.auth-search-select {
    width: 100%;
    height: var(--auth-input-height);
    background: var(--auth-input-bg);
    border: 0.5px solid var(--auth-input-border);
    border-radius: var(--auth-input-radius);
    padding: 0 36px 0 20px;
    font-weight: 400;
    font-size: 16px;
    color: var(--auth-input-text);
    outline: none;
    box-sizing: border-box;
    letter-spacing: -0.08px;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    transition: border-color 0.2s;
}

.auth-search-select:hover {
    border-color: var(--brand-green);
}

.auth-search-select--open {
    border-color: var(--brand-green);
}

.auth-search-select__text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-search-select__text--placeholder {
    color: var(--auth-input-placeholder);
}

.auth-search-select__text {
    color: var(--auth-input-text);
}

.auth-search-select__arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 8px;
    pointer-events: none;
    transition: transform 0.2s;
}

.auth-search-select--open .auth-search-select__arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Elevate the input-group stacking context when dropdown is open */
.auth-input-group:has(.auth-search-select--open) {
    z-index: 20;
}

.auth-search-select__backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.auth-search-select__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: color-mix(in srgb, var(--n900) 88%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid color-mix(in srgb, var(--n0) 15%, transparent);
    border-radius: var(--auth-input-radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    animation: authSelectSlideIn 0.15s ease;
}

.auth-search-select__search {
    padding: 8px;
    border-bottom: 1px solid var(--auth-input-border);
}

.auth-search-select__search-input {
    width: 100%;
    height: 36px;
    border: 0.5px solid color-mix(in srgb, var(--n0) 20%, transparent);
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--n0);
    background: color-mix(in srgb, var(--n0) 8%, transparent);
    outline: none;
    box-sizing: border-box;
}

.auth-search-select__search-input:focus {
    border-color: var(--brand-green);
}

.auth-search-select__options {
    max-height: 180px;
    overflow-y: auto;
}

.auth-search-select__option {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--n0);
    cursor: pointer;
    transition: background 0.1s;
}

.auth-search-select__option:hover {
    background: color-mix(in srgb, var(--n0) 10%, transparent);
}

.auth-search-select__option--active {
    background: color-mix(in srgb, var(--brand-primary) 30%, transparent);
    color: var(--brand-primary-lighter);
    font-weight: 500;
}

.auth-search-select__empty {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--auth-text-muted);
    text-align: center;
}

@keyframes authSelectSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================
   ANIMATIONS
   ========================================================== */
@keyframes authModalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes authModalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================
   DARK MODE
   ========================================================== */
[data-theme="dark"] .auth-modal {
    --auth-glass-bg: color-mix(in srgb, var(--n800) 35%, transparent);
    --auth-glass-border: color-mix(in srgb, var(--n0) 15%, transparent);
    background: var(--auth-glass-bg);
    border-color: var(--auth-glass-border);
}

[data-theme="dark"] .auth-input,
[data-theme="dark"] .auth-select,
[data-theme="dark"] .auth-search-select {
    background: var(--auth-input-bg);
    border-color: var(--auth-input-border);
    color: var(--auth-input-text);
}

[data-theme="dark"] .auth-captcha-row {
    background: color-mix(in srgb, var(--n800) 60%, transparent);
    border-color: color-mix(in srgb, var(--n0) 15%, transparent);
}

[data-theme="dark"] .auth-captcha-row__input {
    color: var(--text);
}

[data-theme="dark"] .auth-captcha-row__refresh {
    border-color: color-mix(in srgb, var(--n0) 15%, transparent);
}

[data-theme="dark"] .auth-captcha-row__canvas {
    border-color: color-mix(in srgb, var(--n0) 15%, transparent);
}

[data-theme="dark"] .auth-otp-input {
    background: color-mix(in srgb, var(--n800) 60%, transparent);
    border-color: color-mix(in srgb, var(--n0) 15%, transparent);
    color: var(--text);
}

[data-theme="dark"] .auth-btn {
    background: var(--brand-primary-light);
    color: var(--n0);
}

[data-theme="dark"] .auth-btn:hover {
    background: var(--brand-primary);
}

[data-theme="dark"] .auth-input--disabled {
    background: color-mix(in srgb, var(--n0) 6%, transparent);
    color: var(--auth-text-muted);
}

/* ==========================================================
   RTL
   ========================================================== */
[dir="rtl"] .auth-modal__header {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-input-group {
    text-align: right;
}

[dir="rtl"] .auth-input {
    text-align: right;
}

[dir="rtl"] .auth-select {
    background-position: left 16px center;
    padding: 0 20px 0 36px;
}

[dir="rtl"] .auth-captcha-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-captcha-row__canvas {
    border-right: none;
    border-left: 1px solid var(--auth-input-border);
}

[dir="rtl"] .auth-captcha-row__refresh {
    border-left: none;
    border-right: 1px solid var(--auth-input-border);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 560px) {
    .auth-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 20px;
        padding: 20px 20px 24px;
    }

    .auth-modal__blur-circle {
        width: 200px;
        height: 200px;
    }

    .auth-modal__decor--bg {
        width: 300px;
        height: 260px;
    }

    .auth-modal__title {
        font-size: 24px;
        line-height: 32px;
    }

    .auth-otp-container {
        gap: 12px;
    }

    .auth-otp-input {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .auth-row {
        gap: 10px;
    }

    .auth-input-label {
        font-size: 13px;
    }
}

/* ==========================================================
   LOGIN REQUIRED PAGE â€” shown when unauthenticated user
   accesses a protected service page
   ========================================================== */

.login-required {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 40px 20px;
    background: var(--bg-primary, var(--bg));
}

.login-required__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 460px;
    padding: 56px 44px;
    background: var(--bg-primary, var(--bg));
    border: 1px solid color-mix(in srgb, var(--n900) 6%, transparent);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}

.login-required__icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--brand-primary) 6%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.login-required__title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary, var(--text));
    margin: 0 0 12px;
    letter-spacing: -0.3px;
}

.login-required__text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary, var(--text-muted));
    margin: 0 0 36px;
    max-width: 340px;
}

.login-required__actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.login-required__btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.login-required__btn--primary {
    background: var(--brand-primary);
    color: var(--n0);
}

.login-required__btn--primary:hover {
    background: var(--brand-primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.login-required__btn--secondary {
    background: var(--bg-secondary, var(--surface));
    color: var(--text-primary, var(--text));
    border: 1px solid color-mix(in srgb, var(--n900) 8%, transparent);
}

.login-required__btn--secondary:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 4%, transparent);
}

.login-required__home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, var(--text-muted));
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-required__home:hover {
    color: var(--brand-primary);
}

/* Dark mode */
[data-theme="dark"] .login-required {
    background: var(--bg-primary);
}

[data-theme="dark"] .login-required__card {
    background: var(--bg-secondary);
    border-color: color-mix(in srgb, var(--n0) 8%, transparent);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .login-required__icon {
    background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

[data-theme="dark"] .login-required__btn--primary {
    background: var(--brand-primary-light);
}

[data-theme="dark"] .login-required__btn--primary:hover {
    background: var(--brand-primary);
}

[data-theme="dark"] .login-required__btn--secondary {
    background: color-mix(in srgb, var(--n0) 6%, transparent);
    border-color: color-mix(in srgb, var(--n0) 10%, transparent);
    color: var(--text-primary);
}

[data-theme="dark"] .login-required__btn--secondary:hover {
    border-color: var(--brand-primary-light);
    color: var(--brand-primary-lighter);
    background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}

[data-theme="dark"] .login-required__home {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 480px) {
    .login-required__card {
        padding: 36px 24px;
    }

    .login-required__actions {
        flex-direction: column;
    }

    .login-required__title {
        font-size: 22px;
    }
}

/* ==========================================================
   MUDBLAZOR OVERRIDES — Auth glass modal context
   ========================================================== */

/* Input control spacing & stacking — compact for auth */
.auth-modal .mud-input-control {
    position: relative;
    z-index: 2;
    margin-top: 0;
    margin-bottom: 0;
}

.auth-modal .mud-input-control-input-container {
    margin-top: 0 !important;
}

/* Outlined input — glass background & border */
.auth-modal .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--auth-input-border);
    border-radius: var(--auth-input-radius);
}

.auth-modal .mud-input.mud-input-outlined {
    border-radius: var(--auth-input-radius);
    background: var(--auth-input-bg);
}

/* Input text — white on glass */
.auth-modal .mud-input-slot.mud-input-root {
    color: var(--auth-input-text) !important;
}

/* Placeholder — muted white on glass */
.auth-modal .mud-input-root-outlined::placeholder {
    color: var(--auth-input-placeholder) !important;
}

/* Adornment icon — visible on glass */
.auth-modal .mud-input-adornment-start .mud-icon-root {
    color: var(--auth-text-muted) !important;
}

/* Label — white on glass with text shadow for readability */
.auth-modal .mud-input-label {
    color: var(--auth-text-primary) !important;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.auth-modal .mud-input-label-inputcontrol {
    color: var(--auth-text-primary) !important;
}

/* Helper text (e.g. "10/10" counter) — light on glass */
.auth-modal .mud-input-helper-text {
    color: var(--auth-text-muted) !important;
}

/* Focus state */
.auth-modal .mud-input-outlined.mud-focused .mud-input-outlined-border {
    border-color: var(--brand-green) !important;
    box-shadow: var(--shadow-md);
}

/* Hover state */
.auth-modal .mud-input-outlined:hover:not(.mud-disabled) .mud-input-outlined-border {
    border-color: var(--brand-green);
}

/* Error state */
.auth-modal .mud-input-error .mud-input-outlined-border {
    border-color: var(--auth-error) !important;
}

.auth-modal .mud-input-helper-text.mud-input-error {
    color: var(--auth-error);
    font-size: 13px;
}

/* Adornment icon — password toggle */
.auth-modal .mud-input-adornment-end .mud-icon-button {
    color: var(--auth-text-muted);
}

.auth-modal .mud-input-adornment-end .mud-icon-button:hover {
    color: var(--auth-text-primary);
}

/* Primary button — glass-themed CTA */
.auth-modal .auth-mud-btn.mud-button-root {
    height: 46px;
    border-radius: var(--auth-btn-radius) !important;
    background: var(--brand-primary) !important;
    color: var(--n0) !important;
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
    position: relative;
    z-index: 2;
    text-transform: none;
    letter-spacing: 0.01em;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal .auth-mud-btn.mud-button-root:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-modal .auth-mud-btn.mud-button-root:active {
    transform: translateY(0);
}

.auth-modal .auth-mud-btn.mud-button-root.mud-disabled {
    opacity: 0.5;
    transform: none;
}

/* Button spinner */
.auth-mud-btn__spinner {
    color: var(--n0) !important;
}

/* Dark mode — MudBlazor inputs inherit auth tokens (already glass-compatible) */
[data-theme="dark"] .auth-modal .mud-input.mud-input-outlined {
    background: var(--auth-input-bg);
}

[data-theme="dark"] .auth-modal .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--auth-input-border);
}

[data-theme="dark"] .auth-modal .mud-input-slot.mud-input-root {
    color: var(--auth-input-text) !important;
}

[data-theme="dark"] .auth-modal .auth-mud-btn.mud-button-root {
    background: var(--brand-primary-light) !important;
    color: var(--n0) !important;
}

[data-theme="dark"] .auth-modal .auth-mud-btn.mud-button-root:hover {
    background: var(--brand-primary) !important;
}

/* ==========================================================
   AUTH CARD — Login page specific components
   ========================================================== */

/* Brand icon badge — identity anchor above title */
.auth-card__icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand-primary) 25%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 50%, transparent);
    margin: 0 auto 8px;
    position: relative;
    z-index: 2;
    color: var(--auth-text-primary);
}

.auth-card__icon-badge .mud-icon-root {
    font-size: 30px;
}

/* Footer links group with subtle separator */
.auth-card__links {
    position: relative;
    z-index: 2;
    padding-top: 2px;
}

