/*
 * The sign-in page (resources/views/filament/auth/layout.blade.php). Loaded only on that page; every rule is inside
 * .ja-auth, so nothing here can change another screen.
 * Wide screens: the brand panel on the left (with a station display: a chart and an LED ticker), the form on the
 * right. Phones: the brand is a band at the top (only the ticker of the display) and the form a sheet over it.
 */

.ja-auth {
    --ja-red: #e11d27;
    --ja-ink: #090b11;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}
html.ja-in-app .ja-auth { min-height: calc(100dvh - var(--ja-app-bar-h, 0px)); }

/* ---------- Brand panel ---------- */
.ja-auth-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(2rem, 3.6vw, 3.25rem) clamp(2rem, 4vw, 3.5rem);
    background: var(--ja-ink);
    color: #fff;
}
/* Soft red and blue light behind everything, drifting slowly. */
.ja-auth-glow {
    position: absolute;
    inset: -20%;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(40% 36% at 18% 16%, rgb(225 29 39 / .5), transparent 70%),
        radial-gradient(34% 32% at 88% 18%, rgb(59 76 220 / .24), transparent 70%),
        radial-gradient(46% 42% at 78% 88%, rgb(225 29 39 / .3), transparent 72%);
    animation: ja-auth-drift 22s ease-in-out infinite alternate;
}
/* A fine grid, like the pixels of a screen, fading out towards the edges. */
.ja-auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgb(255 255 255 / .045) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / .045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 35% 40%, #000 15%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 35% 40%, #000 15%, transparent 75%);
}
.ja-auth-brand-inner {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    max-width: 34rem;
    margin-inline: auto;
}
.ja-auth-logo { width: clamp(190px, 15vw, 240px); height: auto; }
.ja-auth-pitch { margin-top: auto; padding-top: 2rem; }
.ja-auth-kicker {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0 0 1rem;
    color: rgb(255 255 255 / .75);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.ja-auth-kicker::before { content: ''; width: 1.75rem; height: 2px; border-radius: 2px; background: var(--ja-red); }
.ja-auth-title {
    margin: 0;
    font-family: var(--ja-font-display, inherit);
    font-size: clamp(2rem, 3vw, 2.9rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.03em;
    text-wrap: balance;
}
.ja-auth-title span {
    background: linear-gradient(90deg, #ff4b55, #ffa0a5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ja-auth-text {
    max-width: 30rem;
    margin: 1rem 0 0;
    color: rgb(255 255 255 / .66);
    font-size: .98rem;
    line-height: 1.65;
}

/* ---------- The station display ---------- */
.ja-auth-display {
    position: relative;
    overflow: hidden;
    margin: 2.1rem 0 auto;
    border: 1px solid rgb(255 255 255 / .1);
    border-radius: 1.25rem;
    background: linear-gradient(160deg, rgb(255 255 255 / .085), rgb(255 255 255 / .025) 65%);
    box-shadow: 0 40px 80px -40px rgb(0 0 0 / .9), inset 0 1px 0 rgb(255 255 255 / .08);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    animation: ja-auth-rise .7s .1s cubic-bezier(.2, .7, .2, 1) both;
}
.ja-auth-display-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.15rem .25rem; }
.ja-auth-display-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .7rem;
    background: linear-gradient(140deg, #ff4b55, #b3121b);
    box-shadow: 0 8px 18px -8px rgb(225 29 39 / .9), inset 0 1px 0 rgb(255 255 255 / .25);
    color: #fff;
}
.ja-auth-display-icon svg { width: 1.25rem; height: 1.25rem; }
.ja-auth-display-name { flex: 1; min-width: 0; }
.ja-auth-display-name p { margin: 0; }
.ja-auth-display-name p:first-child { color: rgb(255 255 255 / .92); font-size: .86rem; font-weight: 600; }
.ja-auth-display-name p + p { margin-top: .1rem; color: rgb(255 255 255 / .5); font-size: .74rem; }
.ja-auth-display-leds { display: flex; gap: .3rem; }
.ja-auth-display-leds i { width: .4rem; height: .4rem; border-radius: 50%; background: rgb(255 255 255 / .18); }
.ja-auth-display-leds i:last-child { background: #ff4b55; box-shadow: 0 0 8px #ff4b55; animation: ja-auth-blink 2.6s ease-in-out infinite; }

.ja-auth-chart { padding: .6rem 1.15rem .9rem; }
.ja-auth-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ja-auth-chart-grid path { fill: none; stroke: rgb(255 255 255 / .07); stroke-dasharray: 2 5; }
.ja-auth-chart-grid .is-base { stroke: rgb(255 255 255 / .15); stroke-dasharray: none; }
.ja-auth-chart-bars rect {
    fill: url(#ja-auth-bar);
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: ja-auth-bar .8s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(.35s + var(--i) * 55ms);
}
.ja-auth-chart-bars rect.is-now { fill: url(#ja-auth-bar-now); }
.ja-auth-chart-area { fill: url(#ja-auth-area); animation: ja-auth-fade 1s 1.4s ease both; }
.ja-auth-chart-line {
    fill: none;
    stroke: url(#ja-auth-line);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    filter: drop-shadow(0 0 5px rgb(255 75 85 / .6));
    animation: ja-auth-draw 1.6s .9s cubic-bezier(.45, .05, .25, 1) forwards;
}
.ja-auth-chart-dot,
.ja-auth-chart-pulse { transform-box: fill-box; transform-origin: center; }
.ja-auth-chart-dot { fill: #fff; stroke: #ff4b55; stroke-width: 2.5; animation: ja-auth-pop .45s 2.4s cubic-bezier(.2, .7, .3, 1.5) both; }
.ja-auth-chart-pulse { fill: #ff4b55; opacity: 0; animation: ja-auth-pulse 2.6s 2.9s ease-out infinite; }
.ja-auth-months {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-top: .5rem;
    padding-inline: 3.333%;
    color: rgb(255 255 255 / .42);
    font-size: .66rem;
    font-weight: 500;
    text-align: center;
}

/* The LED ticker, like the information boards on railway platforms. */
.ja-auth-ticker {
    position: relative;
    overflow: hidden;
    padding: .68rem 0;
    border-top: 1px solid rgb(255 255 255 / .08);
    background: linear-gradient(#07080c, #0b0d13);
    box-shadow: inset 0 10px 18px -12px rgb(0 0 0 / .95);
}
/* The words fade in and out at both ends. */
.ja-auth-ticker::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, #08090d, transparent 9%, transparent 91%, #08090d);
}
.ja-auth-ticker-track { display: flex; width: max-content; animation: ja-auth-ticker 44s linear infinite; }
.ja-auth-ticker-track span {
    display: inline-flex;
    align-items: center;
    gap: 1.35rem;
    padding-right: 1.35rem;
    color: #ff6a70;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 0 6px rgb(255 60 70 / .7), 0 0 16px rgb(255 60 70 / .3);
}
.ja-auth-ticker-track span::after {
    content: '';
    width: .3rem;
    height: .3rem;
    background: #ffb3b7;
    box-shadow: 0 0 6px #ff4b55;
    opacity: .75;
    transform: rotate(45deg);
}

.ja-auth-brand-foot { display: flex; align-items: center; gap: .45rem; margin: 1.75rem 0 0; color: rgb(255 255 255 / .48); font-size: .78rem; }
.ja-auth-brand-foot svg { width: 1rem; height: 1rem; }

/* ---------- Form side ---------- */
.ja-auth-side {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem clamp(1.5rem, 5vw, 4.5rem) 0;
    background: #fff;
}
.dark .ja-auth-side { background: var(--gray-950, #020617); border-left: 1px solid rgb(255 255 255 / .06); }
.ja-auth-main {
    width: 100%;
    max-width: 24.5rem;
    margin-block: auto;
    outline: none;
    animation: ja-auth-rise .55s cubic-bezier(.2, .7, .2, 1) both;
}
.ja-auth .fi-simple-header { align-items: flex-start; gap: .45rem; text-align: left; }
.ja-auth .fi-simple-header-heading {
    color: #0b1220;
    font-family: var(--ja-font-display, inherit);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.03em;
}
.ja-auth .fi-simple-header-subheading { margin: 0; color: #64748b; font-size: .95rem; }
.dark .ja-auth .fi-simple-header-heading { color: #f8fafc; }
.dark .ja-auth .fi-simple-header-subheading { color: #94a3b8; }

/* Roomier fields and a bolder button. */
.ja-auth .fi-input-wrp { border-radius: .8rem; }
.ja-auth .fi-input-wrp .fi-input { padding-block: .72rem; }
.ja-auth .fi-btn { min-height: 2.95rem; border-radius: .8rem; font-size: .95rem; }
.ja-auth .fi-btn.fi-color-primary { box-shadow: 0 12px 24px -14px rgb(225 29 39 / .9); }
.ja-auth .fi-btn.fi-color-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 28px -14px rgb(225 29 39 / .95); }

/* "Secure sign-in" note under the form. */
.ja-auth-note {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    margin: 1.6rem 0 0;
    padding: .85rem 1rem;
    border: 1px solid #e7ecf3;
    border-radius: .9rem;
    background: #f8fafc;
}
.ja-auth-note-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: .6rem;
    background: #dcfce7;
    color: #15803d;
}
.ja-auth-note-icon svg { width: 1.15rem; height: 1.15rem; }
.ja-auth-note p { margin: 0; color: #64748b; font-size: .78rem; line-height: 1.5; }
.ja-auth-note strong { display: block; margin-bottom: .1rem; color: #0f172a; font-size: .83rem; font-weight: 600; }
.dark .ja-auth-note { border-color: rgb(255 255 255 / .08); background: rgb(255 255 255 / .03); }
.dark .ja-auth-note-icon { background: rgb(34 197 94 / .14); color: #4ade80; }
.dark .ja-auth-note p { color: #94a3b8; }
.dark .ja-auth-note strong { color: #f1f5f9; }

.ja-auth .ja-footer { width: 100%; max-width: 24.5rem; margin: 2rem 0 0; padding: 0 0 1.25rem; border-top: 0; }

/* ---------- Low but wide screens (laptops at 1366 x 768 and smaller) ---------- */
@media (min-width: 1024px) and (max-height: 820px) {
    .ja-auth-text { display: none; }
    .ja-auth-display { margin-top: 1.6rem; }
    .ja-auth-chart { padding-bottom: .7rem; }
}

/* ---------- Phones and small tablets ---------- */
@media (max-width: 1023.98px) {
    .ja-auth { display: flex; flex-direction: column; background: var(--ja-ink); }
    .ja-auth-brand { padding: 1.4rem 1.25rem 3.3rem; padding-top: max(1.4rem, env(safe-area-inset-top)); }
    .ja-auth-brand-inner { max-width: none; }
    .ja-auth-logo { width: 158px; }
    .ja-auth-pitch { margin: 0; padding-top: 1.35rem; }
    .ja-auth-kicker { margin-bottom: .6rem; font-size: .66rem; }
    .ja-auth-title { font-size: clamp(1.5rem, 6.2vw, 2rem); }
    .ja-auth-text, .ja-auth-brand-foot, .ja-auth-display-head, .ja-auth-chart { display: none; }
    /* Only the ticker of the display, as a slim strip. */
    .ja-auth-display {
        margin: 1.15rem 0 0;
        border-radius: .8rem;
        background: none;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .ja-auth-ticker { padding: .55rem 0; border-top: 0; }
    .ja-auth-ticker-track span { font-size: .68rem; }
    .ja-auth-side {
        flex: 1;
        margin-top: -1.6rem;
        padding: 2rem 1.25rem 0;
        padding-bottom: env(safe-area-inset-bottom);
        border-radius: 1.6rem 1.6rem 0 0;
        box-shadow: 0 -14px 30px -20px rgb(0 0 0 / .6);
    }
    .dark .ja-auth-side { border-left: 0; border-top: 1px solid rgb(255 255 255 / .09); }
    .ja-auth-main { margin-block: 0 auto; }
    .ja-auth .fi-simple-header-heading { font-size: 1.7rem; }
}

@keyframes ja-auth-drift {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to { transform: translate3d(3%, 2%, 0) scale(1.06); }
}
@keyframes ja-auth-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@keyframes ja-auth-bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ja-auth-draw { to { stroke-dashoffset: 0; } }
@keyframes ja-auth-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ja-auth-pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes ja-auth-pulse {
    0% { opacity: .55; transform: scale(1); }
    70%, 100% { opacity: 0; transform: scale(3.4); }
}
@keyframes ja-auth-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ja-auth-ticker { to { transform: translate3d(-50%, 0, 0); } }

/* People who ask for less motion get the finished picture, standing still. */
@media (prefers-reduced-motion: reduce) {
    .ja-auth-glow, .ja-auth-main, .ja-auth-display, .ja-auth-chart-bars rect, .ja-auth-chart-area,
    .ja-auth-chart-dot, .ja-auth-display-leds i, .ja-auth-ticker-track { animation: none; }
    .ja-auth-chart-line { animation: none; stroke-dashoffset: 0; }
    .ja-auth-chart-pulse { display: none; }
}
