/* Roomado Admin – sign-in pages (used only by _AuthLayout). */

:root {
    --auth-font: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --auth-bg: #f5f7fb;
    --auth-surface: #ffffff;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-border-strong: #cbd5e1;
    --auth-accent: #4f46e5;
    --auth-accent-2: #7c3aed;
    --auth-accent-soft: rgba(79, 70, 229, .12);
    --auth-danger: #dc2626;
    --auth-success: #16a34a;
    --auth-warn-bg: #fffbeb;
    --auth-warn-border: #fcd34d;
    --auth-warn-text: #92400e;
    --auth-radius: 14px;
    --auth-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .18);
}

[data-bs-theme="dark"] {
    --auth-bg: #0b1020;
    --auth-surface: #111827;
    --auth-text: #e5e7eb;
    --auth-muted: #94a3b8;
    --auth-border: #1f2937;
    --auth-border-strong: #334155;
    --auth-accent: #818cf8;
    --auth-accent-2: #a78bfa;
    --auth-accent-soft: rgba(129, 140, 248, .16);
    --auth-danger: #f87171;
    --auth-success: #4ade80;
    --auth-warn-bg: rgba(250, 204, 21, .08);
    --auth-warn-border: rgba(250, 204, 21, .35);
    --auth-warn-text: #fde68a;
    --auth-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
}

html, body.auth-body {
    min-height: 100%;
}

body.auth-body {
    margin: 0;
    font-family: var(--auth-font);
    background: var(--auth-bg);
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- Brand panel ---------- */

.auth-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(1200px 600px at -10% -10%, rgba(255, 255, 255, .18), transparent 60%),
        radial-gradient(800px 500px at 110% 110%, rgba(236, 72, 153, .35), transparent 60%),
        linear-gradient(135deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
}

/* Soft grid texture */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}

/* Floating glow */
.auth-brand::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -120px;
    top: 18%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%);
    filter: blur(10px);
    animation: auth-float 14s ease-in-out infinite;
}

@keyframes auth-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-40px, 30px); }
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    height: 100%;
    padding: clamp(2rem, 5vw, 4rem);
}

.auth-hero {
    margin-top: auto;
    max-width: 30rem;
}

.auth-hero h1 {
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.025em;
    margin: 0 0 1rem;
    color: #fff;
}

.auth-hero p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .8);
    margin: 0;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .75rem;
    max-width: 30rem;
}

.auth-features li {
    display: flex;
    gap: .9rem;
    align-items: center;
    padding: .85rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-features strong {
    display: block;
    font-weight: 600;
    font-size: .95rem;
}

.auth-features span:not(.auth-feature-icon) {
    display: block;
    font-size: .85rem;
    color: rgba(255, 255, 255, .72);
}

.auth-feature-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    font-size: 1.25rem;
}

.auth-brand-foot {
    margin: auto 0 0;
    font-size: .85rem;
    color: rgba(255, 255, 255, .6);
}

/* ---------- Logo ---------- */

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -.01em;
}

.auth-logo-mark {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    font-size: 1.35rem;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-2));
    box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6);
}

.auth-logo-light .auth-logo-mark {
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

.auth-logo-sub {
    font-weight: 500;
    opacity: .7;
}

.auth-logo-compact {
    display: none;
    margin-bottom: 2rem;
    color: var(--auth-text);
}

/* ---------- Form panel ---------- */

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(1.5rem, 4vw, 3rem) 1rem;
    background: var(--auth-bg);
}

.auth-panel-inner {
    width: 100%;
    max-width: 25rem;
    margin: auto 0;
    animation: auth-rise .45s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.auth-panel-foot {
    margin: 2rem 0 0;
    font-size: .8rem;
    color: var(--auth-muted);
    text-align: center;
}

.auth-head {
    margin-bottom: 1.75rem;
}

.auth-step {
    display: inline-block;
    margin-bottom: .9rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--auth-accent);
    background: var(--auth-accent-soft);
}

.auth-head h2 {
    margin: 0 0 .5rem;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--auth-text);
}

.auth-head p {
    margin: 0;
    color: var(--auth-muted);
    line-height: 1.55;
}

.auth-dest {
    color: var(--auth-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.auth-form .form-label {
    font-weight: 600;
    font-size: .875rem;
    color: var(--auth-text);
    margin-bottom: .45rem;
}

/* Combined country code + identifier field */
.auth-field {
    display: flex;
    align-items: stretch;
    height: 3.25rem;
    border-radius: 12px;
    background: var(--auth-surface);
    border: 1.5px solid var(--auth-border-strong);
    transition: border-color .15s, box-shadow .15s;
}

.auth-field:focus-within {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px var(--auth-accent-soft);
}

.auth-cc {
    display: flex;
    align-items: center;
    padding-left: .9rem;
    border-right: 1.5px solid var(--auth-border);
    color: var(--auth-muted);
    font-weight: 600;
}

.auth-cc input {
    width: 3rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--auth-text);
    font: inherit;
    font-weight: 600;
    padding: 0 .4rem 0 .15rem;
}

.auth-field .auth-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 1rem;
    font-size: 1.05rem;
    color: var(--auth-text);
}

/* Single identifier field (email or mobile) */
.auth-form > .auth-input {
    display: block;
    width: 100%;
    height: 3.25rem;
    padding: 0 1rem;
    border-radius: 12px;
    border: 1.5px solid var(--auth-border-strong);
    background: var(--auth-surface);
    color: var(--auth-text);
    font: inherit;
    font-size: 1.05rem;
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}

.auth-form > .auth-input:hover {
    border-color: var(--auth-muted);
}

.auth-form > .auth-input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px var(--auth-accent-soft);
}

.auth-form > .auth-input.input-validation-error {
    border-color: var(--auth-danger);
}

.auth-form > .auth-input.input-validation-error:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .15);
}

/* Keep browser autofill on theme */
.auth-input:-webkit-autofill {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 100px var(--auth-surface) inset;
    caret-color: var(--auth-text);
}

.auth-input::placeholder,
.auth-cc input::placeholder {
    color: var(--auth-muted);
    opacity: .6;
}

.auth-hint {
    margin: .5rem 0 0;
    font-size: .8rem;
    color: var(--auth-muted);
}

/* Code input without JavaScript */
.auth-code {
    display: block;
    width: 100%;
    height: 3.5rem;
    border-radius: 12px;
    border: 1.5px solid var(--auth-border-strong);
    background: var(--auth-surface);
    color: var(--auth-text);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: .6em;
    outline: 0;
    font-variant-numeric: tabular-nums;
}

.auth-code:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px var(--auth-accent-soft);
}

/* Six boxes (built by auth.js) */
.auth-otp {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .6rem;
}

.auth-otp-box {
    width: 100%;
    aspect-ratio: 1 / 1.15;
    max-height: 4rem;
    border-radius: 12px;
    border: 1.5px solid var(--auth-border-strong);
    background: var(--auth-surface);
    color: var(--auth-text);
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    caret-color: var(--auth-accent);
    outline: 0;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.auth-otp-box:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px var(--auth-accent-soft);
    transform: translateY(-1px);
}

.auth-otp.is-complete .auth-otp-box {
    border-color: var(--auth-success);
}

.auth-otp.is-invalid .auth-otp-box {
    border-color: var(--auth-danger);
    animation: auth-shake .35s;
}

@keyframes auth-shake {
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Submit */
.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    height: 3.25rem;
    margin-top: 1.5rem;
    border: 0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    /* Same deep gradient in both themes so the white label stays readable. */
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 10px 24px -10px rgba(79, 70, 229, .7);
    transition: transform .15s, box-shadow .15s, filter .15s;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 14px 28px -10px rgba(79, 70, 229, .8);
}

.auth-submit:active:not(:disabled) {
    transform: none;
}

.auth-submit .ti {
    font-size: 1.15rem;
    transition: transform .15s;
}

.auth-submit:hover .ti {
    transform: translateX(3px);
}

.auth-submit.is-busy .ti {
    display: none;
}

.auth-submit.is-busy::after {
    content: "";
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    animation: auth-spin .7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.auth-alert,
.auth-panel-inner > .alert {
    border-radius: 12px;
    font-size: .9rem;
}

.validation-summary-valid.auth-alert {
    display: none;
}

.auth-alert ul {
    margin: 0;
    padding-left: 1rem;
}

.auth-testcode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-bottom: 1.5rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    border: 1px dashed var(--auth-warn-border);
    background: var(--auth-warn-bg);
    color: var(--auth-warn-text);
    font-size: .85rem;
}

.auth-testcode code {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: .25em;
    color: inherit;
    background: transparent;
    padding: 0;
}

/* Secondary links */
.auth-secondary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-top: 1.25rem;
}

.auth-secondary form {
    margin: 0;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: .9rem;
    font-weight: 500;
    color: var(--auth-accent);
    text-decoration: none;
    cursor: pointer;
}

.auth-link:hover:not(:disabled) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-link:disabled {
    color: var(--auth-muted);
    cursor: default;
    font-variant-numeric: tabular-nums;
}

.auth-note {
    margin: 1.75rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-border);
    font-size: .82rem;
    color: var(--auth-muted);
    text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-brand {
        display: none;
    }

    .auth-logo-compact {
        display: inline-flex;
    }

    .auth-panel {
        justify-content: flex-start;
        padding: 3rem 1rem 1.5rem;
        background:
            radial-gradient(600px 300px at 50% -80px, var(--auth-accent-soft), transparent 70%),
            var(--auth-bg);
    }
}

@media (max-width: 400px) {
    .auth-otp {
        gap: .4rem;
    }

    .auth-head h2 {
        font-size: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
