/* ============================================================
   SMS PRO — Professional Login Page (single column, no sidebar)
   Styles are scoped via body:has(.fi-simple-layout) (the Filament
   auth layout wrapper) so they persist across Livewire validation
   re-renders, and do not depend on a badge that may disappear when
   routeIs fails during Livewire AJAX.
   ============================================================ */

body:has(.fi-simple-layout) {
    position: relative;
    background:
        radial-gradient(circle at 88% 82%, rgba(29, 78, 216, 0.10), transparent 42%),
        linear-gradient(160deg, #f0f7ff 0%, #eff6ff 45%, #dbeafe 100%);
    background-attachment: fixed;
}

body:has(.fi-simple-layout)::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(37, 99, 235, 0.09) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.55), transparent 68%);
    mask-image: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.55), transparent 68%);
    pointer-events: none;
    z-index: 0;
}

body:has(.fi-simple-layout) .fi-simple-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background: transparent;
}

body:has(.fi-simple-layout) .fi-simple-main-ctn {
    position: relative;
    padding-block: 2rem;
}

/* ── The login card itself ──────────────────────────────────────── */
body:has(.fi-simple-layout) .fi-simple-main {
    position: relative;
    z-index: 1;
    overflow: hidden;
    max-width: 27.5rem !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px);
    border: 1px solid rgba(37, 99, 235, 0.08) !important;
    border-radius: 1.5rem !important;
    box-shadow:
        0 30px 60px -25px rgba(30, 58, 138, 0.28),
        0 8px 20px -8px rgba(15, 23, 42, 0.08) !important;
    padding: 1.625rem 2rem 0.625rem !important;
    margin-block: 0.75rem !important;
}

/* Compress vertical rhythm so the card is shorter */
body:has(.fi-simple-layout) .fi-simple-main > section {
    gap: 0.625rem;
}

body:has(.fi-simple-layout) .fi-form {
    gap: 0.625rem;
}

/* Actual gap between form fields (email/password/remember/captcha) */
body:has(.fi-simple-layout) .fi-form .fi-fo-component-ctn {
    gap: 0.75rem;
}

/* Slightly smaller brand logo to save vertical space */
body:has(.fi-simple-layout) .fi-logo svg {
    width: 44px;
    height: 44px;
}

body:has(.fi-simple-layout) .fi-logo,
body:has(.fi-simple-layout) .fi-simple-header > *:first-child {
    margin-bottom: 0.875rem;
}

body:has(.fi-simple-layout) .fi-simple-main::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 5px;
    background: linear-gradient(90deg, #1e3a8a, #2563eb, #60a5fa, #2563eb, #1e3a8a);
}

/* ── Header: logo + heading ─────────────────────────────────────── */
body:has(.fi-simple-layout) .fi-simple-header {
    margin-bottom: 0.5rem;
}

body:has(.fi-simple-layout) .fi-simple-header-heading {
    font-size: 0.9375rem;
    font-weight: 700;
    background: linear-gradient(120deg, #1e3a8a, #2563eb 60%, #1d4ed8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dark body:has(.fi-simple-layout) .fi-simple-header-heading {
    background: linear-gradient(120deg, #93c5fd, #60a5fa 60%, #bfdbfe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body:has(.fi-simple-layout) .fi-simple-header-subheading {
    font-size: 0.8125rem;
}

/* ── Portal badge chip ──────────────────────────────────────────── */
.able-login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 auto;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: linear-gradient(120deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.dark .able-login-badge {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
    border-color: rgba(37, 99, 235, 0.3);
}

.able-login-badge__icon {
    display: inline-flex;
    width: 0.9rem;
    height: 0.9rem;
}

.able-login-badge__icon svg {
    width: 100%;
    height: 100%;
}

/* ── Inputs ──────────────────────────────────────────────────────── */
body:has(.fi-simple-layout) .fi-fo-field-wrp .fi-input-wrp {
    border-radius: 0.75rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

body:has(.fi-simple-layout) .fi-fo-field-wrp .fi-input-wrp:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

/* ── Captcha field ───────────────────────────────────────────────── */
body:has(.fi-simple-layout) [id="login-captcha"] {
    letter-spacing: 0.05em;
}

body:has(.fi-simple-layout) .fi-fo-field-wrp:has([id="login-captcha"]) {
    padding: 0.75rem 0.875rem;
    border: 1px dashed rgba(37, 99, 235, 0.35);
    border-radius: 0.75rem;
    background: rgba(254, 242, 242, 0.6);
}

.dark body:has(.fi-simple-layout) .fi-fo-field-wrp:has([id="login-captcha"]) {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.3);
}

/* ── Submit button ───────────────────────────────────────────────── */
body:has(.fi-simple-layout) .fi-form-actions .fi-btn {
    background: linear-gradient(120deg, #2563eb, #1d4ed8) !important;
    border: none !important;
    box-shadow: 0 12px 24px -10px rgba(37, 99, 235, 0.55) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body:has(.fi-simple-layout) .fi-form-actions .fi-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px -10px rgba(37, 99, 235, 0.6) !important;
}

/* ── Member/Client toggle link footer ───────────────────────────── */
body:has(.fi-simple-layout) .auth-login-panel-hint {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(15, 23, 42, 0.08);
}

.dark body:has(.fi-simple-layout) .auth-login-panel-hint {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ── Dark mode ───────────────────────────────────────────────────── */
.dark body:has(.fi-simple-layout) {
    background:
        radial-gradient(circle at 88% 82%, rgba(29, 78, 216, 0.12), transparent 42%),
        linear-gradient(160deg, #0f172a 0%, #171a2b 50%, #1f1520 100%);
}

.dark body:has(.fi-simple-layout) .fi-simple-main {
    background: rgba(17, 24, 39, 0.88) !important;
    border-color: rgba(37, 99, 235, 0.14) !important;
    box-shadow:
        0 30px 60px -25px rgba(0, 0, 0, 0.55),
        0 8px 20px -8px rgba(0, 0, 0, 0.35) !important;
}

/* ── Responsive tweaks ───────────────────────────────────────────── */
@media (max-width: 480px) {
    body:has(.fi-simple-layout) .fi-simple-main {
        border-radius: 1.125rem !important;
    }
}
