/*
 * Sign-in screens for both panels.
 *
 * Filament's auth pages are a card centred in an empty page. This turns that into a two-column
 * screen: the College on the left, the form on the right. It is done entirely in CSS over the
 * stock markup — the only addition is the aside injected at SIMPLE_LAYOUT_START, which is the
 * one hook that lands inside .fi-simple-layout but outside the card, and therefore the only
 * place a second column can come from without replacing Filament's view.
 *
 * Plain CSS, published by `php artisan filament:assets`, because the CMS image has no Node
 * step. Loads on both panels; everything is scoped to the simple layout, which only auth
 * pages use.
 */

:root {
    --psc-auth-ink: #241C4A;
    --psc-auth-purple: #362B68;
    --psc-auth-accent: #5B4AA6;
    --psc-auth-gold: #C8A348;
}

/* ---------------------------------------------------------------- the two columns */

/*
 * The left half is taken out of the flow rather than made a column of a grid.
 *
 * Filament renders more than the two things that are wanted here — a skip link, a notification
 * container, whatever a future version adds — all as siblings inside .fi-simple-layout. As grid
 * children those become extra rows: the first attempt lost 95px off the bottom of the
 * photograph to an empty one. Fixed positioning sidesteps the whole question. The aside is
 * always exactly the viewport, nothing Filament injects can move it, and the layout keeps its
 * own display so the rest of the auth pages behave normally.
 */
@media (min-width: 1025px) {
    /* Scoped through the layout so these win wherever they sit in the file: the aside's own
       `position: relative` is declared further down, and at equal specificity source order
       would otherwise undo the fixed positioning. */
    .fi-simple-layout .psc-auth-aside {
        position: fixed;
        inset: 0 auto 0 0;
        width: 52vw;
    }

    /* Filament's layout keeps its own display, height and centring — the only change is that
       the half of the screen the aside now covers is given back to it. */
    .fi-simple-layout .fi-simple-main-ctn {
        margin-left: 52vw;
        width: 48vw;
    }
}

.fi-body .fi-simple-layout {
    /* Filament's own padding here floated the card off the edges of the page; the aside is
       full-bleed, so it only showed as a gap under the banner. The card does its own floating
       now, against a tint that keeps a white panel legible as something raised. */
    padding: 0;
    background: #F6F5FA;
}

.dark .fi-body .fi-simple-layout {
    background: #110D22;
}

/* ---------------------------------------------------------------- left: the College */

.psc-auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(36px, 4.4vw, 68px);
    background-image: url('/images/psc-building.webp');
    background-size: cover;
    background-position: center 38%;
    color: #FFFFFF;
    isolation: isolate;
}

/* The photograph is bright daylight; the text needs its own ground rather than a shadow. */
.psc-auth-aside-scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(135deg, rgba(26, 19, 58, 0.95) 0%, rgba(36, 28, 74, 0.88) 42%, rgba(70, 56, 134, 0.74) 100%),
        radial-gradient(120% 90% at 18% 12%, rgba(200, 163, 72, 0.22), transparent 60%);
}

/* The way back to the public site.

   Its own element rather than a line in the footer, because the footer is hidden below the
   breakpoint and a way out a phone cannot show is not a way out. Placed first in the column,
   so it sits above the branding on both layouts. */
.psc-auth-back {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    transition: background .22s ease, border-color .22s ease, color .22s ease;
}

.psc-auth-back svg {
    width: 14px;
    height: 14px;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}

.psc-auth-back:hover,
.psc-auth-back:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(200, 163, 72, 0.75);
    color: #FFFFFF;
}

/* The arrow leads, so it moves the way it points. */
.psc-auth-back:hover svg,
.psc-auth-back:focus-visible svg {
    transform: translateX(-3px);
}

.psc-auth-back:focus-visible {
    outline: 2px solid rgba(200, 163, 72, 0.9);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .psc-auth-back,
    .psc-auth-back svg {
        transition: none;
    }

    .psc-auth-back:hover svg {
        transform: none;
    }
}

.psc-auth-aside-body {
    max-width: 30rem;
    margin-top: auto;
}

.psc-auth-crest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    margin-bottom: 30px;
    border-radius: 99px;
    /* A light plate rather than a recoloured mark: the crest is full colour and would lose
       its gold and red if it were knocked out to white. */
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 34px rgba(10, 6, 30, 0.35);
}

.psc-auth-crest img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.psc-auth-eyebrow {
    margin: 0 0 14px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--psc-auth-gold);
}

.psc-auth-name {
    margin: 0;
    font-size: clamp(28px, 3.1vw, 42px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: #FFFFFF;
}

.psc-auth-name span {
    display: block;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.82);
}

.psc-auth-rule {
    width: 62px;
    height: 3px;
    margin: 26px 0 20px;
    border-radius: 99px;
    background: var(--psc-auth-gold);
}

.psc-auth-tagline {
    margin: 0 0 16px;
    font-size: 15.5px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.88);
}

.psc-auth-note {
    margin: 0;
    max-width: 26rem;
    font-size: 13.5px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.62);
}

.psc-auth-foot {
    margin: 36px 0 0;
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

/* ---------------------------------------------------------------- right: the form */

.fi-body .fi-simple-main-ctn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 4vw, 64px);
}

/* The column is the surface now, so the card sheds its own border and shadow. */
.fi-body .fi-simple-main {
    width: 100%;
    max-width: 27rem;
    padding: clamp(32px, 3.4vw, 46px) clamp(26px, 3vw, 40px);
    border: 1px solid #E6E2F0;
    border-radius: 22px;
    background: #FFFFFF;
    /* Two shadows rather than one: a wide soft cast for lift, and a tight dark edge so the
       card still has a defined bottom where the cast fades out. */
    box-shadow:
        0 24px 60px -24px rgba(36, 28, 74, 0.26),
        0 2px 6px -2px rgba(36, 28, 74, 0.08);
    /* Filament gives the card 4rem of vertical margin to float it off the page. The column
       centres it now, and that margin was only a gap under the banner on narrow screens. */
    margin: 0;
}

.dark .fi-body .fi-simple-main {
    border-color: rgba(255, 255, 255, 0.1);
    background: #1C1736;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
}



/* The crest is on the left panel; Filament's copy of it here was the second of two. */
.fi-simple-header .fi-logo {
    display: none;
}

.fi-body .fi-simple-header {
    /* Centred, now that the form sits in a card of its own — a title aligned to the card's
       left edge reads as the start of a page rather than the top of a panel. */
    align-items: center;
    margin-bottom: 28px;
    text-align: center;
}

.fi-simple-header-heading {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--psc-auth-purple);
}

.dark .fi-simple-header-heading {
    color: #FFFFFF;
}

.fi-simple-header-subheading {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.6;
}

/* ---------------------------------------------------------------- fields */

.fi-simple-page .fi-fo-field-label-content {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.fi-simple-page .fi-input-wrp {
    border-radius: 11px;
    box-shadow: none;
    border: 1px solid #E0DCEC;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.dark .fi-simple-page .fi-input-wrp {
    border-color: rgba(255, 255, 255, 0.14);
}

.fi-simple-page .fi-input-wrp:focus-within {
    border-color: var(--psc-auth-accent);
    box-shadow: 0 0 0 3px rgba(91, 74, 166, 0.16);
}

.fi-simple-page .fi-input {
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 14.5px;
}

/* ---------------------------------------------------------------- submit */

/*
 * Filament paints the primary action with its 400 shade, which on this purple comes out a pale
 * lavender — it read as disabled next to the rest of the page. A solid gradient in the brand
 * colour gives the one action on the screen the weight it should have.
 */
.fi-simple-page .fi-ac-btn-action {
    margin-top: 6px;
    padding-top: 12px;
    padding-bottom: 12px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--psc-auth-purple) 0%, var(--psc-auth-accent) 100%);
    color: #FFFFFF;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 24px rgba(54, 43, 104, 0.26);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.fi-simple-page .fi-ac-btn-action:hover {
    filter: brightness(1.08);
    box-shadow: 0 14px 30px rgba(54, 43, 104, 0.34);
    transform: translateY(-1px);
}

.fi-simple-page .fi-ac-btn-action:active {
    transform: translateY(0);
}

.fi-simple-page .fi-ac-btn-action:focus-visible {
    outline: 2px solid var(--psc-auth-gold);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .fi-simple-page .fi-ac-btn-action {
        transition: none;
    }

    .fi-simple-page .fi-ac-btn-action:hover {
        transform: none;
    }
}

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 1024px) {
    /* One column: the College becomes a banner above the form rather than disappearing,
       so the page still says where you are before you sign in. */
    /* Below the breakpoint the aside is back in the flow as a banner, and the layout is
       Filament's own stacked column again — nothing to override. */

    /* Filament centres the items in this column, which left the banner floating with white
       down both sides; it has to claim the full width to read as a banner at all. */
    .fi-simple-layout .psc-auth-aside {
        width: 100%;
        align-self: stretch;
        padding: 34px clamp(22px, 6vw, 40px) 30px;
        background-position: center 45%;
    }

    /* The form follows the banner directly rather than floating in the middle of what is
       left: a stacked screen reads top-down. */
    .fi-simple-layout .fi-simple-main-ctn {
        flex-grow: 0;
        align-items: flex-start;
        padding-top: 34px;
    }

    .psc-auth-aside-body {
        margin-top: 0;
    }

    .psc-auth-crest {
        width: 62px;
        height: 62px;
        margin-bottom: 18px;
    }

    .psc-auth-crest img {
        width: 42px;
        height: 42px;
    }

    .psc-auth-name {
        font-size: clamp(22px, 5.6vw, 30px);
    }

    .psc-auth-rule {
        margin: 18px 0 14px;
    }

    /* Two paragraphs of institutional copy above a form is a wall on a phone. The way back
       stays, because it is the only exit on the page. */
    .psc-auth-note,
    .psc-auth-foot {
        display: none;
    }

    .psc-auth-back {
        margin-bottom: 20px;
        padding: 7px 13px 7px 10px;
        font-size: 12px;
    }
}

@media (max-width: 640px) {
    .fi-body .fi-simple-main-ctn {
        padding: 30px 22px 44px;
        align-items: flex-start;
    }
}
