/* MonoDispatch brand tokens, copied from frontend/src/app/globals.css (light and dark). */

@font-face {
    font-family: "Satoshi";
    src: url("../fonts/Satoshi-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Satoshi";
    src: url("../fonts/Satoshi-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Satoshi";
    src: url("../fonts/Satoshi-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --background: oklch(0.98 0.006 240);
    --foreground: oklch(0.18 0.008 240);
    --card: oklch(0.995 0.004 240);
    --primary: oklch(0.12 0.06 250);
    --primary-foreground: oklch(0.99 0 0);
    --muted: oklch(0.86 0.022 240);
    --muted-foreground: oklch(0.44 0.012 240);
    --destructive: oklch(0.577 0.245 27.325);
    --border: oklch(0.86 0.015 240);
    --input: oklch(0.88 0.015 240);
    --ring: oklch(0.3 0.13 250);
    --radius: 0.625rem;
    --brand-mark-grad-start: oklch(0.12 0.06 250);
    --brand-mark-grad-end: oklch(0.38 0.16 245);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --background: oklch(0.16 0.015 250);
        --foreground: oklch(0.96 0.005 250);
        --card: oklch(0.21 0.015 250);
        --primary: oklch(0.78 0.13 235);
        --primary-foreground: oklch(0.13 0.02 250);
        --muted: oklch(0.27 0.02 245);
        --muted-foreground: oklch(0.72 0.012 250);
        --destructive: oklch(0.704 0.191 22.216);
        --border: oklch(1 0 0 / 10%);
        --input: oklch(1 0 0 / 14%);
        --ring: oklch(0.78 0.13 235);
        --brand-mark-grad-start: oklch(0.78 0.13 235);
        --brand-mark-grad-end: oklch(0.92 0.1 225);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
}

body {
    min-height: 100vh;
    background: var(--background);
    color: var(--foreground);
    font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
}

.shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.stack {
    display: flex;
    width: 100%;
    max-width: 24rem;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.brand {
    display: inline-flex;
    color: var(--foreground);
}

.brand-mark {
    height: 2.25rem;
    width: auto;
}

.brand-mark-start {
    stop-color: var(--brand-mark-grad-start);
}

.brand-mark-end {
    stop-color: var(--brand-mark-grad-end);
}

.card {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    padding: 2rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%);
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1.5rem;
}

h1 {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 400;
    line-height: 2.5rem;
    letter-spacing: -0.025em;
}

.subtitle,
.muted {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.notice {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: color-mix(in oklch, var(--muted) 40%, transparent);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
}

label.required::after {
    content: " *";
    color: var(--destructive);
}

input {
    width: 100%;
    height: 2.5rem;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    padding: 0.25rem 0.75rem;
    color: inherit;
    font: inherit;
    /* 16px keeps iOS Safari from zooming into the field on the driver sheet. */
    font-size: 1rem;
    outline: none;
    transition: border-color 120ms, box-shadow 120ms;
}

input::placeholder {
    color: var(--muted-foreground);
}

input:focus-visible {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 35%, transparent);
}

input[aria-invalid="true"] {
    border-color: var(--destructive);
}

.field-error {
    display: block;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--destructive);
}

.field-error:empty {
    display: none;
}

.button {
    display: inline-flex;
    width: 100%;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 2px);
    background: var(--primary);
    color: var(--primary-foreground);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    opacity: 0.9;
}

.button:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.button-secondary {
    border-color: var(--border);
    background: transparent;
    color: var(--foreground);
}

.form-error {
    margin: 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--destructive);
}

.form-error:empty {
    display: none;
}

.form-link {
    margin: 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Company choice: one button per company, the name left-aligned and cut with an ellipsis when long. */
.choices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.choice {
    display: block;
    margin-top: 0;
    padding: 0 0.75rem;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 2.375rem;
}

.choice:hover {
    background: color-mix(in oklch, var(--muted) 40%, transparent);
    opacity: 1;
}

@media (max-width: 480px) {
    .card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
}
