/* Page layout and commerce components built on the Flodelica tokens (FRONTEND.md §7.2). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); color: var(--ink); background: var(--surface); font-size: 16px; line-height: 1.55; }
img, svg { max-width: 100%; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 10px 16px; border-radius: var(--radius-pill); z-index: 10; }
.skip:focus { left: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; color: var(--ink); }
p { margin: 0; }
.stack > * + * { margin-top: var(--space-4); }
.mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); } .mt-10 { margin-top: var(--space-10); } .mt-14 { margin-top: var(--space-14); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* Navbar */
.fl-nav { position: sticky; top: 0; z-index: 5; }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-pill); color: var(--ink); border: 1px solid var(--line); }
.cart-link[data-count]:not([data-count="0"])::after { content: attr(data-count); position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.icon-btn.nav-toggle { display: none; }
@media (max-width: 900px) {
  .icon-btn.nav-toggle { display: inline-flex; }
  .fl-nav__links { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 14px; padding: 8px 0 12px; }
  .fl-nav[data-open="true"] .fl-nav__links { display: flex; }
}

/* Page header (non-home pages) */
.page-head { padding: var(--space-16) 0 var(--space-14); border-bottom: 1px solid var(--line); }
.crumbs { font-size: 14px; color: var(--ink-subtle); margin-bottom: var(--space-6); }
.crumbs a { color: var(--ink-subtle); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.page-head .fl-display { font-size: 56px; max-width: 900px; }
.page-head .fl-lead { color: var(--ink-muted); max-width: 720px; margin-top: var(--space-5); }
@media (max-width: 767px) { .page-head .fl-display { font-size: 38px; } }

/* Hero */
.hero { padding: var(--space-16) 0 var(--space-28); }
.hero__grid { display: flex; flex-wrap: wrap; gap: var(--space-16); align-items: center; }
.hero__text { flex: 1 1 520px; display: flex; flex-direction: column; gap: var(--space-7); }
.hero__visual { flex: 1 1 400px; background: var(--surface-alt); border-radius: var(--radius-2xl); padding: var(--space-10); }
.hero__eyebrow { align-self: flex-start; }
.hero .fl-lead { color: var(--ink-muted); max-width: 600px; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); font-size: 15px; color: var(--ink); }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks .fl-icon { color: var(--success); }
.case-card { background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.case-card__head { display: flex; justify-content: space-between; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.case-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.case-steps li { display: flex; gap: 10px; align-items: center; color: var(--ink-muted); }
.case-steps li[data-done] { color: var(--ink); }
.case-steps li[data-done] .fl-icon { color: var(--success); }
.case-steps .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.tiles { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-5); }
.tiles > * { flex: 1 1 140px; }

.sectors { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: var(--space-6) 0; }
.sectors__inner { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.sectors .fl-label { color: var(--ink-subtle); margin-right: var(--space-4); }

a.fl-service { text-decoration: none; color: var(--ink); transition: border-color .15s; }
a.fl-service:hover { border-color: var(--brand); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand); text-decoration: none; }

.two-col { display: flex; flex-wrap: wrap; gap: var(--space-16); }
.two-col > * { flex: 1 1 420px; min-width: 0; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.ticks li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-muted); }
.ticks .fl-icon { color: var(--brand); margin-top: 2px; }
.fl-section--ink .ticks li { color: var(--on-ink-muted); }
.fl-section--ink .ticks .fl-icon { color: var(--brand-on-ink); }

.stats { display: flex; flex-wrap: wrap; gap: var(--space-10); padding-bottom: var(--space-16); border-bottom: 1px solid var(--line-on-ink); margin-bottom: var(--space-16); }
.stats > * { flex: 1 1 200px; }

/* Catalog */
.catalog-tools { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; margin-bottom: var(--space-10); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-chips a { text-decoration: none; }
.filter-chips a[aria-current="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.search { display: flex; gap: var(--space-2); }
.product-card { border: 1px solid var(--line); border-radius: var(--radius-xl); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); text-decoration: none; color: var(--ink); background: var(--surface); }
.product-card:hover { border-color: var(--brand); }
.product-card .fam { color: var(--ink-subtle); }
.product-card p { color: var(--ink-muted); font-size: 15px; }
.product-card__foot { margin-top: auto; padding-top: var(--space-4); display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); }
.from { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.from small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: 12px; color: var(--ink-subtle); text-transform: uppercase; letter-spacing: .08em; }
.empty { padding: var(--space-10); text-align: center; color: var(--ink-muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-xl); }

/* Product page: scope cards */
.scopes { display: flex; flex-wrap: wrap; gap: var(--space-5); border: 0; padding: 0; margin: 0; }
.scope { flex: 1 1 260px; position: relative; }
.scope input { position: absolute; opacity: 0; pointer-events: none; }
.scope label { display: flex; flex-direction: column; gap: var(--space-3); height: 100%; padding: var(--space-7); border: 1.5px solid var(--line); border-radius: var(--radius-xl); cursor: pointer; background: var(--surface); }
.scope input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.scope input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.scope .name { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.scope .price { font-family: var(--font-display); font-weight: 700; font-size: 36px; letter-spacing: -0.03em; }
.scope .tax { font-size: 14px; color: var(--ink-subtle); }
.scope .desc { color: var(--ink-muted); font-size: 15px; }
.scope .days { margin-top: auto; font-size: 14px; font-weight: 600; color: var(--ink); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 15px; font-weight: 500; color: var(--ink); }
.field .hint { font-size: 14px; color: var(--ink-subtle); }
.input, .select, .textarea {
  font: inherit; color: var(--ink); background: var(--surface); width: 100%;
  min-height: var(--control-md); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--brand); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 14px; }
.form-grid { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.form-grid > .field { flex: 1 1 260px; }
.form-grid > .field--full { flex-basis: 100%; }
.check-field { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-muted); }
.check-field input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); }

/* Alerts */
.alert { border-radius: var(--radius-lg); padding: 14px 18px; font-size: 15px; }
.alert--info { background: var(--brand-soft); color: var(--brand-strong); }
.alert--success { background: var(--success-soft); color: var(--on-success-soft); }
.alert--error { background: var(--danger-soft); color: var(--on-danger-soft); }
.alert[hidden] { display: none; }

/* Cart & totals */
.checkout { display: flex; flex-wrap: wrap; gap: var(--space-10); align-items: flex-start; }
.checkout__main { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.checkout__side { flex: 1 1 340px; position: sticky; top: 96px; }
.panel { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: var(--space-7); }
.fl-section--alt .panel { border-color: transparent; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cart-line { display: flex; gap: var(--space-4); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: var(--space-5) 0; border-bottom: 1px solid var(--line); }
.cart-line:first-child { padding-top: 0; }
.cart-line__info { flex: 1 1 260px; min-width: 0; }
.cart-line__meta { font-size: 14px; color: var(--ink-subtle); }
.cart-line__total { font-family: var(--font-display); font-weight: 600; font-size: 19px; min-width: 110px; text-align: right; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); cursor: pointer; border-radius: var(--radius-pill); font-size: 20px; }
.stepper output { min-width: 28px; text-align: center; font-weight: 600; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: transparent; color: var(--ink-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.totals { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; gap: var(--space-4); color: var(--ink-muted); }
.totals .grand { padding-top: var(--space-4); margin-top: 6px; border-top: 1px solid var(--line); color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.totals .discount span:last-child { color: var(--success); }
.small { font-size: 14px; color: var(--ink-subtle); }

/* Quote builder result */
.quote-result .fl-price { margin: var(--space-2) 0; }

/* Payment page /p */
.pay { display: flex; flex-wrap: wrap; min-height: calc(100vh - 81px); }
.pay__summary { flex: 1 1 420px; background: var(--surface-alt); padding: var(--space-16) var(--space-10); display: flex; justify-content: flex-end; }
.pay__form { flex: 1 1 460px; padding: var(--space-16) var(--space-10); }
.pay__inner { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: var(--space-6); }
.pay__amount { font-family: var(--font-display); font-weight: 700; font-size: 48px; letter-spacing: -0.03em; }
.pay__lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.pay__lines li { display: flex; justify-content: space-between; gap: var(--space-4); font-size: 15px; }
.pay__lines .opt { display: block; font-size: 13px; color: var(--ink-subtle); }
.pay__meta { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-muted); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.pay__meta b { color: var(--ink); }
.secure { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-subtle); }
.mock-banner { border: 1.5px dashed var(--brand); border-radius: var(--radius-lg); padding: var(--space-5); background: var(--brand-soft); color: var(--brand-strong); display: flex; flex-direction: column; gap: var(--space-3); }
.mock-banner .fl-label { color: var(--brand-strong); }
.mock-outcomes { display: flex; flex-direction: column; gap: 8px; }
.mock-outcomes label { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--ink); background: var(--surface); padding: 10px 14px; border-radius: var(--radius-md); cursor: pointer; }
.mock-outcomes input { accent-color: var(--brand); width: 18px; height: 18px; }
.done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding: var(--space-10) 0; }
.done__circle { width: 72px; height: 72px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: flex; align-items: center; justify-content: center; }
.challenge-frame { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.or { display: flex; align-items: center; gap: var(--space-3); color: var(--ink-subtle); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
@media (max-width: 767px) {
  .pay__summary, .pay__form { padding: var(--space-10) 20px; }
  .pay__amount { font-size: 38px; }
}

.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } * { scroll-behavior: auto !important; } }

.status { display: inline-flex; }
.prose { color: var(--ink-muted); max-width: 760px; }
.prose h2 { font-family: var(--font-display); font-size: 26px; margin: var(--space-10) 0 var(--space-3); color: var(--ink); }
.prose p, .prose li { margin: 0 0 12px; }

.theme-toggle { background: none; border: 0; color: var(--ink-subtle); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; padding: 0; }
