/* =============================================================================
   AdminLite - premium authentication screens
   -----------------------------------------------------------------------------
   All colours / radii / backgrounds are driven by CSS custom properties that are
   generated in App\Support\LoginAppearance and injected by layouts/auth.blade.php
   (and by the Appearance settings preview). Fallbacks below are the factory look.
   ========================================================================== */

.auth-body {
    display: block;
    min-height: 100vh;
    margin: 0;
    background: #0b1120;
}

.auth-page {
    --auth-page-bg: linear-gradient(135deg, #312e81 0%, #0ea5e9 100%);
    --auth-card-bg: rgba(255, 255, 255, .82);
    --auth-card-border: rgba(255, 255, 255, .45);
    --auth-card-blur: 18px;
    --auth-card-radius: 24px;
    --auth-card-width: 440px;
    --auth-card-pad: 36px;
    --auth-card-shadow: 0 28px 60px -28px rgba(2, 6, 23, .55);
    --auth-heading: #0f172a;
    --auth-text: #334155;
    --auth-muted: #64748b;
    --auth-accent: #4f46e5;
    --auth-accent-ring: rgba(79, 70, 229, .18);
    --auth-accent-soft: rgba(79, 70, 229, .12);
    --auth-btn-from: #4f46e5;
    --auth-btn-to: #7c3aed;
    --auth-btn-text: #ffffff;
    --auth-btn-radius: 14px;
    --auth-btn-glow: rgba(79, 70, 229, .45);
    --auth-btn-shadow: 0 16px 30px -14px rgba(79, 70, 229, .55);
    --auth-input-bg: #f8fafc;
    --auth-input-border: #e2e8f0;
    --auth-input-text: #0f172a;
    --auth-input-radius: 14px;
    --auth-page-fg: #ffffff;
    --auth-page-fg-soft: rgba(255, 255, 255, .78);
    --auth-page-fg-faint: rgba(255, 255, 255, .62);
    --auth-danger: #b91c1c;
    --auth-danger-bg: rgba(220, 38, 38, .10);
    --auth-danger-border: rgba(220, 38, 38, .28);

    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100svh;
    padding: clamp(1.5rem, 4vw, 3rem) 1.25rem;
    isolation: isolate;
    overflow: hidden;
    background: var(--auth-page-bg);
    color: var(--auth-text);
    font-family: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Decorative light orbs ------------------------------------------------------ */
.auth-orb {
    position: absolute;
    z-index: -1;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.auth-orb-1 {
    width: min(52vw, 720px);
    top: -18%;
    left: -12%;
    background: radial-gradient(circle at center, var(--auth-accent-soft) 0%, transparent 68%);
}

.auth-orb-2 {
    width: min(46vw, 620px);
    right: -14%;
    bottom: -24%;
    background: radial-gradient(circle at center, var(--auth-btn-glow) 0%, transparent 70%);
    opacity: .55;
}

/* Shell ---------------------------------------------------------------------- */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    max-width: var(--auth-card-width);
    margin-inline: auto;
}

/* Card ----------------------------------------------------------------------- */
.auth-card {
    position: relative;
    width: min(var(--auth-card-width), 100%);
    max-width: 100%;
    padding: var(--auth-card-pad);
    overflow: hidden;
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-card-radius);
    background: var(--auth-card-bg);
    box-shadow: var(--auth-card-shadow);
    color: var(--auth-text);
    -webkit-backdrop-filter: blur(var(--auth-card-blur));
    backdrop-filter: blur(var(--auth-card-blur));
    animation: auth-rise .55s cubic-bezier(.22, 1, .36, 1) both;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-btn-from), var(--auth-btn-to));
    opacity: .9;
}

.auth-card-head {
    margin-bottom: 1.6rem;
}

.auth-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 1rem;
    padding: .62rem;
    border: 1px solid var(--auth-card-border);
    border-radius: 16px;
    background: var(--auth-accent-soft);
}

.auth-logo-badge img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--auth-accent);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.auth-eyebrow::before {
    content: '';
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: .55;
}

.auth-title {
    margin: .45rem 0 .35rem;
    color: var(--auth-heading);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.auth-subtitle {
    margin: 0;
    color: var(--auth-muted);
    font-size: .94rem;
    line-height: 1.5;
}

/* Form ----------------------------------------------------------------------- */
.auth-form {
    display: grid;
    gap: 1.05rem;
}

.auth-field {
    display: grid;
    gap: .4rem;
}

.auth-label {
    color: var(--auth-text);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.auth-control {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-control-icon {
    position: absolute;
    left: 15px;
    color: var(--auth-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color .18s ease;
}

.auth-input {
    width: 100%;
    height: 50px;
    padding: 0 1rem 0 2.85rem;
    border: 1px solid var(--auth-input-border);
    border-radius: var(--auth-input-radius);
    background: var(--auth-input-bg);
    color: var(--auth-input-text);
    font: inherit;
    font-size: .95rem;
    appearance: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.auth-input::placeholder {
    color: var(--auth-muted);
    opacity: .72;
}

.auth-input:hover {
    border-color: var(--auth-accent-ring);
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px var(--auth-accent-ring);
}

.auth-input.has-action {
    padding-right: 3rem;
}

.auth-control:focus-within .auth-control-icon {
    color: var(--auth-accent);
}

.auth-input.is-invalid {
    border-color: var(--auth-danger);
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-input-text);
    transition: background-color 9999s ease-out 0s;
}

.auth-control-action {
    position: absolute;
    right: 8px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--auth-muted);
    font-size: .95rem;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.auth-control-action:hover {
    background: var(--auth-accent-soft);
    color: var(--auth-accent);
}

.auth-control-action:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 1px;
}

.auth-error {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    color: var(--auth-danger);
    font-size: .8rem;
    font-weight: 500;
}

.auth-caps {
    display: none;
    align-items: center;
    gap: .35rem;
    margin: 0;
    color: var(--auth-danger);
    font-size: .75rem;
}

.auth-caps.is-visible {
    display: inline-flex;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .1rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--auth-text);
    font-size: .85rem;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid var(--auth-input-border);
    border-radius: 6px;
    background: var(--auth-input-bg);
    cursor: pointer;
    appearance: none;
    transition: background-color .16s ease, border-color .16s ease;
}

.auth-check input::after {
    content: '';
    width: 4px;
    height: 8px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(42deg) scale(0);
    transition: transform .16s ease;
}

.auth-check input:checked {
    border-color: var(--auth-accent);
    background: var(--auth-accent);
}

.auth-check input:checked::after {
    transform: rotate(42deg) scale(1);
}

.auth-check input:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
}

.auth-link {
    border-radius: 4px;
    color: var(--auth-accent);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--auth-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-link:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 3px;
}

/* Primary button ------------------------------------------------------------- */
.auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 100%;
    height: 50px;
    margin-top: .35rem;
    padding: 0 1.2rem;
    overflow: hidden;
    border: 0;
    border-radius: var(--auth-btn-radius);
    background-image: linear-gradient(135deg, var(--auth-btn-from), var(--auth-btn-to));
    box-shadow: var(--auth-btn-shadow);
    color: var(--auth-btn-text);
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.auth-btn > i {
    font-size: .95rem;
    transition: transform .18s ease;
}

.auth-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .3) 48%, transparent 64%);
    transform: translateX(-120%);
    transition: transform .65s ease;
    pointer-events: none;
}

.auth-btn:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.auth-btn:hover > i {
    transform: translateX(3px);
}

.auth-btn:hover::after {
    transform: translateX(120%);
}

.auth-btn:active {
    transform: translateY(0) scale(.997);
}

.auth-btn:focus-visible {
    outline: 3px solid var(--auth-accent-ring);
    outline-offset: 3px;
}

.auth-btn-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

.auth-btn.is-loading {
    pointer-events: none;
}

.auth-btn.is-loading > span:first-child {
    opacity: .6;
}

.auth-btn.is-loading .auth-btn-spinner {
    display: inline-block;
}

/* Alerts / helpers ----------------------------------------------------------- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-bottom: 1.1rem;
    padding: .7rem .85rem;
    border: 1px solid;
    border-radius: 12px;
    font-size: .83rem;
    line-height: 1.45;
}

.auth-alert i {
    margin-top: .1rem;
}

.auth-alert-danger {
    border-color: var(--auth-danger-border);
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
}

.auth-alert-success {
    border-color: rgba(16, 185, 129, .28);
    background: rgba(16, 185, 129, .10);
    color: #047857;
}

.auth-switch {
    margin: .9rem 0 0;
    color: var(--auth-muted);
    font-size: .85rem;
    text-align: center;
}

.auth-page-footer {
    max-width: 40ch;
    margin: 0;
    color: var(--auth-page-fg-soft);
    font-size: .78rem;
    line-height: 1.5;
    text-align: center;
}

.auth-page-footer-soft {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--auth-page-fg-faint);
}

/* Preview banner ------------------------------------------------------------- */
.auth-banner {
    position: fixed;
    top: 14px;
    left: 50%;
    z-index: 20;
    transform: translateX(-50%);
}

.auth-banner-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .95rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(15, 23, 42, .74);
    box-shadow: 0 12px 30px -18px rgba(2, 6, 23, .9);
    color: #fff;
    font-size: .78rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.auth-banner-pill a {
    color: #fff;
    font-weight: 600;
    text-underline-offset: 3px;
}

/* Appearance settings - mini preview ---------------------------------------- */
.auth-preview {
    position: relative;
    display: grid;
    place-items: center;
    height: 470px;
    min-height: 0;
    padding: 18px;
    overflow: hidden;
    border-radius: 16px;
}

.auth-preview .auth-orb {
    display: none;
}

.auth-preview .auth-card {
    width: 100%;
    max-width: 320px;
    padding: 22px;
    animation: none;
}

.auth-preview .auth-card::before {
    height: 2px;
}

.auth-preview .auth-card-head {
    margin-bottom: 1.1rem;
}

.auth-preview .auth-logo-badge {
    width: 40px;
    height: 40px;
    margin-bottom: .6rem;
    padding: .45rem;
    border-radius: 12px;
}

.auth-preview .auth-eyebrow {
    font-size: .58rem;
}

.auth-preview .auth-title {
    margin: .3rem 0 .2rem;
    font-size: 1.2rem;
}

.auth-preview .auth-subtitle {
    font-size: .78rem;
}

.auth-preview .auth-form {
    gap: .7rem;
}

.auth-preview .auth-label {
    font-size: .68rem;
}

.auth-preview .auth-input {
    height: 40px;
    padding-left: 2.45rem;
    font-size: .8rem;
}

.auth-preview .auth-control-icon {
    left: 12px;
    font-size: .85rem;
}

.auth-preview .auth-control-action {
    width: 28px;
    height: 28px;
    right: 6px;
    font-size: .8rem;
}

.auth-preview .auth-btn {
    height: 40px;
    margin-top: .2rem;
    font-size: .8rem;
}

.auth-preview .auth-check,
.auth-preview .auth-link {
    font-size: .72rem;
}

.auth-preview .auth-alert {
    margin-bottom: .8rem;
    padding: .5rem .65rem;
    font-size: .72rem;
}

/* Animations ----------------------------------------------------------------- */
@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive ----------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .auth-card {
        width: 100%;
        padding: 24px;
        border-radius: calc(var(--auth-card-radius) - 6px);
    }

    .auth-title {
        font-size: 1.45rem;
    }

    .auth-page-footer {
        font-size: .72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .auth-btn,
    .auth-btn > i,
    .auth-btn::after,
    .auth-input,
    .auth-control-icon,
    .auth-control-action,
    .auth-check input,
    .auth-check input::after {
        animation: none;
        transition: none;
    }
}
