/*
 * The server-rendered pages: sign-in, registration, the password screens, the "We've moved" home page
 * and the signup form. Every one of them extends resources/views/layouts/page.blade.php, which loads
 * this file and nothing else; the login page alone extends layouts/stage.blade.php, which loads it too.
 *
 * Hand-maintained plain CSS. There is no Sass or JavaScript build for these pages any more, so edit
 * this file directly; what is here is what ships.
 *
 * The look is the client's changelog (uis/dovr-db-client/src/styles/changelog.scss and
 * src/components/changelog/*), which in turn follows dovrmedia.com: navy and orange on white, a sky
 * tint for panels, a system sans at weight 800 for headings, pill buttons, and 10px cards with a soft
 * navy shadow over a navy masthead. The token values are copied from changelog.scss, not approximated;
 * when that file changes, re-sync the palette block below. Like the changelog, these pages load no
 * web fonts and have no dark theme. The login page is the exception: see section 10.
 *
 * Sections:
 *   1. Tokens
 *   2. Base
 *   3. Top bar
 *   4. Masthead
 *   5. Card
 *   6. Type and notices
 *   7. Form controls
 *   8. Buttons and links
 *   9. Footer
 *  10. Sign-in stage (login only; dark, on layouts/stage.blade.php)
 *  11. Small screens and reduced motion
 */

/* ------------------------------------------------------------ 1. Tokens */
:root {
    color-scheme: light;

    /* dovrmedia.com palette, as changelog.scss declares it on .cl-root */
    --dp-navy: #0d2240;
    --dp-navy-deep: #081729;
    --dp-navy-soft: #16335e;
    --dp-sky: #eef3f9;
    --dp-accent: #f26722;
    --dp-accent-dark: #d55412;
    --dp-accent-wash: #fff6f0;
    --dp-accent-wash-line: #f7d4bd;
    --dp-hero-ink: #cdd8e6;
    --dp-hero-faint: #8fa2ba;

    /* Semantic */
    --dp-bg: #ffffff;
    --dp-heading: var(--dp-navy);
    --dp-ink: #1f2a3a;
    --dp-ink-dim: #5b6779;
    --dp-ink-faint: #8a96a8;
    --dp-rule: #dce3ec;
    --dp-link: var(--dp-accent-dark);
    --dp-cool: #2563a8;
    --dp-green: #1e8a52;
    --dp-red: #c42f3f;

    /* Type */
    --dp-font: "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --dp-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Shape */
    --dp-radius: 10px;
    --dp-shadow: 0 10px 30px rgba(13, 34, 64, 0.1);
    --dp-shadow-sm: 0 4px 14px rgba(13, 34, 64, 0.05);

    /* Spacing */
    --dp-space-1: 4px;
    --dp-space-2: 8px;
    --dp-space-3: 12px;
    --dp-space-4: 16px;
    --dp-space-5: 24px;
    --dp-space-6: 32px;
    --dp-space-7: 48px;
}

/* -------------------------------------------------------------- 2. Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--dp-bg);
    color: var(--dp-ink);
    font-family: var(--dp-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.dp-wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--dp-space-5);
}

/* ----------------------------------------------------------- 3. Top bar */
/* The site's white header: the black wordmark on white, sign-in links on the right. */
.dp-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--dp-rule);
}

.dp-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--dp-space-4);
    min-height: 64px;
}

.dp-brand {
    display: inline-flex;
    align-items: center;
}

.dp-brand img {
    display: block;
    height: 22px;
    width: auto;
}

.dp-topbar__nav {
    display: flex;
    gap: var(--dp-space-5);
    font-size: 0.92rem;
}

.dp-topbar__nav a {
    color: var(--dp-navy);
    font-weight: 700;
    text-decoration: none;
}

.dp-topbar__nav a:hover {
    color: var(--dp-accent-dark);
}

/* ---------------------------------------------------------- 4. Masthead */
/* The changelog's .cl-hero, full width: navy gradient, an orange glow and a faint grid. */
.dp-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    padding: 3.5rem 0 6rem;
    background:
        radial-gradient(900px 380px at 90% -20%, rgba(242, 103, 34, 0.22), transparent 60%),
        linear-gradient(130deg, var(--dp-navy-deep) 0%, var(--dp-navy) 60%, var(--dp-navy-soft) 100%);
}

.dp-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(700px 420px at 80% 30%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(700px 420px at 80% 30%, #000 0%, transparent 75%);
}

.dp-hero > * {
    position: relative;
    z-index: 1;
}

.dp-hero__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--dp-space-6);
}

.dp-eyebrow {
    display: inline-block;
    margin: 0 0 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dp-accent);
}

.dp-h1 {
    margin: 0;
    max-width: 48rem;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
}

.dp-lede {
    margin: 1rem 0 0;
    max-width: 44rem;
    font-size: 1.1rem;
    color: var(--dp-hero-ink);
}

/* -------------------------------------------------------------- 5. Card */
/* The changelog filter bar's treatment: a white card lifted over the masthead's bottom edge. */
.dp-main {
    flex: 1;
    padding-bottom: var(--dp-space-7);
}

.dp-card {
    position: relative;
    z-index: 2;
    margin: -3.25rem auto 0;
    padding: 1.75rem;
    background: #ffffff;
    border: 1px solid var(--dp-rule);
    border-radius: var(--dp-radius);
    box-shadow: var(--dp-shadow);
}

.dp-main--narrow .dp-card {
    max-width: 460px;
}

.dp-main--wide .dp-card {
    max-width: 960px;
}

/* --------------------------------------------------- 6. Type and notices */
.dp-prose {
    margin: 0 0 var(--dp-space-4);
    color: var(--dp-ink);
}

.dp-prose-dim {
    color: var(--dp-ink-dim);
    font-size: 0.92rem;
}

/* Success and information: the sky panel with a cool left rule. */
.dp-notice {
    margin: 0 0 var(--dp-space-5);
    padding: var(--dp-space-3) var(--dp-space-4);
    border-radius: var(--dp-radius);
    border-left: 4px solid var(--dp-cool);
    background: var(--dp-sky);
    color: var(--dp-navy);
    font-size: 0.92rem;
}

.dp-notice--success {
    border-left-color: var(--dp-green);
}

/* Warnings and errors: the site's .fn-action callout, orange wash with an orange rule. */
.dp-notice--warn,
.dp-notice--error {
    background: var(--dp-accent-wash);
    border-left-color: var(--dp-accent);
}

.dp-notice--error {
    border-left-color: var(--dp-red);
}

/* ---------------------------------------------------- 7. Form controls */
.dp-form {
    display: flex;
    flex-direction: column;
    gap: var(--dp-space-4);
}

.dp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dp-field[hidden] {
    display: none;
}

.dp-field__label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dp-navy);
}

.dp-input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--dp-rule);
    border-radius: var(--dp-radius);
    background: #ffffff;
    color: var(--dp-ink);
    font: inherit;
    font-size: 16px; /* 16px stops iOS Safari zooming the page on focus. */
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.dp-input:hover {
    border-color: var(--dp-hero-faint);
}

.dp-input:focus {
    outline: none;
    border-color: var(--dp-accent);
    box-shadow: 0 0 0 3px rgba(242, 103, 34, 0.18);
}

.dp-input[readonly] {
    background: var(--dp-sky);
}

.dp-input--invalid,
.dp-input--invalid:hover {
    border-color: var(--dp-red);
}

.dp-field__error {
    color: var(--dp-red);
    font-size: 0.82rem;
    font-weight: 700;
}

.dp-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.92rem;
    color: var(--dp-ink);
    cursor: pointer;
}

.dp-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--dp-accent);
    cursor: pointer;
}

/* An input and a button sharing one row, e.g. a copyable URL. */
.dp-input-group {
    display: flex;
    gap: var(--dp-space-2);
}

.dp-input-group .dp-input {
    flex: 1;
    min-width: 0;
}

/* ------------------------------------------------- 8. Buttons and links */
/* The changelog's .cl-btn: pills, weight 700, a 2px lift on hover. */
.dp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    padding: 0.7rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.dp-btn--primary {
    background: var(--dp-accent);
    color: #ffffff;
}

.dp-btn--primary:hover:not(:disabled) {
    background: var(--dp-accent-dark);
}

.dp-btn--outline {
    background: transparent;
    color: var(--dp-navy);
    border-color: var(--dp-rule);
}

.dp-btn--outline:hover:not(:disabled) {
    border-color: var(--dp-accent);
    color: var(--dp-accent-dark);
}

.dp-btn--block {
    width: 100%;
}

.dp-btn:disabled {
    cursor: default;
    opacity: 0.75;
}

@media (prefers-reduced-motion: no-preference) {
    .dp-btn:hover:not(:disabled) {
        transform: translateY(-2px);
    }
}

.dp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dp-space-3) var(--dp-space-5);
}

/* Secondary links under a form, separated by a rule like the changelog's impact strip. */
.dp-secondary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--dp-space-3);
    margin-top: var(--dp-space-2);
    padding-top: var(--dp-space-4);
    border-top: 1px solid var(--dp-rule);
    font-size: 0.92rem;
}

a {
    color: var(--dp-link);
    font-weight: 600;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a.dp-btn:hover {
    text-decoration: none;
}

/* The site's .text-link: bold orange with a trailing arrow. */
.dp-text-link {
    font-weight: 700;
}

.dp-text-link::after {
    content: " \2192";
}

/* A button that reads as a link, for inline form submits. */
.dp-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--dp-link);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

a:focus-visible,
button:focus-visible,
.dp-check input:focus-visible {
    outline: 2px solid var(--dp-accent);
    outline-offset: 2px;
}

/* ------------------------------------------------------------ 9. Footer */
.dp-footer {
    border-top: 1px solid var(--dp-rule);
    background: var(--dp-sky);
    font-size: 0.82rem;
    color: var(--dp-ink-dim);
}

.dp-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--dp-space-3);
    padding-top: var(--dp-space-4);
    padding-bottom: calc(var(--dp-space-4) + env(safe-area-inset-bottom, 0px));
}

.dp-footer__links {
    display: flex;
    gap: var(--dp-space-5);
}

.dp-footer a {
    color: var(--dp-navy);
}

.dp-footer__version {
    font-family: var(--dp-font-mono);
}

/* ------------------------------------------ 10. Sign-in stage (login) */
/*
 * The one dark screen. Sign-in is the middle of a three-screen sequence (the client's login, this form,
 * then the client's auth callback), and the other two are full-bleed on #071a26 with no chrome, so this
 * page drops the top bar, masthead and card and draws the same orbit as those two (same viewBox, radii,
 * stroke widths and arc colors), one state further along: the client's satellites have gone and the arcs
 * have not yet reached the callback's working speed.
 *
 * The arcs are meters, not decoration: login.blade.php writes their dash lengths as the email (blue) and
 * password (orange) fields fill, and on submit adds .dp-launching to <body>, which hands them to the
 * callback's exact dasharrays and speeds. Nothing rotates until then, so movement on this screen always
 * means the user caused it. Everything here is scoped to body.dp-stage-body (layouts/stage.blade.php).
 */
.dp-stage-body {
    --dp-stage-ground: #071a26;
    --dp-stage-blue: #4f9ae8;
    --dp-stage-orange: #e5411a;
    --dp-stage-dim: rgba(157, 180, 196, 0.18);
    --dp-stage-ink: #eaf2f8;
    --dp-stage-ink-soft: #d6e3ec;

    color-scheme: dark;
    background: var(--dp-stage-ground);
    color: var(--dp-stage-ink-soft);
    font-size: 14px;
    line-height: 1.5;
}

.dp-stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 6vw, 48px);
    padding-bottom: clamp(72px, 12vw, 96px);
    overflow: hidden;
}

.dp-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 34%, rgba(79, 154, 232, 0.16), transparent 62%);
    pointer-events: none;
}

.dp-stage__stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dp-stage__stars i {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(214, 227, 236, 0.5);
    left: calc(var(--i) * 5.5% + 3%);
    top: calc(var(--i) * 4.7% + 4%);
    animation: dp-stage-drift calc(7s + var(--i) * 0.7s) ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * -0.4s);
}

@keyframes dp-stage-drift {
    from {
        transform: translate3d(0, 0, 0);
        opacity: 0.25;
    }
    to {
        transform: translate3d(14px, -20px, 0);
        opacity: 0.85;
    }
}

.dp-stage__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 4vw, 26px);
    width: min(420px, 100%);
}

/* Sized between the client login's orbit and the callback's, and lands on the callback's on submit. */
.dp-orbit {
    position: relative;
    width: clamp(132px, 38vw, 176px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    transition: width 820ms cubic-bezier(0.65, 0, 0.35, 1);
}

.dp-launching .dp-orbit {
    width: clamp(104px, 34vw, 148px);
}

.dp-orbit svg {
    display: block;
    width: 100%;
    height: 100%;
}

.dp-orbit__ring {
    fill: none;
    stroke: var(--dp-stage-dim);
    stroke-width: 2;
}

.dp-orbit__arc {
    fill: none;
    stroke-linecap: round;
    transform-origin: 50% 50%;
    /* Grows from 12 o'clock rather than 3, which is where a reader looks for the start of a dial. */
    transform: rotate(-90deg);
    /* Short enough to feel per-keystroke, long enough not to jitter while typing quickly. */
    transition: stroke-dasharray 200ms cubic-bezier(0.33, 1, 0.68, 1);
}

/* Empty state. The round linecap leaves a faint dot, so the track never looks broken. */
.dp-orbit__arc--fast {
    stroke: var(--dp-stage-blue);
    stroke-width: 3;
    stroke-dasharray: 0 263.9;
}

.dp-orbit__arc--slow {
    stroke: var(--dp-stage-orange);
    stroke-width: 2;
    stroke-dasharray: 0 207.4;
}

.dp-launching .dp-orbit__arc {
    transition: stroke-dasharray 820ms cubic-bezier(0.65, 0, 0.35, 1);
}

.dp-launching .dp-orbit__arc--fast {
    stroke-dasharray: 66 234;
    animation: dp-orbit-spin 1.15s linear infinite;
}

.dp-launching .dp-orbit__arc--slow {
    stroke-dasharray: 26 214;
    animation: dp-orbit-spin-back 2.4s linear infinite;
}

@keyframes dp-orbit-spin {
    from {
        transform: rotate(-90deg);
    }
    to {
        transform: rotate(270deg);
    }
}

@keyframes dp-orbit-spin-back {
    from {
        transform: rotate(-90deg);
    }
    to {
        transform: rotate(-450deg);
    }
}

.dp-orbit__mark {
    position: absolute;
    font-size: clamp(12px, 3.4vw, 15px);
    font-weight: 700;
    letter-spacing: 0.24em;
    text-indent: 0.24em; /* The tracking adds a trailing gap; the indent re-centers the word. */
    color: var(--dp-stage-ink);
}

.dp-stage__status {
    margin: 0;
    color: var(--dp-stage-ink-soft);
    font-size: clamp(15px, 4vw, 20px);
    font-weight: 500;
    text-align: center;
}

.dp-stage__notice {
    margin: 0;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(79, 154, 232, 0.14);
    color: var(--dp-stage-ink);
    font-size: 13px;
    text-align: center;
}

.dp-stage__panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    transition:
        opacity 420ms ease,
        transform 620ms cubic-bezier(0.65, 0, 0.35, 1);
}

.dp-launching .dp-stage__panel {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    pointer-events: none;
}

.dp-stage__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dp-stage__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(214, 227, 236, 0.66);
}

.dp-stage__input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(157, 180, 196, 0.24);
    border-radius: 12px;
    background: rgba(157, 180, 196, 0.08);
    color: var(--dp-stage-ink);
    font: inherit;
    font-size: 16px; /* 16px stops iOS Safari zooming the page on focus. */
    transition:
        border-color 180ms ease,
        background 180ms ease;
}

.dp-stage__input:focus {
    outline: none;
    border-color: var(--dp-stage-blue);
    background: rgba(79, 154, 232, 0.1);
}

.dp-stage__input--invalid {
    border-color: var(--dp-stage-orange);
}

.dp-stage__error {
    color: #ff8a6a;
    font-size: 12px;
    font-weight: 600;
}

.dp-stage__remember {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--dp-stage-ink-soft);
    cursor: pointer;
}

.dp-stage__remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--dp-stage-blue);
    cursor: pointer;
}

.dp-stage__action {
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition:
        transform 160ms ease,
        background 200ms ease,
        box-shadow 200ms ease;
}

.dp-stage__action--primary {
    background: linear-gradient(135deg, var(--dp-stage-blue), #2f7fd0);
    color: #05131c;
    font-size: clamp(15px, 4vw, 17px);
    letter-spacing: 0.02em;
    box-shadow: 0 10px 26px rgba(79, 154, 232, 0.28);
}

.dp-stage__action--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(79, 154, 232, 0.42);
}

.dp-stage__action--primary:active:not(:disabled) {
    transform: translateY(0);
}

.dp-stage__action:disabled {
    cursor: default;
}

.dp-stage__secondary {
    display: flex;
    gap: 14px;
}

.dp-stage__action--ghost {
    flex: 1;
    background: rgba(157, 180, 196, 0.1);
    color: var(--dp-stage-ink-soft);
    font-size: clamp(13px, 3.4vw, 14px);
}

.dp-stage__action--ghost:hover {
    background: rgba(157, 180, 196, 0.2);
    color: var(--dp-stage-ink);
}

.dp-stage__action:focus-visible {
    outline: 2px solid var(--dp-stage-blue);
    outline-offset: 3px;
}

.dp-stage__footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 5vw, 32px);
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    font-size: 12px;
    color: rgba(214, 227, 236, 0.52);
}

.dp-stage__footer a {
    color: rgba(214, 227, 236, 0.72);
    text-decoration: none;
}

.dp-stage__footer a:hover {
    color: var(--dp-stage-ink);
    text-decoration: underline;
}

/* ------------------------------- 11. Small screens and reduced motion */
@media (max-width: 720px) {
    .dp-hero {
        padding: 2.5rem 0 5rem;
    }

    .dp-card {
        margin-top: -2.5rem;
        padding: 1.25rem;
    }

    .dp-wrap {
        padding: 0 var(--dp-space-4);
    }
}

/* Below ~360px the two ghost links stop fitting side by side. */
@media (max-width: 360px) {
    .dp-stage__secondary {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Held rather than spinning, matching the callback. The commit is still visible. */
    .dp-stage__stars i,
    .dp-launching .dp-orbit__arc--fast,
    .dp-launching .dp-orbit__arc--slow {
        animation: none;
    }

    .dp-orbit,
    .dp-orbit__arc,
    .dp-stage__panel,
    .dp-btn,
    .dp-input {
        transition-duration: 1ms;
    }
}
