.auth-page { background: linear-gradient(135deg, #f7f9fc 0%, #eaf1fa 100%); }
.auth-card { max-width: 460px; padding: 2.25rem; border: 1px solid #dce5f0; border-radius: 1rem; box-shadow: 0 24px 60px rgba(20, 33, 61, .12); }
.auth-card .form-control { border-color: #d8e0e9; border-radius: .6rem; padding: .75rem 1rem; font-size: 1rem; }
.auth-card .form-control:focus { border-color: #1859b7; box-shadow: 0 0 0 .2rem rgba(24, 89, 183, .12); }
.auth-card .auth-mobile::placeholder { color: #c3cad5; opacity: 1; font-weight: 400; }
@media (max-width: 575.98px) { .auth-card { padding: 1.5rem; } }
.otp-group { display: flex; justify-content: center; gap: .5rem; }
.otp-group .otp-digit {
    width: 3.25rem;
    max-width: 100%;
    padding: .75rem .25rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    caret-color: #1859b7;
}
.otp-group .otp-digit::-webkit-outer-spin-button,
.otp-group .otp-digit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Invalid code: colour the boxes and shake the row — no per-input Bootstrap icon. */
.otp-group--invalid .otp-digit {
    border-color: #b43b45;
    background-color: #fff8f8;
}
.otp-group--invalid .otp-digit:focus {
    border-color: #b43b45;
    box-shadow: 0 0 0 .2rem rgba(180, 59, 69, .15);
}
.otp-group--invalid { animation: otp-shake .4s cubic-bezier(.36, .07, .19, .97) both; }

@keyframes otp-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

@media (prefers-reduced-motion: reduce) {
    .otp-group--invalid { animation: none; }
}
@media (max-width: 400px) {
    .otp-group { gap: .35rem; }
    .otp-group .otp-digit { width: 2.75rem; font-size: 1.25rem; padding: .6rem .2rem; }
}

.auth-alert {
    --alert-accent: #187454;
    --alert-surface: #f0faf5;
    --alert-border: #cee9db;
    --alert-icon: #dff2e8;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--alert-border);
    border-inline-start: 3px solid var(--alert-accent);
    border-radius: .85rem;
    background: var(--alert-surface);
    text-align: start;
}
.auth-alert--error {
    --alert-accent: #b43b45;
    --alert-surface: #fff5f5;
    --alert-border: #f2d7da;
    --alert-icon: #fbe4e7;
}
.auth-alert__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    margin-top: .125rem;
    border-radius: 50%;
    background: var(--alert-icon);
    color: var(--alert-accent);
}
.auth-alert__content { min-width: 0; padding-top: .125rem; }
.auth-alert__title { margin: 0 0 .35rem; color: var(--alert-accent); font-size: .875rem; font-weight: 700; line-height: 1.5; }
.auth-alert__message { margin: 0; color: #475569; font-size: .8125rem; line-height: 1.6; overflow-wrap: anywhere; }

/* Floating toast variant */
.auth-alert--toast {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    width: calc(100% - 2rem);
    max-width: 420px;
    margin-top: 0;
    box-shadow: 0 18px 44px rgba(20, 33, 61, .18);
    animation: auth-toast-in .28s cubic-bezier(.16, 1, .3, 1) both;
}
.auth-alert--toast.is-leaving {
    animation: auth-toast-out .24s ease-in both;
}
.auth-alert__close {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-inline-start: auto;
    padding: .25rem;
    border: 0;
    border-radius: .35rem;
    background: transparent;
    color: #94a3b8;
    line-height: 0;
    cursor: pointer;
}
.auth-alert__close:hover { color: #475569; background: rgba(148, 163, 184, .16); }
.auth-alert__close:focus-visible { outline: 2px solid var(--alert-accent); outline-offset: 1px; }

@keyframes auth-toast-in {
    from { opacity: 0; transform: translate(-50%, -14px) scale(.97); }
    to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes auth-toast-out {
    from { opacity: 1; transform: translate(-50%, 0) scale(1); }
    to   { opacity: 0; transform: translate(-50%, -10px) scale(.97); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-alert--toast, .auth-alert--toast.is-leaving { animation-duration: .01ms; }
}

/* Error pages (404, 500) */
.error-card { max-width: 520px; }
.error-art { position: relative; width: fit-content; }
.error-code {
    display: inline-flex;
    align-items: center;
    gap: .15em;
    font-size: clamp(4.5rem, 18vw, 6.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--sms-dark);
}
.error-bubble {
    display: inline-grid;
    place-items: center;
    width: .95em;
    height: .95em;
    border-radius: 50%;
    background: #eaf1fa;
    color: var(--sms-primary);
    animation: error-float 3.2s ease-in-out infinite;
}
.error-bubble svg { width: 62%; height: 62%; }
.error-bubble.is-warning { background: #fef0c7; color: #dc6803; }
.error-signal {
    position: absolute;
    inset-inline-start: 50%;
    bottom: -.65rem;
    width: 3.5rem;
    height: .35rem;
    border-radius: 50%;
    background: rgba(20, 33, 61, .1);
    transform: translateX(50%);
    animation: error-shadow 3.2s ease-in-out infinite;
}
@keyframes error-float {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-10px) rotate(4deg); }
}
@keyframes error-shadow {
    0%, 100% { opacity: 1; transform: translateX(50%) scale(1); }
    50% { opacity: .5; transform: translateX(50%) scale(.75); }
}
@media (prefers-reduced-motion: reduce) {
    .error-bubble, .error-signal { animation: none; }
}
