/* ==========================================================================
   Simpaul Design — split-screen sign-in
   --------------------------------------------------------------------------
   Shared verbatim between simpaul-crm (Blade) and sd-workspace (Vue): the
   markup contract is the same class tree in both, so a change here should be
   copied to the other repo rather than forked. Keep them byte-identical.

   Layout: form pane left, media pane right. The media pane is a slider —
   each slide is a brand gradient with a piece of portfolio work floating on
   it as a card, a quote bottom-left, and a row of progress bars along the
   footer. The bars are the hover control: pointing at one pauses the
   autoplay and previews that slide.

   Every colour is a token declared on :root below, then redeclared for the
   two dark cases (system preference, and an explicit data-theme="dark" which
   sd-workspace sets). Never give a colour its only definition inside a dark
   block — a light-mode viewer would get nothing.
   ========================================================================== */

:root {
    /* brand constants — identical in both themes */
    --orange: #ff5e29;
    --orange-deep: #e8471c;
    --navy: #213343;

    /* theme-aware */
    --auth-bg: #ffffff;
    --auth-pane: #ffffff;
    --auth-text: #213343;
    --auth-muted: #7c8794;
    --auth-border: #e2e0d6;
    --auth-input-bg: #faf9f5;
    --auth-input-border: #d9d7cc;
    --auth-error-bg: #fff1f2;
    --auth-error-text: #c02b3f;
    --auth-shadow: 0 24px 60px rgba(33, 51, 67, 0.10);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --auth-bg: #111a22;
        --auth-pane: #111a22;
        --auth-text: #eef1f4;
        --auth-muted: #8296a5;
        --auth-border: #2b3a47;
        --auth-input-bg: #182430;
        --auth-input-border: #2e3d4b;
        --auth-error-bg: #2c1a1f;
        --auth-error-text: #ff8f9d;
        --auth-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    }
}

:root[data-theme="dark"] {
    --auth-bg: #111a22;
    --auth-pane: #111a22;
    --auth-text: #eef1f4;
    --auth-muted: #8296a5;
    --auth-border: #2b3a47;
    --auth-input-bg: #182430;
    --auth-input-border: #2e3d4b;
    --auth-error-bg: #2c1a1f;
    --auth-error-text: #ff8f9d;
    --auth-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* ── Shell ────────────────────────────────────────────────────────────── */

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    background: var(--auth-bg);
    color: var(--auth-text);
}

/* ── Form pane ────────────────────────────────────────────────────────── */

.auth-form-pane {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: var(--auth-gap, 32px);
    padding: clamp(28px, 4vw, 48px) clamp(24px, 5vw, 72px);
    background: var(--auth-pane);
}

.auth-logo { display: block; }
.auth-logo img { display: block; width: 172px; height: auto; }
/* One logo lives in the DOM per theme; CSS decides which. The colour lockup
   reads on light, the white-and-orange lockup on dark. */
.auth-logo .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .auth-logo .logo-light { display: none; }
    :root:not([data-theme="light"]) .auth-logo .logo-dark { display: block; }
}
:root[data-theme="dark"] .auth-logo .logo-light { display: none; }
:root[data-theme="dark"] .auth-logo .logo-dark { display: block; }

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

.auth-card h1 {
    font-size: clamp(28px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 8px;
}

.auth-card .auth-sub {
    font-size: 15px;
    color: var(--auth-muted);
    margin: 0 0 28px;
}

.auth-field { margin-bottom: 18px; }

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
}

.auth-field input {
    width: 100%;
    font: inherit;
    font-size: 15px;
    color: var(--auth-text);
    padding: 13px 15px;
    border: 1px solid var(--auth-input-border);
    border-radius: 12px;
    background: var(--auth-input-bg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.auth-field input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 94, 41, 0.18);
}

.auth-field input#code,
.auth-field input.auth-code {
    letter-spacing: 0.35em;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.auth-submit {
    width: 100%;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--orange);
    border: none;
    border-radius: 12px;
    padding: 14px;
    margin-top: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.auth-submit:hover:not(:disabled) { background: var(--orange-deep); }
.auth-submit:active:not(:disabled) { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.65; cursor: default; }

.auth-link {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--orange);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

.auth-error {
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-error-text);
    background: var(--auth-error-bg);
    border-radius: 10px;
    padding: 11px 14px;
    margin-bottom: 20px;
}

.auth-note {
    font-size: 13px;
    color: var(--auth-muted);
    margin-bottom: 20px;
}

.auth-foot {
    font-size: 12.5px;
    color: var(--auth-muted);
}

.auth-foot a { color: inherit; }

/* ── Media pane ───────────────────────────────────────────────────────── */

.auth-media-pane {
    padding: 16px 16px 16px 0;
    min-height: 0;
}

.auth-slider {
    position: relative;
    height: 100%;
    min-height: 480px;
    border-radius: 22px;
    overflow: hidden;
    background: var(--navy);
    box-shadow: var(--auth-shadow);
}

.auth-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8% 9% 22%;
    opacity: 0;
    transition: opacity 0.9s ease;
    pointer-events: none;
}

.auth-slide.is-active { opacity: 1; }

/* The gradient is per-slide so the four screens have a rhythm to them; the
   radial on top is a single shared highlight, keyed off the same corner. */
.auth-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 74% 20%, rgba(255, 255, 255, 0.16), transparent 58%),
        linear-gradient(148deg, var(--g1) 0%, var(--g2) 100%);
}

.auth-slide-1 { --g1: #1b2a38; --g2: #2f4a61; }
.auth-slide-2 { --g1: #2a1b18; --g2: #7a2d12; }
.auth-slide-3 { --g1: #17313a; --g2: #2c5a63; }
.auth-slide-4 { --g1: #21252e; --g2: #46372f; }

/* Contained, not cropped: the source images are all landscape and the pane
   is portrait, so object-fit:cover would eat most of each composition.
   Floating the work as a card keeps every piece whole and reads as a
   showcase rather than a background texture. */
.auth-slide img {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
    transform: scale(1);
    transition: transform 8s linear;
}

.auth-slide.is-active img { transform: scale(1.045); }

.auth-scrim {
    position: absolute;
    inset: auto 0 0 0;
    height: 62%;
    background: linear-gradient(to top, rgba(12, 20, 27, 0.88) 0%, rgba(12, 20, 27, 0.55) 38%, transparent 100%);
    pointer-events: none;
}

/* All quotes occupy the same grid cell, bottom-aligned. Stacking them this
   way rather than toggling position:absolute/relative is what keeps the
   crossfade clean: the outgoing and incoming lines sit on exactly the same
   baseline, so it reads as a dissolve instead of two blocks colliding, and
   the cell height (tallest quote) never shifts the bars underneath. */
.auth-caption {
    position: absolute;
    left: clamp(24px, 4%, 44px);
    right: clamp(24px, 4%, 44px);
    bottom: 62px;
    display: grid;
    align-items: end;
    color: #fff;
    pointer-events: none;
}

.auth-quote {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.auth-quote.is-active {
    opacity: 1;
    transform: none;
}

.auth-quote p {
    font-size: clamp(18px, 1.5vw, 22px);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
    max-width: 30ch;
}

.auth-quote cite {
    display: block;
    font-size: 12.5px;
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.68);
}

/* ── Progress / hover bar ─────────────────────────────────────────────── */

.auth-bars {
    position: absolute;
    left: clamp(24px, 4%, 44px);
    right: clamp(24px, 4%, 44px);
    bottom: 22px;
    display: flex;
    gap: 10px;
}

.auth-bar {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.auth-bar-track {
    display: block;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    overflow: hidden;
    transition: height 0.2s ease, background 0.2s ease;
}

.auth-bar:hover .auth-bar-track,
.auth-bar:focus-visible .auth-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.45);
}

.auth-bar:focus-visible { outline: none; }

.auth-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: var(--orange);
}

/* Width is driven by the animation, not by JS setting it frame by frame.
   Restarting it on slide change is why the markup re-keys the element. */
.auth-bar.is-active .auth-bar-fill {
    animation: auth-bar-fill var(--auth-slide-duration, 7s) linear forwards;
}

.auth-bar.is-active .auth-bar-track { background: rgba(255, 255, 255, 0.38); }

/* Autoplay paused (pointer is over the slider) — freeze the fill where it is
   rather than snapping it back, so the pause reads as a pause. */
.auth-slider.is-paused .auth-bar.is-active .auth-bar-fill { animation-play-state: paused; }

.auth-bar.is-done .auth-bar-fill { width: 100%; }

@keyframes auth-bar-fill {
    from { width: 0; }
    to { width: 100%; }
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr); }
    .auth-media-pane { display: none; }
    .auth-form-pane { padding: 32px 24px; }
}

@media (max-height: 620px) {
    .auth-slider { min-height: 380px; }
    .auth-slide { padding: 6% 8% 24%; }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .auth-slide,
    .auth-slide img,
    .auth-quote,
    .auth-submit,
    .auth-bar-track { transition: none; }
    .auth-slide.is-active img { transform: none; }
    .auth-bar.is-active .auth-bar-fill { animation: none; width: 100%; }
}
