/* Public checkout and staff portal */
.portal-page {
    --ink: #132745;
    --muted: #4d627e;
    --line: #d6e0ee;
    --paper: #f3f7fc;
    --blue: #174ebc;
    --dark: #122341;
    min-height: 100vh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.55 "Segoe UI", system-ui, sans-serif;
}
.portal-page *, .portal-page *::before, .portal-page *::after { box-sizing: border-box; }
.portal-page a { color: var(--blue); text-underline-offset: .18em; }
.portal-page :is(a, button, input, textarea, select, summary, .portal-table-wrap):focus-visible { outline: 3px solid #357cec; outline-offset: 3px; }
.portal-page h1, .portal-page h2, .portal-page h3 { margin: 0 0 .45em; line-height: 1.12; text-wrap: balance; }
.portal-page h1 { font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.042em; }
.portal-page h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); letter-spacing: -.022em; }
.portal-page h3 { font-size: 1.08rem; }
.portal-page p { margin: 0 0 .8em; }
.portal-page :is(input, button, select, textarea) { font: inherit; }
.portal-shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
main.portal-shell { padding-block: clamp(32px, 6vw, 68px); }
.portal-header { background: var(--dark); color: #f4f8ff; border-bottom: 1px solid #334b6d; }
.portal-header > .portal-shell, .portal-header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; }
.portal-header a { color: #eff6ff; }
.portal-brand { display: inline-flex; align-items: center; min-height: 44px; color: inherit; font-weight: 750; text-decoration: none; letter-spacing: -.02em; }
.portal-brand::before { content: "</>"; padding: 1px 6px; margin-right: 9px; color: #c8ecff; border: 1px solid #668bb9; border-radius: 6px; font: 700 .8rem/1.6 monospace; }
.portal-page .portal-skip { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 10px 15px; border-radius: 6px; background: #fff; transform: translateY(-150%); }
.portal-page .portal-skip:focus { transform: translateY(0); }
.portal-header .portal-actions { margin-block: 8px; }
.portal-nav, .portal-dashboard-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.portal-nav a, .portal-dashboard-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .92rem; font-weight: 650; }
.portal-dashboard-nav { gap: 4px 6px; margin: 18px 0 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.portal-dashboard-nav a { padding-inline: 10px; border-radius: 6px; }
.portal-dashboard-nav a[aria-current="page"] { background: #e8f1ff; color: var(--ink); font-weight: 750; text-decoration-thickness: 2px; }
.portal-intro { margin: 0 0 26px; max-width: 70ch; }
.portal-card {
    min-width: 0;
    margin-block: 18px;
    padding: clamp(18px, 4.5vw, 32px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgb(24 54 102 / .06);
    scroll-margin-top: 24px;
}
.portal-auth, .portal-narrow { max-width: 650px; }
.portal-card > :last-child { margin-bottom: 0; }
.portal-muted, .portal-meta, .portal-help { color: var(--muted); }
.portal-meta, .portal-help { font-size: .88rem; }
.portal-status { display: inline-block; padding: 4px 9px; border-radius: 6px; background: #e8f1ff; color: #224982; font-size: .85rem; }
.portal-status-error { background: #fff0f1; color: #721721; }
.portal-form { display: grid; gap: 14px; }
.portal-field { min-width: 0; display: grid; gap: 5px; }
.portal-page label { font-weight: 620; }
.portal-field > span { display: block; }
.portal-page :is(input:not([type=checkbox], [type=radio], [type=hidden]), textarea, select) {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid #9cafc7;
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
}
.portal-page :is(input, textarea)::placeholder { color: #62728a; }
.portal-page textarea { min-height: 86px; resize: vertical; }
.portal-check { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.portal-page input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.portal-grid, .portal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; align-items: start; }
.portal-stack > * + * { margin-top: 14px; }
.portal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.portal-page .portal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    padding: 8px 15px;
    border: 1px solid var(--blue);
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
.portal-page .portal-button:hover { background: #123e95; }
.portal-page .portal-button-secondary { background: #fff; color: var(--blue); }
.portal-page .portal-button-secondary:hover { background: #e9f2ff; }
.portal-page .portal-button:disabled { background: #e1e7ef; border-color: #c1cedf; color: #4d627e; cursor: default; }
.portal-alert { margin: 0 0 20px; padding: 11px 15px; border-radius: 8px; border-left: 4px solid #2066d4; background: #e8f1ff; color: #19365e; }
.portal-alert-error { border-color: #a82531; background: #fff0f1; color: #721721; }
.portal-alert-success { border-color: #207346; background: #e9f8ef; color: #134b2e; }
.portal-catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 12px; padding: 0; list-style: none; }
.portal-item { display: grid; align-content: space-between; gap: 16px; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 9px; }
.portal-item p { margin: 5px 0 0; color: var(--muted); font-size: .93rem; }
.portal-item .portal-price, .portal-price { color: var(--ink); font-weight: 730; font-variant-numeric: tabular-nums; }
.portal-choice { min-height: 44px; display: flex; align-items: center; gap: 7px; }
.portal-section + .portal-section { margin-top: 32px; }
.portal-checkout { max-width: 670px; }
.portal-reference { overflow-wrap: anywhere; }
.portal-page :is(summary, legend) { font-weight: 680; }
.portal-page summary { padding-block: 10px; cursor: pointer; }
.portal-page fieldset { min-inline-size: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.portal-table-wrap { overflow: auto; }
.portal-table { width: 100%; border-collapse: collapse; }
.portal-table :is(th, td) { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.portal-actions > a:not(.portal-button), .portal-item > a, .portal-table td > a, .portal-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
.portal-item > a { justify-self: start; }
.portal-table td > a { min-width: 44px; justify-content: center; }
.portal-footer { display: flex; flex-wrap: wrap; gap: 0 18px; padding: 18px 0 30px; color: var(--muted); }
@media (max-width: 580px) {
    .portal-shell { width: calc(100% - 28px); }
    .portal-grid, .portal-form-grid { grid-template-columns: 1fr; }
}
