:root {
    color-scheme: light;
    --ink: #000000;
    --muted: #43566f;
    --surface: #ffffff;
    --surface-soft: #eef5ff;
    --surface-blue: #d6e8ff;
    --line: #a2b6df;
    --brand: #003d8f;
    --brand-deep: #002352;
    --brand-light: #85baff;
    --accent: #ffdc85;
    --focus: #003d8f;
    --shadow: 0 18px 50px rgba(0, 35, 82, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--surface-soft);
    line-height: 1.55;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 90% 0%, rgba(255, 220, 133, 0.28), transparent 28rem),
        radial-gradient(circle at 0% 45%, rgba(133, 186, 255, 0.17), transparent 34rem),
        var(--surface-soft);
}

::selection {
    color: #fff;
    background: var(--brand);
}

a {
    color: inherit;
}

a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10;
    padding: 0.65rem 1rem;
    color: #fff;
    background: var(--brand-deep);
    border-radius: 0.35rem;
    transform: translateY(-180%);
}

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

.shell {
    width: min(70rem, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    color: #fff;
    background: var(--brand-deep);
    border-bottom: 3px solid var(--accent);
}

.header-inner {
    min-height: 4.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.2rem;
    font-weight: 720;
    text-decoration: none;
}

.brand-icon {
    width: 2rem;
    height: 2rem;
    color: var(--accent);
}

.environment-badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
}

.account-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.account-nav a {
    font-weight: 700;
    text-underline-offset: 0.2em;
}

.main-content {
    padding-block: clamp(2.5rem, 7vw, 5.5rem);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.7fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 5rem);
    padding-bottom: clamp(3rem, 7vw, 5rem);
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 17ch;
    margin-bottom: 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.3rem, 6vw, 4.7rem);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.035em;
}

h2 {
    margin-bottom: 1.35rem;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1.2;
}

h3 {
    margin-bottom: 0.55rem;
    font-size: 1.08rem;
}

.lead {
    max-width: 59ch;
    margin-bottom: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.18rem);
}

.status-panel {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.35rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.status-panel strong,
.status-panel span {
    display: block;
}

.status-panel span {
    color: var(--muted);
    font-size: 0.88rem;
}

.status-dot {
    flex: 0 0 auto;
    width: 0.8rem;
    height: 0.8rem;
    background: #2f8a5d;
    border: 3px solid #d7eee1;
    border-radius: 50%;
    box-sizing: content-box;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.card {
    min-height: 13rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.8rem;
}

.card p {
    margin-bottom: 0;
    color: var(--muted);
}

.card-icon {
    width: 2rem;
    height: 2rem;
    margin-bottom: 1.15rem;
    color: var(--brand);
}

.roadmap {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(18rem, 1.2fr);
    gap: 2rem;
    margin-top: clamp(3rem, 7vw, 5rem);
    padding: clamp(1.5rem, 5vw, 3rem);
    color: #fff;
    background: var(--brand-deep);
    border-radius: 1rem;
}

.roadmap .eyebrow {
    color: var(--accent);
}

.roadmap ol {
    margin: 0;
    padding-left: 1.5rem;
}

.roadmap li + li {
    margin-top: 0.7rem;
}

.error-panel {
    max-width: 42rem;
    padding: clamp(1.5rem, 5vw, 3rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.error-panel h1 {
    font-size: clamp(2rem, 5vw, 3.6rem);
}

.request-id {
    display: inline-block;
    padding: 0.55rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.83rem;
    background: var(--surface-soft);
    border-radius: 0.35rem;
}

.site-footer {
    padding-block: 1.5rem 2.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.primary-action {
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.7rem 1.15rem;
    color: #fff;
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    background: var(--brand);
    border: 2px solid var(--brand);
    border-radius: 0.45rem;
    cursor: pointer;
}

.button:hover {
    background: var(--brand-deep);
    border-color: var(--brand-deep);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.button-secondary {
    color: var(--brand-deep);
    background: #fff;
    border-color: var(--brand);
}

.button-secondary:hover {
    color: #fff;
    background: var(--brand-deep);
    border-color: var(--brand-deep);
}

.button-danger {
    background: #8b2f2f;
    border-color: #8b2f2f;
}

.button-danger:hover {
    background: #621e1e;
    border-color: #621e1e;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: min(42rem, calc(100vh - 15rem));
}

.auth-card,
.settings-card {
    width: min(100%, 32rem);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.auth-card-wide {
    width: min(100%, 42rem);
}

.auth-card h1,
.page-heading h1,
.portal-heading h1 {
    max-width: none;
    font-size: clamp(2rem, 5vw, 3.35rem);
}

.form-intro {
    margin-bottom: 1.5rem;
    color: var(--muted);
}

form label {
    display: block;
    margin: 1rem 0 0.35rem;
    font-weight: 700;
}

form input,
form select {
    width: 100%;
    min-height: 3rem;
    padding: 0.65rem 0.75rem;
    color: var(--ink);
    font: inherit;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.4rem;
}

form select {
    appearance: auto;
}

form .button {
    margin-top: 1.35rem;
}

.code-input {
    max-width: 14rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.25rem;
    letter-spacing: 0.18em;
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    margin: 1rem 0 1.5rem;
    padding: 0.85rem 1rem;
    color: var(--brand-deep);
    background: var(--surface-blue);
    border: 1px solid var(--brand-light);
    border-left-width: 4px;
    border-radius: 0.35rem;
}

.notice-error {
    color: #621e1e;
    background: #fff1f1;
    border-color: #d69292;
}

.notice-success {
    color: #174c32;
    background: #edf8f1;
    border-color: #82bb99;
}

.notice-warning {
    color: #634516;
    background: #fff8e8;
    border-color: #d7b56f;
}

.recovery-panel {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.recovery-panel summary {
    font-weight: 700;
    cursor: pointer;
}

.setup-steps {
    padding-left: 1.4rem;
}

.setup-steps li + li {
    margin-top: 0.55rem;
}

.secret-box {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 0.45rem;
}

.secret-box span,
.secret-box code {
    display: block;
}

.secret-box span {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.secret-box code,
.code-list code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
}

.secret-box code {
    font-size: clamp(0.95rem, 3vw, 1.25rem);
    letter-spacing: 0.08em;
}

.code-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 1rem;
    padding: 0;
    list-style: none;
}

.code-list li {
    padding: 0.55rem;
    text-align: center;
    background: var(--surface-soft);
    border-radius: 0.35rem;
}

.portal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.portal-cards h2 {
    font-size: 1.25rem;
}

.portal-cards p + p {
    margin-top: 0.9rem;
}

.page-heading {
    margin-bottom: 2rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1rem;
}

.settings-card {
    width: auto;
}

.settings-card h2 {
    font-size: 1.45rem;
}

.sessions-card {
    margin-top: 1rem;
}

.customer-form-card {
    width: min(100%, 48rem);
}

.customer-reference {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.field-help {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

fieldset {
    margin: 1.5rem 0 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.45rem;
}

legend {
    padding-inline: 0.35rem;
    font-weight: 750;
}

.checkbox-list {
    display: grid;
    gap: 0.6rem;
}

.checkbox-list label {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 0;
    padding: 0.65rem;
    background: var(--surface-soft);
    border-radius: 0.35rem;
}

.checkbox-list input {
    flex: 0 0 auto;
    width: 1.25rem;
    min-height: 1.25rem;
    margin-top: 0.15rem;
}

.checkbox-list small {
    display: block;
    color: var(--muted);
    font-weight: 400;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-actions .button {
    margin-top: 0;
}

.table-shell {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--brand-deep);
    font-size: 0.84rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    background: var(--surface-blue);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 750;
    border: 1px solid;
    border-radius: 999px;
}

.status-badge-active {
    color: #174c32;
    background: #edf8f1;
    border-color: #82bb99;
}

.status-badge-inactive {
    color: #634516;
    background: #fff8e8;
    border-color: #d7b56f;
}

.status-badge-open {
    color: #003d8f;
    background: #eef5ff;
    border-color: #85baff;
}

.status-badge-completed {
    color: #174c32;
    background: #edf8f1;
    border-color: #82bb99;
}

.status-badge-revoked,
.status-badge-expired {
    color: #621e1e;
    background: #fff1f1;
    border-color: #d69292;
}

.empty-state {
    padding: clamp(1.5rem, 5vw, 2.5rem);
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: 0.8rem;
}

.empty-state h2 {
    margin-bottom: 0.6rem;
    font-size: 1.4rem;
}

.empty-state p {
    margin-bottom: 0;
    color: var(--muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1rem;
}

.metadata-list {
    margin: 0;
}

.metadata-list div {
    display: grid;
    grid-template-columns: minmax(8rem, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    padding-block: 0.7rem;
    border-bottom: 1px solid var(--line);
}

.metadata-list div:last-child {
    border-bottom: 0;
}

.metadata-list dt {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.metadata-list dd {
    margin: 0;
}

.advisor-list {
    padding: 0;
    list-style: none;
}

.advisor-list li {
    padding-block: 0.7rem;
    border-bottom: 1px solid var(--line);
}

.advisor-list strong,
.advisor-list span {
    display: block;
}

.advisor-list span {
    color: var(--muted);
    font-size: 0.88rem;
}

.customer-placeholders {
    margin-top: 1rem;
}

.settings-card-wide {
    width: 100%;
}

.file-request-section {
    margin-top: 1rem;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading h2,
.section-heading p {
    margin-bottom: 0.35rem;
}

.compact-table {
    box-shadow: none;
}

.plain-list,
.file-list {
    padding: 0;
    list-style: none;
}

.plain-list li,
.file-list li {
    padding-block: 0.65rem;
    border-bottom: 1px solid var(--line);
}

.plain-list li:last-child,
.file-list li:last-child {
    border-bottom: 0;
}

.file-list strong,
.file-list span {
    display: block;
    overflow-wrap: anywhere;
}

.file-list span {
    color: var(--muted);
    font-size: 0.88rem;
}

.large-code {
    font-size: clamp(1.25rem, 5vw, 2rem) !important;
    letter-spacing: 0.18em !important;
}

.secret-delivery {
    max-width: 54rem;
}

.upload-end-form {
    margin-top: 1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.session-list {
    padding: 0;
    list-style: none;
}

.session-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.session-list span {
    color: var(--muted);
    font-size: 0.88rem;
    text-align: right;
}

@media (max-width: 760px) {
    .header-inner,
    .hero,
    .roadmap,
    .settings-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding-block: 0.85rem;
    }

    .account-nav {
        margin-left: 0;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .card {
        min-height: auto;
    }

    .portal-heading,
    .section-heading,
    .session-list li {
        align-items: flex-start;
        flex-direction: column;
    }

    .session-list span {
        text-align: left;
    }

    .code-list {
        grid-template-columns: 1fr;
    }

    .table-shell {
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    tbody tr {
        margin-bottom: 0.85rem;
        padding: 0.6rem 1rem;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 0.65rem;
    }

    td {
        display: grid;
        grid-template-columns: minmax(7rem, 0.8fr) minmax(0, 1.2fr);
        gap: 0.8rem;
        padding: 0.65rem 0;
        border-bottom: 1px solid var(--line);
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.8rem;
        font-weight: 750;
        text-transform: uppercase;
    }

    tbody tr:last-child td,
    td:last-child {
        border-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}
