/*
 * THE AUTH SHELL THE TWO DECISION PAGES SHARE - one copy, applied not designed.
 *
 * The consent page and the decision page are the same kind of page: a person already signed in to Crolle doing one
 * thing. Each carried its own copy of these rules, because Blazor CSS isolation scopes a stylesheet to its own
 * component and there is no way for two components to share one - 555 identical lines in two files, one of them
 * made by copying the other, which is a change to one page silently not reaching the other.
 *
 * They are global instead. That is safe rather than merely convenient: every OTHER page that shows these elements
 * already carries its own scoped copy, and a scoped rule (.signin-panel[b-xxxx]) always beats an unscoped one, so
 * nothing outside these two pages can change. Only what belongs to one page stays in that page's own stylesheet.
 *
 * A Claude Design pass for both pages is still owed.
 */

.auth-page {
    --auth-paper: #f4f3ef;
    --auth-ink: #0b0d10;
    --auth-muted: #5f646c;
    --auth-line: #c9c8c3;
    --auth-line-strong: #9d9e9b;
    --auth-accent: #007a66;
    --auth-accent-deep: #005e50;
    --auth-danger: #a22b32;
    --auth-white: #fff;
    --auth-focus: #00a88a;

    min-width: 320px;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(360px, 43%) minmax(0, 57%);
    overflow-x: hidden;
    color: var(--auth-ink);
    background: var(--auth-paper);
    font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

.auth-page button,
.auth-page input,
.auth-page a {
    color: inherit;
    font: inherit;
}

.auth-page a:focus-visible,
.auth-page button:focus-visible,
.auth-page input:focus-visible,
.skip-link:focus-visible {
    outline: 3px solid var(--auth-focus);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    padding: 10px 14px;
    color: #fff;
    background: #0b0d10;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* ── the brand side ─────────────────────────────────────────────────────────────────────────────────────────── */
.brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    padding: 48px 44px;
    color: #f2f1ec;
    background: linear-gradient(160deg, #10151a 0%, #0b0d10 60%, #0d1512 100%);
}

.brand-wordmark {
    /* THE WORDMARK, as the website and the welcome email set it: IBM Plex Sans, weight 650, tight negative tracking,
       and the orange full stop. The email states it as -3.2px at 42px; written as a ratio here so it holds at any
       size. IBM Plex is already self-hosted for every page, so this costs no request. */
    font-family: 'IBM Plex Sans', Arial, sans-serif;
    font-size: 25px;
    line-height: 1;
    font-weight: 650;
    letter-spacing: -0.076em;
    font-synthesis: none;
    text-decoration: none;
}

.brand-wordmark-dot {
    color: #ed895e;
}

.brand-message {
    display: grid;
    gap: 14px;
}

.eyebrow {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8fb9ae;
}

.brand-title {
    margin: 0;
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 600;
    line-height: 1.15;
    text-wrap: balance;
}

.brand-copy {
    margin: 0;
    max-width: 46ch;
    font-size: 0.975rem;
    line-height: 1.6;
    color: #b9bcbb;
}

.signin-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: baseline;
    font-size: 0.8rem;
    color: #8b8f8e;
}

.signin-footer p {
    margin: 0;
}

/* ── the form side ──────────────────────────────────────────────────────────────────────────────────────────── */
.signin-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
}

.signin-card {
    width: 100%;
    max-width: 27rem;
    display: grid;
    gap: 20px;
}

.signin-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.2;
}

.signin-subtitle {
    margin: 0;
    font-size: 0.925rem;
    line-height: 1.55;
    color: var(--auth-muted);
}

.signin-error,
.signin-note {
    margin: 0;
    padding: 12px 14px;
    font-size: 0.875rem;
    line-height: 1.5;
    border-left: 3px solid var(--auth-danger);
    background: var(--auth-white);
}

.signin-note {
    border-left-color: var(--auth-line-strong);
    color: var(--auth-muted);
}

.signin-form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.field input {
    width: 100%;
    padding: 11px 13px;
    color: var(--auth-ink);
    background: var(--auth-white);
    border: 1px solid var(--auth-line);
    border-radius: 2px;
    transition: border-color 120ms ease;
}

.field input::placeholder {
    color: #9a9ea3;
}

.field input:hover {
    border-color: #a9a8a3;
}

.field input:focus {
    border-color: var(--auth-accent);
    outline-offset: 2px;
}

.submit-button {
    margin-top: 4px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--auth-white);
    background: var(--auth-accent);
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.submit-button:hover {
    background: var(--auth-accent-deep);
}

.submit-button:disabled {
    cursor: default;
    background: #7fa39b;
}

.access-note {
    margin: 0;
    padding-top: 4px;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--auth-muted);
    border-top: 1px solid var(--auth-line);
}

.access-note strong {
    display: block;
    color: var(--auth-ink);
}

/* ── narrow screens: the brand panel becomes a header, the form takes the width ──────────────────────────────── */
@media (max-width: 980px) {
    .auth-page {
        grid-template-columns: minmax(0, 1fr);
    }

    .brand-panel {
        gap: 28px;
        padding: 32px 28px;
    }

    .signin-footer {
        display: none;
    }
}

@media (max-width: 720px) {
    .brand-panel {
        padding: 24px 20px;
    }

    .brand-title {
        font-size: 1.5rem;
    }

    .brand-copy {
        font-size: 0.9rem;
    }

    .signin-panel {
        padding: 28px 20px 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        transition-duration: 0.01ms !important;
    }
}

/* ── what only the decision page has ────────────────────────────────────────────────────────────────────────── */
.decision-card {
    max-width: 40rem;
}

.decision-text {
    margin: 0;
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--auth-white);
    border: 1px solid var(--auth-line);
    border-radius: 2px;
}

.decision-rows {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--auth-white);
}

.decision-rows th,
.decision-rows td {
    padding: 9px 12px;
    text-align: start;
    vertical-align: top;
    border-bottom: 1px solid var(--auth-line);
    overflow-wrap: anywhere;
}

.decision-rows th {
    width: 38%;
    font-weight: 600;
    color: var(--auth-muted);
}

.decision-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 16px;
    margin: 0;
    font-size: 0.875rem;
}

.decision-facts dt {
    font-weight: 600;
    color: var(--auth-muted);
}

.decision-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.decision-entries {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-inline-start: 1.4rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.decision-entry-ref {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--auth-muted);
    overflow-wrap: anywhere;
}

.decision-entry-text {
    display: block;
    overflow-wrap: anywhere;
}

.decision-entry-plan {
    display: block;
    font-size: 0.8125rem;
    color: var(--auth-muted);
}

.decision-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.decision-actions .submit-button,
.decline-button {
    flex: 1 1 10rem;
    margin-top: 0;
}

.decline-button {
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--auth-danger);
    background: var(--auth-white);
    border: 1px solid var(--auth-danger);
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.decline-button:hover {
    background: #f7eaeb;
}

/* ── a change as its table: the working space goes to the table ───────────────────────────────────────────────── */
.auth-page.decision-wide {
    grid-template-columns: minmax(220px, 20%) minmax(0, 80%);
}

.decision-wide .brand-panel {
    gap: 28px;
    padding: 32px 26px;
}

.decision-wide .brand-title {
    font-size: 1.35rem;
}

.decision-wide .brand-copy {
    font-size: 0.85rem;
}

.decision-wide .signin-panel {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 36px 32px;
}

.decision-wide .decision-card {
    max-width: none;
}

.decision-summary {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.decision-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    background: var(--auth-white);
    border: 1px solid var(--auth-line);
    border-radius: 2px;
}

.decision-table-scroll:focus-visible {
    outline: 3px solid var(--auth-focus);
    outline-offset: 3px;
}

.decision-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.45;
}

.decision-table th,
.decision-table td {
    padding: 8px 12px;
    text-align: start;
    vertical-align: top;
    border-bottom: 1px solid var(--auth-line);
    overflow-wrap: anywhere;
}

.decision-table thead th {
    position: sticky;
    top: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-muted);
    white-space: nowrap;
    background: var(--auth-paper);
    border-bottom: 1px solid var(--auth-line-strong);
}

.decision-table tbody th {
    font-weight: 600;
}

.decision-record th {
    width: 32%;
    color: var(--auth-muted);
}

.decision-row-action,
.decision-outcome {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--auth-muted);
}

.decision-row-context {
    margin-top: 4px;
    font-size: 0.8125rem;
}

.decision-row-context dt,
.decision-row-context dd {
    font-weight: 400;
}

.decision-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
}

.decision-field {
    color: var(--auth-muted);
    white-space: nowrap;
}

.decision-muted {
    color: var(--auth-muted);
}

.decision-blank {
    font-style: italic;
    color: var(--auth-muted);
}

.decision-items {
    margin: 4px 0 0;
    padding-inline-start: 1.1rem;
}

.decision-row-details td {
    padding-top: 0;
}

.decision-details summary {
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--auth-accent-deep);
}

.decision-details .decision-facts {
    margin-top: 6px;
    font-size: 0.8125rem;
}

@media (max-width: 980px) {
    .auth-page.decision-wide {
        grid-template-columns: minmax(0, 1fr);
    }

    .decision-wide .signin-panel {
        padding: 24px 16px 40px;
    }
}
