:root {
    --nexus-ink: #111827;
    --nexus-muted: #64748b;
    --nexus-orange: #f59e0b;
    --nexus-orange-dark: #d97706;
    --nexus-panel: #ffffff;
    --nexus-line: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--nexus-ink);
    background: #f8fafc;
    font-family: Arial, sans-serif;
}

.purchase-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
}

.purchase-intro {
    padding: 64px clamp(32px, 7vw, 110px);
    color: #fff;
    background: linear-gradient(145deg, #0f172a, #1e293b);
}

.purchase-logo {
    width: min(294px, 100%);
    height: auto;
}

.purchase-intro h1 {
    max-width: 620px;
    margin-top: 96px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.02;
}

.purchase-intro p {
    max-width: 580px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.6;
}

.intro-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--nexus-orange);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.purchase-panel {
    display: flex;
    align-items: center;
    padding: 44px;
    background: var(--nexus-panel);
}

.purchase-form {
    width: 100%;
}

.eyebrow {
    color: var(--nexus-orange-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h2 {
    margin: 10px 0 8px;
    font-size: 32px;
}

.help,
.field-note {
    color: var(--nexus-muted);
    line-height: 1.5;
}

label,
legend {
    display: block;
    margin-top: 18px;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    margin-top: 7px;
    padding: 13px 14px;
    border: 1px solid var(--nexus-line);
    border-radius: 8px;
    font-size: 16px;
}

fieldset {
    padding: 0;
    border: 0;
}

.delivery-options {
    display: flex;
    gap: 18px;
    margin-top: 9px;
}

.delivery-options label {
    margin: 0;
    font-weight: 400;
}

.delivery-options input {
    width: auto;
}

button,
.button {
    display: inline-block;
    width: 100%;
    margin-top: 24px;
    padding: 14px 18px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--nexus-orange-dark);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.errors,
.notice {
    margin: 18px 0;
    padding: 14px;
    border-radius: 8px;
    line-height: 1.5;
}

.errors {
    color: #991b1b;
    background: #fef2f2;
}

.notice {
    color: #92400e;
    background: #fffbeb;
}

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

.review-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--nexus-line);
}

.portal-privacy {
    color: var(--nexus-muted);
    font-size: 13px;
    line-height: 1.5;
}

.portal-dashboard {
    min-height: 100vh;
    padding: 28px clamp(18px, 4vw, 64px) 56px;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, .16), transparent 32%),
        #f8fafc;
}

.portal-header {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 26px;
}

.portal-header h1 {
    margin: 8px 0;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1;
}

.portal-header p {
    margin: 0;
    color: var(--nexus-muted);
    font-weight: 700;
}

.portal-actions {
    display: flex;
    gap: 10px;
}

.button.slim {
    width: auto;
    margin-top: 0;
}

.ghost-button {
    color: var(--nexus-ink);
    background: #fff;
    border: 1px solid var(--nexus-line);
}

.portal-notice {
    max-width: 920px;
}

.portal-metrics,
.portal-grid {
    display: grid;
    gap: 16px;
}

.portal-metrics {
    grid-template-columns: repeat(6, 1fr);
    margin-bottom: 16px;
}

.portal-metrics article,
.portal-card {
    border: 1px solid var(--nexus-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .06);
}

.portal-metrics article {
    padding: 18px;
}

.portal-metrics span {
    display: block;
    color: var(--nexus-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-metrics strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

.portal-card {
    padding: 24px;
}

.portal-card h2 {
    margin-bottom: 18px;
}

.portal-wide {
    margin-top: 16px;
}

.portal-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-heading a {
    color: var(--nexus-orange-dark);
    font-weight: 800;
    text-decoration: none;
}

.portal-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.portal-list div,
.portal-records > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--nexus-line);
}

.portal-list dt,
.portal-records small {
    color: var(--nexus-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-list dd {
    margin: 4px 0 0;
    font-weight: 800;
}

.portal-records strong,
.portal-records small {
    display: block;
}

.portal-records b {
    white-space: nowrap;
}

.portal-table-wrap {
    overflow-x: auto;
}

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

.portal-table th,
.portal-table td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--nexus-line);
    text-align: left;
    white-space: nowrap;
}

.portal-table th {
    color: var(--nexus-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.portal-case-form {
    display: grid;
    gap: 12px;
}

.portal-case-form label {
    margin-top: 0;
}

.portal-case-form select,
.portal-case-form textarea {
    width: 100%;
    margin-top: 7px;
    padding: 13px 14px;
    border: 1px solid var(--nexus-line);
    border-radius: 8px;
    font: inherit;
}

.portal-case-form textarea {
    resize: vertical;
}

.portal-inline-actions {
    display: flex;
    gap: 6px;
}

.portal-inline-actions form {
    display: inline;
}

.portal-inline-actions button {
    width: auto;
    margin: 0;
    padding: 8px 10px;
    font-size: 12px;
}

.receipt-card {
    max-width: 780px;
    margin: 40px auto;
}

@media print {
    body {
        background: #fff;
    }

    .portal-dashboard {
        padding: 0;
        background: #fff;
    }

    .receipt-card {
        box-shadow: none;
        border: 0;
    }

    .receipt-card button {
        display: none;
    }
}

@media (max-width: 860px) {
    .purchase-shell {
        display: block;
    }

    .purchase-intro {
        padding: 32px 24px;
    }

    .purchase-intro h1 {
        margin-top: 42px;
        font-size: 42px;
    }

    .purchase-panel {
        padding: 32px 24px;
    }

    .portal-header,
    .portal-metrics,
    .portal-grid {
        grid-template-columns: 1fr;
    }

    .portal-actions {
        flex-wrap: wrap;
    }
}
