:root {
    --brand: oklch(0.62 0.12 235);
    --brand-hover: oklch(0.56 0.13 235);
    --brand-deep: oklch(0.42 0.11 235);
    --brand-soft: oklch(0.94 0.03 235);
    --brand-softer: oklch(0.97 0.015 235);

    --ink: oklch(0.22 0.015 250);
    --ink-2: oklch(0.38 0.012 250);
    --ink-3: oklch(0.55 0.01 250);
    --ink-4: oklch(0.72 0.008 250);

    --paper: oklch(0.99 0.003 250);
    --paper-2: oklch(0.97 0.006 250);
    --rule: oklch(0.90 0.006 250);
    --rule-2: oklch(0.82 0.008 250);

    --ok: oklch(0.68 0.13 155);
    --warn: oklch(0.72 0.15 65);
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper-2);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
body {
    background:
        radial-gradient(1200px 800px at 85% 10%, oklch(0.94 0.04 235 / 0.6), transparent 60%),
        radial-gradient(900px 700px at 10% 90%, oklch(0.96 0.025 235 / 0.5), transparent 60%),
        var(--paper-2);
}

.display { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.01em; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ---------- Layout ---------- */
.shell {
    min-height: 100vh;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 8px;
    margin-bottom: 32px;
}

.stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.frame {
    position: relative;
    width: 100%;
    max-width: 1280px;
    height: 680px;
    display: grid;
    grid-template-columns: 480px 1fr;
}



/* ---------- Slider panel (right) ---------- */
.slider-panel {
    position: absolute;
    top: 40px;
    bottom: 40px;
    left: 380px;
    right: 0;
    border-radius: 24px;
    overflow: hidden;
    background: var(--brand-deep);
    box-shadow:
        0 30px 60px -20px oklch(0.3 0.08 235 / 0.35),
        0 0 0 1px oklch(0.3 0.08 235 / 0.1);
}

.slide {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: flex-end;
}
.slide.active { opacity: 1; }
.slide-media {
    position: absolute; inset: 0;
    overflow: hidden;
}
.slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.slide-caption {
    position: relative;
    padding: 56px 64px 130px 160px;
    color: oklch(0.99 0.005 235);
    max-width: 640px;
    z-index: 2;
}
.slide-caption .eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 12px;
}
.slide-caption h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 38px;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
}
.slide-caption p {
    font-size: 15px;
    line-height: 1.55;
    opacity: 0.88;
    margin: 0;
    max-width: 460px;
}

.slide-media::after {
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(105deg, oklch(0.2 0.1 235 / 0.96) 0%, oklch(0.22 0.1 235 / 0.92) 40%, oklch(0.25 0.1 235 / 0.55) 62%, oklch(0.25 0.1 235 / 0.2) 100%),
        linear-gradient(180deg, oklch(0.3 0.1 235 / 0.1) 0%, oklch(0.25 0.1 235 / 0.45) 70%, oklch(0.2 0.1 235 / 0.6) 100%);
}
.frame[data-direction="flipped"] .slide-media::after {
    background:
        linear-gradient(255deg, oklch(0.2 0.1 235 / 0.96) 0%, oklch(0.22 0.1 235 / 0.92) 40%, oklch(0.25 0.1 235 / 0.55) 62%, oklch(0.25 0.1 235 / 0.2) 100%),
        linear-gradient(180deg, oklch(0.3 0.1 235 / 0.1) 0%, oklch(0.25 0.1 235 / 0.45) 70%, oklch(0.2 0.1 235 / 0.6) 100%);
}

/* Slide artwork variants */
.art-docs {
    background:
        linear-gradient(135deg, oklch(0.5 0.12 240) 0%, oklch(0.3 0.1 250) 100%);
}
.art-rca {
    background:
        radial-gradient(ellipse at 70% 40%, oklch(0.55 0.13 255) 0%, oklch(0.32 0.1 245) 60%, oklch(0.22 0.08 250) 100%);
}
.art-timesheet {
    background:
        linear-gradient(135deg, oklch(0.42 0.11 225) 0%, oklch(0.28 0.09 245) 100%);
}
.art-tasks {
    background:
        linear-gradient(135deg, oklch(0.48 0.12 235) 0%, oklch(0.3 0.1 260) 100%);
}
.art-pos {
    background:
        linear-gradient(135deg, oklch(0.5 0.12 245) 0%, oklch(0.32 0.11 230) 100%);
}

/* Decorative layer inside slide media (industrial vibes) */
.slide-deco {
    position: absolute; inset: 0;
    pointer-events: none;
}

/* Slide controls */
.slide-nav {
    position: absolute;
    bottom: 44px;
    right: 44px;
    display: flex; gap: 10px;
    z-index: 4;
}
.slide-nav button {
    width: 44px; height: 44px;
    border-radius: 999px;
    border: 1px solid oklch(1 0 0 / 0.25);
    background: oklch(1 0 0 / 0.08);
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 160ms;
}
.slide-nav button:hover {
    background: oklch(1 0 0 / 0.18);
    border-color: oklch(1 0 0 / 0.4);
}
.slide-dots {
    position: absolute;
    bottom: 56px;
    left: 160px;
    display: flex; gap: 8px;
    z-index: 4;
}
.slide-dots button {
    width: 26px; height: 4px;
    border-radius: 2px;
    background: oklch(1 0 0 / 0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 300ms;
    overflow: hidden;
    position: relative;
}
.slide-dots button.active {
    width: 52px;
    background: oklch(1 0 0 / 0.35);
}
.slide-dots button.active::after {
    content: "";
    position: absolute; inset: 0;
    background: white;
    transform-origin: left;
    animation: fill 6000ms linear forwards;
}
.slide-dots button.active.paused::after { animation-play-state: paused; }
@keyframes fill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Slide counter chip */
.slide-count {
    position: absolute;
    top: 28px;
    right: 32px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: oklch(1 0 0 / 0.75);
    background: oklch(1 0 0 / 0.1);
    border: 1px solid oklch(1 0 0 / 0.2);
    padding: 6px 12px;
    border-radius: 999px;
    backdrop-filter: blur(10px);
    z-index: 4;
}

/* ---------- Login card (left, overlapping) ---------- */
.login-card {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 440px;
    background: white;
    border: 1px solid var(--rule);
    border-radius: 20px;
    /* No padding here any more - .brand and .login-card-body each carry their own, so .brand
       can be a full-width strip. overflow:hidden clips that strip to the card's own rounded
       corners instead of having to match border-radius values by hand. */
    overflow: hidden;
    box-shadow:
        0 40px 80px -24px oklch(0.3 0.08 235 / 0.25),
        0 20px 40px -20px oklch(0.3 0.08 235 / 0.15),
        0 0 0 1px oklch(1 0 0 / 0.5) inset;
    z-index: 5;
}

.brand {
    display: flex; align-items: center; justify-content: center;
}
/* Full-width logo section (login card only - ChooseApplication also uses .brand/.brand-logo-img
   for its plain header logo and keeps the bare rule above), set apart from the form fields below
   by its own background and a thin rule - same tone the small logo "chip" used to have, now as a
   proper section instead of an inset tile. */
.login-card .brand {
    background: var(--paper-2);
    border-bottom: 1px solid var(--rule);
    /* Top/bottom kept minimal so the section hugs the logo's own height - a circular logo
       loses its impact when it's small inside a lot of vertical padding. */
    padding: 8px 40px;
}
.login-card-body {
    padding: 32px 40px 36px;
}
.brand-logo {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    position: relative;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px -2px oklch(0.4 0.12 235 / 0.4);
}
.brand-logo::before {
    content: "";
    width: 18px; height: 18px;
    border: 2.5px solid white;
    border-radius: 50%;
    border-right-color: transparent;
    border-bottom-color: transparent;
    transform: rotate(-45deg);
}
.brand-logo-img {
    height: 56px;
    width: auto;
    max-width: 280px;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}
/* Bigger, since the login card's logo now has a whole section to itself rather than sharing
   space with ChooseApplication's plain header logo. */
.login-card .brand-logo-img {
    height: 80px;
}
.brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.01em;
}
.brand-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--ink-3);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding-top: 3px;
}

.login-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: var(--ink);
    line-height: 1.2;
}
.login-sub {
    color: var(--ink-3);
    font-size: 14px;
    margin: 0 0 28px;
    line-height: 1.5;
}

.field { margin-bottom: 16px; position: relative; }
.field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    margin-bottom: 6px;
    letter-spacing: 0.005em;
}
.field .ctl {
    display: flex; align-items: center;
    height: 46px;
    border: 1px solid var(--rule-2);
    border-radius: 10px;
    background: var(--paper-2);
    padding: 0 14px;
    transition: all 160ms;
}
.field .ctl:focus-within {
    border-color: var(--brand);
    background: white;
    box-shadow: 0 0 0 4px oklch(0.62 0.12 235 / 0.12);
}
.field .ctl svg { flex-shrink: 0; color: var(--ink-4); margin-right: 10px; }
.field .ctl:focus-within svg { color: var(--brand); }
.field .ctl input {
    flex: 1;
    border: none; outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    min-width: 0;
}
.field .ctl input::placeholder { color: var(--ink-4); }
.field .ctl.is-readonly { background: var(--rule); }
.field .ctl.is-readonly input { color: var(--ink-3); cursor: default; }
.field .ctl.is-readonly:focus-within { box-shadow: none; border-color: var(--rule-2); }
.field .show-btn {
    border: none; background: none; cursor: pointer;
    color: var(--ink-3); font-size: 12px; font-weight: 500;
    padding: 4px 6px;
}
.field .show-btn:hover { color: var(--brand); }
.field .field-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: oklch(0.55 0.18 25);
    min-height: 8px;
}

.row-between {
    display: flex; justify-content: space-between; align-items: center;
    margin: 16px 0 22px;
}
.checkbox {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink-2);
}
.checkbox input { display: none; }
.checkbox .box {
    width: 16px; height: 16px;
    border: 1.5px solid var(--rule-2);
    border-radius: 4px;
    background: white;
    display: flex; align-items: center; justify-content: center;
    transition: all 140ms;
}
.checkbox input:checked + .box {
    background: var(--brand);
    border-color: var(--brand);
}
.checkbox input:checked + .box::after {
    content: "";
    width: 9px; height: 5px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(1px, -1px);
}
.forgot {
    font-size: 13px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}
.forgot:hover { text-decoration: underline; }

.btn-primary {
    width: 100%;
    height: 48px;
    border: none;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-hover) 100%);
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    box-shadow:
        0 1px 0 oklch(1 0 0 / 0.2) inset,
        0 8px 20px -6px oklch(0.4 0.12 235 / 0.5);
    transition: transform 120ms, box-shadow 120ms;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 oklch(1 0 0 / 0.2) inset,
        0 12px 24px -6px oklch(0.4 0.12 235 / 0.55);
}
.btn-primary:active { transform: translateY(0); }

.divider {
    display: flex; align-items: center; gap: 14px;
    margin: 24px 0 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--ink-4);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.divider::before, .divider::after {
    content: ""; flex: 1; height: 1px; background: var(--rule);
}

.sso-row { display: flex; gap: 10px; }
.sso-btn {
    flex: 1;
    height: 44px;
    border: 1px solid var(--rule-2);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 140ms;
}
.sso-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-softer); }

/* ---------- Topbar ---------- */
.topbar-brand {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
}
.topbar-brand .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px oklch(0.68 0.13 155 / 0.2);
}
.topbar-meta {
    display: flex; gap: 18px;
    font-size: 13px;
    color: var(--ink-3);
    align-items: center;
}
.topbar-meta a { color: inherit; text-decoration: none; }
.topbar-meta a:hover { color: var(--brand); }
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: oklch(0.95 0.04 155);
    color: oklch(0.4 0.1 155);
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
}
.status-pill .d {
    width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.footnote {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-top: 24px;
    padding: 0 8px;
    font-size: 12px;
    color: var(--ink-3);
}
.footnote .mono { font-size: 11px; letter-spacing: 0.08em; }
.footnote-copy { white-space: nowrap; }

.powered-by {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 999px;
}
.powered-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.powered-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: var(--brand);
    text-decoration: none;
    transition: color 140ms;
}
.powered-name:hover { color: var(--brand-hover); }

.footnote-site {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    transition: color 140ms;
    white-space: nowrap;
}
.footnote-site:hover { color: var(--brand-hover); text-decoration: underline; }
.footnote-site svg { transition: transform 140ms; }
.footnote-site:hover svg { transform: translate(1px, -1px); }

/* ---------- Layout direction variants ---------- */
.frame[data-direction="flipped"] .slider-panel {
    left: 0; right: 380px;
}
.frame[data-direction="flipped"] .login-card {
    left: auto; right: 0;
    transform: translateY(-50%);
}
.frame[data-direction="flipped"] .slide-caption { padding: 56px 160px 130px 64px; }
.frame[data-direction="flipped"] .slide-dots { left: 56px; }
.frame[data-direction="flipped"] .slide-nav { right: 140px; }
.frame[data-direction="flipped"] .slide-count { left: 32px; right: auto; }

.mobile-footnote { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .shell { padding: 0; }
    .stage {
        align-items: stretch;
        justify-content: stretch;
        height: 100vh;
        min-height: auto;
    }
    .frame {
        height: 100vh;
        min-height: auto;
        display: flex;
        flex-direction: column;
        max-width: 100%;
    }

    /* Slider becomes full-screen background */
    .slider-panel {
        position: absolute;
        inset: 0;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        height: 100%;
    }
    .slide-media::after {
        /* Lighter overlay so image shows through card */
        background:
            linear-gradient(180deg, oklch(0.15 0.08 235 / 0.60) 0%, oklch(0.15 0.08 235 / 0.65) 50%, oklch(0.15 0.08 235 / 0.70) 100%);
    }
    .slide-caption { display: none; }
    .slide-dots { display: none; }
    .slide-count { display: none; }

    .slide-nav { display: none; }

    /* Login card centered with footnote below */
    .login-card {
        position: relative;
        inset: auto;
        left: auto;
        top: auto;
        transform: none;
        width: 90%;
        max-width: 420px;
        margin: auto;
        border-radius: 20px;
        z-index: 10;
        background: white;
        border: 1px solid var(--rule);
        box-shadow:
            0 40px 80px -24px oklch(0.3 0.08 235 / 0.25),
            0 20px 40px -20px oklch(0.3 0.08 235 / 0.15),
            0 0 0 1px oklch(1 0 0 / 0.5) inset;
        flex-shrink: 0;
    }
    .login-card .brand {
        padding: 8px 24px;
    }
    .login-card .login-card-body {
        padding: 24px 24px 28px;
    }

    .login-card .field .ctl {
        background: var(--paper-2);
        border-color: var(--rule-2);
    }
    .login-card .field .ctl:focus-within {
        background: white;
        border-color: var(--brand);
        box-shadow: 0 0 0 4px oklch(0.62 0.12 235 / 0.12);
    }

    .desktop-footnote { display: none; }
    .mobile-footnote { display: flex; }

    .frame .footnote {
        display: flex;
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        z-index: 10;
        margin: 0;
        padding: 10px 20px;
        background: oklch(0.15 0.08 235 / 0.55);
        backdrop-filter: blur(10px);
        color: oklch(1 0 0 / 0.7);
        flex-shrink: 0;
    }
    .frame .footnote-copy { color: oklch(1 0 0 / 0.7); }
    .frame .powered-by {
        background: oklch(1 0 0 / 0.1);
        border-color: oklch(1 0 0 / 0.2);
    }
    .frame .powered-label { color: oklch(1 0 0 / 0.6); }
}

/* Extra small phones */
@media (max-width: 480px) {
    .login-card {
        width: 94%;
        border-radius: 16px;
    }
    .login-card .brand {
        padding: 6px 18px;
    }
    .login-card .login-card-body {
        padding: 16px 18px;
    }
    .login-card .brand-logo-img {
        height: 56px;
    }
    .field {
        margin-bottom: 10px;
    }
    .field label {
        font-size: 11px;
        margin-bottom: 4px;
    }
    .field .ctl {
        height: 40px;
        padding: 0 12px;
    }
    .field .ctl input {
        font-size: 13px;
    }
    .row-between {
        margin: 8px 0 12px;
    }
    .btn-primary {
        height: 42px;
        font-size: 14px;
    }
    .frame .footnote {
        padding: 8px 16px;
        font-size: 11px;
    }
    .mobile-footnote { display: flex; }
}
