:root {
    color-scheme: light;
    --blue: #004987;
    --cyan: #009fe3;
    --navy: #1f2a37;
    --ink: #16304a;
    --muted: #4d657b;
    --line: #d7e2ee;
    --surface: #fff;
    --pale: #edf5fc;
    --background: #f4f7fb;
    --danger: #9d2626;
    --radius: 16px;
    font-family: "Segoe UI", system-ui, sans-serif;
    line-height: 1.55;
    color: var(--ink);
    background: var(--background);
}

*, ::before, ::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
button, input, select, textarea { font: inherit; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
img { display: block; max-width: 100%; }

.shell { width: min(1136px, calc(100% - 64px)); margin-inline: auto; }
.topbar { background: white; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 81px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 22px; color: var(--blue); text-decoration: none; font-weight: 650; }
.brand img { width: 146px; height: auto; }
.brand span { padding-inline-start: 22px; border-inline-start: 1px solid var(--line); }
.topbar-nav { display: flex; align-items: center; gap: 22px; }
.topbar-nav a { font-size: .9rem; font-weight: 650; text-decoration: none; }
.topbar-nav [aria-current="page"] { text-decoration: underline; }
.footer { color: var(--muted); font-size: .875rem; }
.footer-inner { border-top: 1px solid var(--line); min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.skip { position: absolute; z-index: 2; top: 6px; left: 6px; transform: translateY(-160%); background: white; padding: 8px; }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0,0,0,0); white-space: nowrap; overflow: hidden; }

main.shell { padding-block: 42px 64px; }
.page-intro { margin-bottom: 27px; }
h1, h2, h3 { color: var(--blue); margin: 0; line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4vw, 2.7rem); font-weight: 760; }
h2 { font-size: 1.4rem; font-weight: 720; }
h3 { font-size: 1.06rem; font-weight: 700; margin-block: 25px 11px; }
p { margin: .65em 0 0; }
.page-intro p, .panel > p, .muted { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(19px, 3vw, 30px); box-shadow: 0 4px 16px #183a6110; min-width: 0; }
.panel p { overflow-wrap: anywhere; }
.stack { display: grid; gap: 20px; min-width: 0; }
.stack.compact { gap: 8px; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, 300px); align-items: start; gap: 24px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.sidebar { display: grid; gap: 16px; min-width: 0; }
.context h2 { font-size: 1.16rem; }
.context dl { margin: 16px 0 0; }
.context dl div { display: grid; gap: 2px; padding-block: 12px; border-top: 1px solid var(--line); }
.context dl div:last-child { padding-block-end: 0; }
dt { color: var(--muted); font-size: .9rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.context dd { font-weight: 650; }
.planning-note { display: flex; align-items: flex-start; gap: 11px; background: #e6f2fc; color: var(--blue); padding: 15px; border-radius: 12px; font-size: .9rem; }
.planning-note p { margin: 0; }
.info-mark { border: 1px solid #79aacd; border-radius: 50%; width: 20px; height: 20px; flex: 0 0 20px; text-align: center; line-height: 18px; font-weight: 700; }

.progress { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; max-width: 700px; margin: 0 0 24px; padding: 0; list-style: none; }
.progress li { display: flex; align-items: center; position: relative; gap: 9px; padding: 0 8px 11px 0; border-bottom: 2px solid var(--line); font-size: .9rem; color: var(--muted); font-weight: 600; }
.progress .step-number { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border: 1px solid #9fb8cd; background: white; border-radius: 100%; font-weight: 700; }
.progress li[aria-current="step"] { border-bottom-color: var(--blue); color: var(--blue); }
.progress li[aria-current="step"] .step-number { color: white; background: var(--blue); border-color: var(--blue); }
.progress li.done { border-bottom-color: var(--cyan); color: var(--blue); }
.progress li.done .step-number { background: #e2f2fd; border-color: #a4d5ef; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.type-option { display: flex; align-items: center; gap: 12px; padding: 14px 15px; min-height: 78px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.type-option:hover { background: var(--pale); border-color: #8bb5d4; }
.type-option:has(input:checked) { background: var(--pale); border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.type-label { min-width: 0; }
.type-label strong { display: block; color: var(--blue); font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
.type-label small { display: block; margin-top: 3px; }
input[type=radio], input[type=checkbox] { accent-color: var(--blue); width: 18px; height: 18px; flex: 0 0 18px; margin: 0; vertical-align: middle; }
.check { display: flex; gap: 9px; align-items: center; margin: 0 0 10px; overflow-wrap: anywhere; }
.keep-files { margin-block: 15px; }
.keep-files legend { margin-bottom: 8px; font-weight: 650; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.form-actions.between { justify-content: space-between; }
[data-stage="2"] > .form-actions { margin-top: 0; }

.button { width: fit-content; display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 9px 15px; min-height: 43px; font-size: .91rem; font-weight: 680; line-height: 1.35; cursor: pointer; text-decoration: none; }
.button.primary { color: white; background: var(--blue); }
.button.primary:hover { background: #003968; }
.button.secondary { background: white; color: var(--blue); border-color: #a8c0d5; }
.button.secondary:hover, .button.subtle:hover { background: var(--pale); }
.button.subtle { color: var(--blue); background: transparent; }
.button.danger-link { color: var(--danger); background: transparent; padding: 7px 0 0; min-height: 36px; text-decoration: underline; }
.button:disabled { opacity: .65; cursor: wait; }

label { display: block; font-size: .94rem; font-weight: 640; }
input:not([type=radio],[type=checkbox],[type=file]), select, textarea { display: block; margin-top: 5px; width: 100%; min-width: 0; min-height: 43px; border: 1px solid #a9bdd1; border-radius: 8px; padding: 8px 10px; color: var(--ink); background-color: white; font-size: 1rem; font-weight: 400; }
input[readonly] { background-color: var(--pale); }
input[aria-invalid=true] { border-color: var(--danger); }
textarea { resize: vertical; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--blue) 50%), linear-gradient(135deg, var(--blue) 50%, transparent 50%); background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%; background-size: 5px 5px; background-repeat: no-repeat; }
small { font-size: .875rem; color: var(--muted); font-weight: 400; }
.mandatory { color: var(--blue); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 12px; }
.wide { grid-column: 1 / -1; }
.field-help { color: var(--muted); margin: 3px 0 -7px; }
.line { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbff; }
.line legend { color: var(--blue); font-weight: 700; padding-inline: 7px; }
.line-grid { display: grid; gap: 15px; grid-template-columns: minmax(0,1fr); align-items: center; }
.line-grid:has(figure:not([hidden])) { grid-template-columns: minmax(0,1fr) minmax(130px,.8fr); }
.line .fields { margin-top: 0; }
.container-photo { margin: 0; padding: 8px; border-radius: 9px; border: 1px solid var(--line); background: white; text-align: center; }
.container-photo img { width: 100%; height: 150px; object-fit: contain; }
.container-photo figcaption { font-size: .9rem; color: var(--muted); margin-top: 3px; }
.add-line, .optional, .notes { margin-top: 18px; }
.optional summary { color: var(--blue); cursor: pointer; font-weight: 650; }
.upload { border: 1px dashed #80a9c9; border-radius: 10px; background: var(--pale); padding: 16px; margin-top: 15px; }
.upload input { display: block; max-width: 100%; margin-top: 8px; }
.file-list { padding-inline-start: 21px; overflow-wrap: anywhere; }

.summary section + section { border-top: 1px solid var(--line); padding-top: 21px; margin-top: 21px; }
.summary h2 { font-size: 1.19rem; }
.summary-fields { display: grid; column-gap: 20px; row-gap: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 13px 0 0; }
.summary-fields dd { font-weight: 550; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; margin-top: 13px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; }
th, td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--pale); color: var(--blue); }
.receipt-banner { background: var(--pale); border: 1px solid #b8d6ec; border-radius: var(--radius); padding: clamp(18px,3vw,32px); display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.receipt-mark { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--blue); color: white; font-weight: 700; }
.request-number { margin-top: 16px; display: grid; gap: 3px; }
.request-number span { font-size: .9rem; color: var(--muted); }
.request-number strong { color: var(--blue); font-size: 1.35rem; letter-spacing: .025em; }

.auth-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(320px,.85fr); align-items: stretch; gap: 24px; margin-top: 20px; }
.auth-intro { background: var(--blue); color: white; padding: clamp(26px,4vw,54px); border-radius: var(--radius); display: grid; align-content: center; justify-items: start; position: relative; isolation: isolate; overflow: hidden; }
.auth-intro::after { content: ""; position: absolute; z-index: -1; width: 290px; height: 480px; right: -182px; top: -88px; transform: rotate(18deg); border-left: 2px solid #53b8e8; background: #065494; box-shadow: -33px 0 0 #04508e; }
.auth-intro h1 { color: white; max-width: 13ch; }
.auth-intro p { color: #e6f6ff; max-width: 36ch; font-size: 1.06rem; }
.company-label { font-size: .9rem; line-height: 1; padding: 7px 11px; background: #e7f5ff; color: var(--blue); border-radius: 5px; font-weight: 720; margin-bottom: 17px; }
.auth-panel { padding: clamp(23px,4vw,41px); }
.auth-panel h1 { font-size: clamp(1.6rem,3.5vw,2.2rem); }
.auth-panel form { margin-top: 22px; }
.auth-panel .button { width: 100%; }
.center-card { max-width: 540px; margin: 12px auto 0; }
.center-card > a.button { margin-top: 20px; }
.notice { border: 1px solid; padding: 14px 17px; border-radius: 10px; margin: 0 0 20px; overflow-wrap: anywhere; }
.notice.success { background: #e8f7ef; border-color: #b5ddc6; color: #1b6040; }
.notice.error { background: #fdf1f1; border-color: #e9b6b6; color: #7c1c1c; }
.notice ul { margin: 5px 0 0; padding-left: 22px; }
.admin-grid form.stack { margin-top: 18px; }
.admin-list { list-style: none; padding: 0; margin: 15px 0 0; }
.admin-list > li { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-top: 1px solid var(--line); padding: 15px 0; overflow-wrap: anywhere; }
.admin-list > li:last-child { padding-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }

@media (max-width: 850px) {
    .shell { width: calc(100% - 40px); }
    .portal-grid { grid-template-columns: minmax(0,1fr) minmax(200px,235px); gap: 15px; }
    .admin-grid { grid-template-columns: 1fr; }
    .type-option { padding-inline: 11px; }
}
@media (max-width: 680px) {
    .shell { width: calc(100% - 30px); }
    main.shell { padding-block: 28px 42px; }
    .topbar-inner { min-height: 68px; flex-wrap: wrap; gap: 3px 12px; padding-block: 8px; }
    .brand { gap: 11px; }
    .brand img { width: 103px; }
    .brand span { padding-inline-start: 11px; font-size: .92rem; }
    .topbar-nav { gap: 12px; }
    .topbar-nav .nav-new { display: none; }
    .topbar-nav .button { padding-inline: 7px; }
    .portal-grid, .auth-grid { grid-template-columns: minmax(0,1fr); }
    .auth-grid { margin-top: 0; gap: 16px; }
    .button { min-height: 44px; }
    .footer-inner { flex-wrap: wrap; align-content: center; }
    .progress { gap: 0; }
    .progress li { gap: 5px; font-size: .875rem; }
    .progress .step-number { flex-basis: 21px; width: 21px; height: 21px; font-size: .81rem; }
}
@media (max-width: 440px) {
    .types, .fields, .summary-fields, .line-grid:has(figure:not([hidden])) { grid-template-columns: minmax(0,1fr); }
    .type-option { min-height: 64px; }
    .line .fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .admin-list > li { flex-direction: column; }
}

@media (max-width: 440px) {
    .progress li {
        flex-direction: column;
        align-items: flex-start;
        padding-inline-end: 0;
    }
}
