:root {
    color-scheme: dark;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    background: #101111;
    color: #f3f3f0;
    --muted: #aaaaa6;
    --line: #2d2f2d;
    --surface: #191a19;
    --field: #121313;
    --accent: #ff792f;
    --positive: #a2d4ae;
    --error: #ffa692;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; top: .5rem; left: .5rem; translate: 0 -200%; z-index: 20; padding: .6rem; background: white; color: black; }
.skip-link:focus { translate: 0; }

.site-header { background: #121313; border-bottom: 1px solid var(--line); }
.header-inner, .page, .site-footer { max-width: 1296px; margin: auto; padding-inline: 3rem; }
.header-inner { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; }
.brand { display: inline-flex; flex: none; align-items: center; gap: .66rem; font-size: .95rem; letter-spacing: .105em; font-weight: 780; text-decoration: none; }
.brand > img { object-fit: contain; }
.brand > span > span { color: var(--accent); }
.brand small { display: block; margin-top: .18rem; color: var(--muted); font-size: .62rem; font-weight: 650; letter-spacing: .13em; }
nav { display: flex; gap: 1.5rem; align-items: center; align-self: stretch; font-size: .875rem; font-weight: 650; }
nav a, .text-button { display: inline-flex; align-items: center; color: #c2c2bc; text-decoration: none; white-space: nowrap; border: 0; background: transparent; padding: .52rem 0; }
nav a[aria-current] { box-shadow: inset 0 -2px var(--accent); color: #fff; }
nav a:hover, .text-button:hover { color: var(--accent); }
nav form { display: flex; margin: 0; }

.page { padding-top: 2.75rem; padding-bottom: 4rem; }
.intro { margin-bottom: 1.95rem; }
.eyebrow { display: flex; align-items: center; gap: .55rem; margin: 0 0 .7rem; color: var(--accent); font-size: .75rem; letter-spacing: .115em; text-transform: uppercase; font-weight: 730; }
.eyebrow > span { width: 1.05rem; background: var(--accent); height: 1px; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); letter-spacing: -.062em; line-height: 1.04; margin: 0; font-weight: 720; }
h2 { font-size: 1.22rem; font-weight: 700; letter-spacing: -.026em; margin: 0; }
.intro-copy { font-size: 1rem; color: var(--muted); line-height: 1.6; margin: .8rem 0 0; max-width: 42rem; }

.config-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.configuration, .summary { display: grid; gap: 1rem; min-width: 0; }
.summary { position: sticky; top: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.product-panel, .option-panel, .summary-panel, .downloads-panel, .simple, .listino-section { padding: 1.25rem; }
.product-panel h2, .option-panel h2, .downloads-panel h2 { margin-bottom: 1rem; }
.initial-controls label, #discount-form > label, .auth-field > label, .field-grid label { display: block; color: #dddeda; font-size: .875rem; font-weight: 620; margin-bottom: .45rem; }
select, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { width: 100%; background: var(--field); border: 1px solid #3a3c39; border-radius: 7px; color: #f6f6f2; min-height: 45px; padding: .58rem .75rem; }
select { appearance: none; padding-right: 2.15rem; background-image: linear-gradient(45deg, transparent 50%, #c0c1ba 50%), linear-gradient(135deg, #c0c1ba 50%, transparent 50%); background-position: calc(100% - 17px) 51%, calc(100% - 12px) 51%; background-size: 5px 5px; background-repeat: no-repeat; text-overflow: ellipsis; }
select:hover, input:not([type]):hover, input[type="text"]:hover { border-color: #63645f; }
.controls-row, .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.controls-row, .field-grid:not(:empty) { margin-top: .9rem; }
.field-note { color: var(--muted); font-size: .81rem; line-height: 1.45; margin: .44rem 0 0; }
.field-note:empty { display: none; }

.spec-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1.02rem 0 0; padding: .82rem .25rem; border: 1px solid #30322f; border-radius: 7px; background: #151615; }
.spec-preview div { padding: 0 .75rem; }
.spec-preview div + div { border-left: 1px solid #353632; }
.spec-preview dt { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.spec-preview dd { margin: .32rem 0 0; color: #f5f5ef; font-size: 1rem; font-weight: 690; }

.standard-row, .price-lines > div, .discount-detail, .total-row { display: flex; justify-content: space-between; align-items: baseline; gap: .7rem; }
.standard-row { padding: .65rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.standard-row:last-child { padding-bottom: .18rem; }
.standard-row strong, .option-choice strong, .price-lines dd { flex: none; font-variant-numeric: tabular-nums; }
.option-group { margin: .85rem 0 0; border: 0; padding: 0; min-width: 0; }
.option-group legend { margin-bottom: .35rem; padding: 0; color: var(--muted); font-size: .81rem; font-weight: 650; }
.option-choice { display: flex; align-items: flex-start; gap: .65rem; padding: .64rem .55rem; font-size: .91rem; border-top: 1px solid var(--line); cursor: pointer; }
.option-choice:hover, .option-choice:has(input:checked) { background: #242421; border-radius: 4px; }
.option-choice > input { width: 1rem; height: 1rem; flex: none; margin: .12rem 0 0; accent-color: var(--accent); }
.option-choice > span { flex: 1; min-width: 0; }
.option-choice > strong { font-size: .85rem; }
.option-choice small { display: block; margin-top: .2rem; color: var(--muted); line-height: 1.35; }

.summary-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; border-bottom: 1px solid var(--line); padding-bottom: .82rem; }
.summary-heading .eyebrow { margin-bottom: .35rem; }
.summary-heading h2 { font-size: 1.65rem; }
.model-status { font-size: .76rem; font-weight: 690; letter-spacing: .04em; color: #f8bb93; border: 1px solid #624236; background: #30251f; padding: .35rem .6rem; border-radius: 5px; white-space: nowrap; }
.summary-note { margin: .85rem 0 0; padding: .6rem .68rem; border-left: 2px solid var(--accent); color: #f2ba94; background: #28211b; border-radius: 3px; font-size: .82rem; }
.price-lines { display: grid; gap: .5rem; margin: .8rem 0; }
.price-lines:empty { display: none; }
.price-lines dt { color: #cecfca; }
.price-lines dd { margin: 0; font-weight: 680; white-space: nowrap; }
.price-lines { font-size: .865rem; }
#discount-form { border-top: 1px solid var(--line); padding-top: .8rem; margin: .9rem 0 .82rem; }
.discount-row { display: flex; gap: .46rem; }
.discount-row input { flex: 1; min-width: 0; }
.positive { color: var(--positive); }
.invalid, .form-errors { color: var(--error); }
.discount-detail { margin: .5rem 0 .8rem; font-size: .86rem; color: var(--positive); }
.total-row { border-top: 1px solid var(--line); padding: .82rem 0 .85rem; font-size: .93rem; font-weight: 650; }
.total-row strong { font-size: clamp(1.22rem, 2.4vw, 1.94rem); line-height: 1; letter-spacing: -.045em; white-space: nowrap; }

.button { display: inline-flex; justify-content: center; align-items: center; padding: .61rem .88rem; min-height: 42px; border-radius: 7px; border: 1px solid transparent; text-align: center; font-weight: 690; font-size: .9rem; line-height: 1.25; text-decoration: none; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #1a0c04; }
.button.primary:hover:enabled, a.button.primary:hover { background: #ff9a61; border-color: #ff9a61; }
.button.secondary { background: #222323; border-color: #434541; color: #eeeeea; }
.button.secondary:hover:enabled, a.button.secondary:hover { border-color: #999a93; }
.button:disabled { opacity: .48; }
.offer-button, .full { width: 100%; }

.document-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .48rem; }
.document-action { display: flex; min-height: 55px; flex-direction: column; justify-content: center; gap: .15rem; align-items: flex-start; padding: .55rem .62rem; color: #f0f0ea; border: 1px solid #42443e; background: var(--field); border-radius: 6px; text-align: left; font-size: .86rem; font-weight: 670; }
.document-action:hover:enabled { border-color: var(--accent); }
.document-action:disabled { color: #aaa9a3; border-color: #30312f; background: #171817; }
.document-action small { color: var(--muted); font-size: .73rem; font-weight: 500; overflow-wrap: anywhere; }
.print-link { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .25rem .2rem; color: #ddd; font-size: .875rem; font-weight: 650; }
.print-link span { color: var(--muted); text-decoration: none; font-weight: 500; }

.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.flash-list { padding: .75rem 1rem; list-style: none; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; color: var(--muted); margin: 0 0 1.15rem; }
.flash-list .success { color: var(--positive); }
.flash-list .error { color: var(--error); }
.auth-layout { min-height: 62vh; display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; max-width: 970px; margin: 0 auto; }
.auth-intro { padding-block: 2rem; }
.auth-card { padding: 1.5rem; }
.auth-card h2 { font-size: 1.55rem; margin-bottom: 1rem; }
.auth-field { margin: 1rem 0; }
.auth-field .field-note ul, .form-errors ul { padding-left: 1.1rem; margin: .35rem 0 0; }
.auth-links { font-size: .9rem; margin-top: 1.15rem; display: flex; flex-wrap: wrap; gap: .75rem 1rem; color: #e2ded8; }
.action-card { max-width: 590px; margin: 2.5rem auto 3rem; }
.action-card h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.action-card p, .simple p { color: var(--muted); line-height: 1.55; }
.action-card .button { margin-top: .35rem; }
.account-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; align-items: start; }
.account-code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; user-select: all; background: #2a211a; border: 1px solid #694831; color: #ffd1a8; border-radius: 7px; padding: .7rem .82rem; }
.offer-history { display: flex; justify-content: space-between; align-items: center; gap: .8rem; border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .7rem; }
.offer-history small { display: block; margin-top: .25rem; color: var(--muted); }
.print-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.print-logo { display: none; }
.listino-section { margin-bottom: 1rem; }
.table-scroll { overflow: auto; }
.table { width: 100%; margin-top: .75rem; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .64rem .55rem; text-align: right; border-bottom: 1px solid var(--line); }
.table th:first-child { text-align: left; }
.table thead th { color: #fff; background: #252623; }
.table tbody th { font-weight: 620; }
.table small { display: block; margin-top: .16rem; color: var(--muted); }
.table tbody td { min-width: 6.4rem; }

@media (max-width: 920px) {
    .header-inner, .page, .site-footer { padding-inline: 1.4rem; }
    nav { gap: .85rem; }
    .summary { position: static; }
}
@media (max-width: 720px) {
    .header-inner, .page, .site-footer { padding-inline: 1rem; }
    .header-inner { min-height: auto; flex-direction: column; align-items: flex-start; padding-top: .8rem; gap: .4rem; }
    nav { overflow-x: auto; gap: .95rem; }
    nav a, .text-button { padding-block: .6rem; }
    .page { padding-top: 1.8rem; }
    .config-layout, .auth-layout, .account-layout { grid-template-columns: minmax(0, 1fr); }
    .auth-layout { gap: 1rem; min-height: 0; }
    .auth-intro { padding-block: .75rem; }
    .spec-preview div { padding-inline: .44rem; }
    .product-panel, .option-panel, .summary-panel, .downloads-panel, .simple, .listino-section { padding: 1rem; }
}
@media (max-width: 370px) {
    .controls-row, .field-grid, .document-actions { grid-template-columns: minmax(0, 1fr); }
    .option-choice { flex-wrap: wrap; }
}
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    :root, body { color-scheme: light; background: #fff; color: #111; }
    .site-header, .site-footer, .skip-link, .flash-list, .print-heading .button { display: none; }
    .page { max-width: none; padding: 0; }
    .print-heading { margin-bottom: .7rem; }
    .print-heading h1 { font-size: 1.8rem; }
    .print-logo { display: block; width: 53mm; margin-bottom: 2mm; }
    .eyebrow, .field-note, .table small { color: #555; }
    .listino-section { padding: 0; border: 0; background: #fff; margin: 0; }
    .listino-section + .listino-section { break-before: page; }
    .table-scroll { overflow: visible; }
    .table th, .table td, .table thead th { color: #111; background: #fff; border-color: #ccc; padding: 1.4mm 2mm; }
    .table { font-size: 9pt; }
    .table tr { break-inside: avoid; }
}

.offer-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.draft-controls { text-align: right; }
.draft-controls .button { white-space: nowrap; }
.product-image { margin: 1.1rem 0 0; position: relative; overflow: hidden; border-radius: 8px; text-align: center; }
.product-image img { display: block; width: 100%; height: clamp(210px, 36vw, 330px); object-fit: contain; padding: .7rem; background: #e6e5e2; }
.product-image figcaption { color: var(--muted); font-size: .8rem; text-align: right; margin-top: .45rem; }
.summary { position: static; }
.quantity-row { margin-top: .9rem; }
.offer-details-panel { padding: 1.25rem; scroll-margin-top: 1rem; }
.details-section { min-width: 0; margin: 1rem 0 0; padding: .85rem .85rem .75rem; border: 1px solid var(--line); border-radius: 7px; }
.details-section > legend { padding: 0 .35rem; font-size: .9rem; font-weight: 690; color: #ecece6; }
.details-grid:not(:empty) { margin: 0; }
.detail-checkbox { grid-column: 1 / -1; }
.detail-checkbox > label { display: flex; align-items: center; gap: .52rem; margin: 0; }
.detail-checkbox input { accent-color: var(--accent); }
.detail-field [aria-invalid="true"] { border-color: var(--error) !important; }
.field-error { color: var(--error); font-size: .81rem; margin: .3rem 0 0; }
.field-error:empty { display: none; }
.vat-summary { margin: -.35rem 0 .8rem; padding-top: .45rem; color: var(--muted); }
.open-details { display: block; width: fit-content; margin: .15rem 0 .8rem; color: #f6ae86; font-size: .86rem; }
.table tbody tr:nth-child(even) > * { background: #30383b; }
.table tbody tr:nth-child(odd) > * { background: #1a1b1a; }
.table thead th { background: #2f302b; }
@media (max-width: 720px) {
    .offer-intro { align-items: flex-start; flex-direction: column; }
    .draft-controls { text-align: left; }
    .offer-details-panel { padding: 1rem; }
}
@media (max-width: 400px) {
    .details-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
    .print-heading form { display: none; }
    .table { print-color-adjust: exact; }
    .table tbody tr:nth-child(even) > * { background: #d1dce0; }
    .table tbody tr:nth-child(odd) > * { background: #fff; }
    .table thead th { background: #d8dada; }
}


.commission-box { margin: .85rem 0; border-block: 1px solid var(--line); padding: .8rem 0; }
.commission-box > label { display: block; font-weight: 600; margin-bottom: .45rem; font-size: .87rem; }
.commission-box > input { max-width: 7.2rem; }
.commission-box > input:disabled { opacity: .52; }
.commission-box dl { margin-bottom: 0; }
.ready-offers, .offer-history-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .55rem; }
.ready-offers .button { flex: 1; }
.table th, .table td { border-inline: 1px solid #53595b; }
@media print {
    .table th, .table td { border-color: #869197; }
}

.portal-language { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 5px; }
.portal-language button { color: var(--muted); font: inherit; font-size: .75rem; padding: .33rem .45rem; border: 0; background: transparent; cursor: pointer; }
.portal-language button[aria-current] { color: #fff; background: #353c3f; }
.document-preview { width: min(1080px, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); color: #f3f3f0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.document-preview::backdrop { background: #000b; }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 10px; }
.preview-toolbar h2 { margin: 0; overflow-wrap: anywhere; font-size: 1rem; }
.preview-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.preview-actions form { margin: 0; }
.document-preview iframe { width: 100%; height: min(72dvh, 780px); display: block; background: #edf0f1; border: 0; border-radius: 4px; }
@media (max-width: 520px) {
    .preview-toolbar { align-items: flex-start; flex-direction: column; gap: .5rem; }
    .document-preview iframe { height: 68dvh; }
}

.catalog-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
@media print {
    .catalog-filters { display: none; }
}
