:root {
  --bg: #edf1f3;
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --ink: #13212c;
  --ink-2: #475764;
  --ink-3: #7b8893;
  --line: #d6dee3;
  --line-2: #c2cdd4;
  --charcoal: #13212c;
  --charcoal-hover: #0a141c;
  --gold: #d2ba50;
  --gold-soft: #f6f0d6;
  --gold-ink: #7a6714;
  --focus: #b39a2e;
  --ok: #1f7a3a; --ok-bg: #e4f3e8;
  --warn: #8a5a00; --warn-bg: #fbf0d9;
  --bad: #a3261d; --bad-bg: #fbe5e2;
  --info: #2b5f9e; --info-bg: #e5eef9;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bahnschrift", "DIN Alternate", "DIN Next LT Pro", "D-DIN", "Barlow Semi Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --price: #1d5c8c;
  --sun: #d2ba50;
  --sun-deep: #7d6814;
  --neg: #b5392f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
h1, h2 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 26px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin-top: 1.4em; }
p { margin: 0 0 .9em; }
a { color: var(--ink); }
code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--ink-3); font-weight: normal; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- header / footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto; padding: 22px 16px 8px; }
body.admin .top, body.admin main { max-width: 1100px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-width: 0; }
.logo { height: 24px; width: auto; display: block; }
.product { font-weight: 650; font-size: 15px; color: var(--ink-2); border-left: 2px solid var(--gold); padding-left: 12px; white-space: nowrap; }
.lang { font-size: 14px; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; }
.lang:hover { background: var(--surface); }
main { max-width: 760px; margin: 0 auto; padding: 8px 16px 40px; }
.foot { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; font-size: 13px; color: var(--ink-3); display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--ink-3); }

/* ---------------------------------------------------------------- steps */
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 10px 0 18px; counter-reset: s; }
.steps li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.steps li::before { content: ""; height: 4px; border-radius: 2px; background: var(--line); }
.steps li.done::before { background: var(--charcoal); }
.steps li.current::before { background: var(--gold); }
.steps li.current { color: var(--ink); font-weight: 650; }
.steps li.done { color: var(--ink-2); }
.steps .n { display: none; }
.steps .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- cards / forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; }
.card.narrow { max-width: 460px; margin: 20px auto; }
.lead { font-size: 17px; color: var(--ink-2); }
.hint { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; min-width: 0; }
.field > label { font-weight: 600; font-size: 15px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); width: 100%; min-width: 0;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .brand-card:focus-within {
  outline: 3px solid var(--focus); outline-offset: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-zip { display: grid; grid-template-columns: 140px 1fr; gap: 0 16px; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.btn { appearance: none; font: inherit; font-weight: 600; font-size: 15px; display: inline-block; text-decoration: none;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 18px; cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.primary { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.btn.primary:hover { background: var(--charcoal-hover); }
.btn.big { font-size: 17px; padding: 14px 26px; }
.btn.danger { color: var(--bad); border-color: #e2b2ac; }
.btn.danger:hover { background: var(--bad-bg); }
button.link { background: none; border: none; font: inherit; font-size: 14px; color: var(--ink-2); text-decoration: underline; cursor: pointer; padding: 0; }
form.inline { display: inline; }
.errors { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.errors ul { margin: 0; padding-left: 18px; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; }
.flash { background: var(--ok-bg); color: var(--ok); border-radius: 8px; padding: 10px 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- contact: private / business, billing */
.ctype { border: none; padding: 0; margin: 4px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.ctype legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 8px; }
.seg { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line-2); border-radius: 10px;
  padding: 10px 18px; cursor: pointer; font-weight: 600; background: var(--surface); }
.seg:hover { border-color: var(--ink-3); }
.seg input { width: 18px; height: 18px; margin: 0; accent-color: var(--charcoal); }
.seg:has(input:checked) { border-color: var(--charcoal); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--charcoal); }
.seg:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
/* without :has() support both blocks simply stay visible */
form:has(input[name=customer_type][value=private]:checked) .biz { display: none; }
form:has(#f-billing_different:not(:checked)) .billing { display: none; }
.billing-toggle { margin-top: 18px; }
.billing { border-left: 3px solid var(--gold); padding-left: 16px; margin-top: 8px; }
.billing h2 { margin-top: .6em; }
.privacy-note { margin-top: 20px; }
.prefill { background: var(--info-bg); color: var(--info); border-radius: 8px; padding: 8px 12px; margin: 0 0 4px; }

/* ---------------------------------------------------------------- inverter cards */
.brands { border: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-card { position: relative; display: block; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 16px 18px;
  cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s; }
.brand-card:hover { border-color: var(--ink-3); }
.brand-card input { position: absolute; opacity: 0; pointer-events: none; }
.brand-card:has(input:checked) { border-color: var(--charcoal); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--charcoal); }
.brand-card:has(input:checked)::after { content: "✓"; position: absolute; top: 14px; right: 14px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--charcoal); color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.bc-body { display: flex; flex-direction: column; gap: 2px; }
.bc-name { font-weight: 700; font-size: 18px; }
.bc-portal { font-size: 14px; color: var(--ink-2); }
.badge { align-self: flex-start; margin-top: 8px; font-size: 12px; font-weight: 650; border-radius: 999px; padding: 2px 10px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.soon { background: #eeece4; color: var(--ink-2); }
.brand-card.soon .bc-name { color: var(--ink-2); }
.soon-note { margin-top: 12px; }

/* ---------------------------------------------------------------- confirm */
.summary { margin: 8px 0 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.summary > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.summary > div:last-child { border-bottom: none; }
.summary dt { font-weight: 650; }
.summary dt a { display: block; font-weight: 400; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.summary dd { margin: 0; }
.consents { margin-top: 20px; display: grid; gap: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--charcoal); }

/* ---------------------------------------------------------------- huawei / done */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.checks, .howto { padding-left: 20px; margin: 0; }
.checks li, .howto li { margin-bottom: 6px; }
.later { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.later summary { cursor: pointer; color: var(--ink-2); }
.copyline { display: flex; gap: 8px; }
.copyline input { font-size: 14px; }
.message.success h1::before { content: "✓"; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 19px; margin-right: 12px; vertical-align: 3px; }
.message.error h1 { color: var(--bad); }
.plants { padding-left: 20px; }

/* ---------------------------------------------------------------- admin */
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.head-row h1 { margin: 0; }
.filters { display: flex; gap: 8px; margin: 10px 0 16px; flex-wrap: wrap; }
.filters input { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
.tbl-wrap { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th { text-align: left; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line-2); padding: 8px 10px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--line); padding: 9px 10px; vertical-align: top; }
.btn.small { font-size: 13px; padding: 5px 11px; border-radius: 7px; }
.tbl .right, .tbl th.right { text-align: right; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline-block; margin-left: 6px; }
h2 .status { vertical-align: middle; margin-left: 6px; }
.status { display: inline-block; font-size: 12.5px; font-weight: 650; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.status.soon, .status.neutral { background: #eeece4; color: var(--ink-2); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.detail-grid input.small { font-size: 12px; padding: 4px 6px; margin-top: 4px; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.danger-zone { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.empty { color: var(--ink-2); padding: 20px 0; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .card { padding: 22px 18px; }
  h1 { font-size: 22px; }
  .grid2, .two, .brands, .detail-grid { grid-template-columns: 1fr; }
  .grid-zip { grid-template-columns: 110px 1fr; }
  .summary > div { grid-template-columns: 1fr; gap: 4px; }
  .steps .l { font-size: 11.5px; }
  .actions .btn { flex: 1; text-align: center; }
  .actions > span { display: none; }
  .copyline { flex-direction: column; }
  .logo { height: 20px; }
  .product { font-size: 14px; padding-left: 10px; }
  .lang { font-size: 13px; padding: 3px 10px; }
}
@media (max-width: 420px) {
  .top { padding-top: 16px; }
  .logo { height: 17px; }
  .brand { gap: 10px; }
  .product { font-size: 13px; padding-left: 8px; }
}

/* ---------------------------------------------------------------- Flex EMS mark (shared) */
.mark { width: 30px; height: 22px; flex: none; }
.mark-zero { stroke: var(--ink-3); stroke-width: 1.4; fill: none; }
.mark-line { stroke: var(--price); stroke-width: 2.4; fill: none; stroke-linecap: round; }
.mark-dot { fill: var(--sun); stroke: var(--ink); stroke-width: 1.2; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: .01em; color: var(--ink); white-space: nowrap; }
.brand .product { border-left: 2px solid var(--gold); }
.powered { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.powered img { height: 13px; width: auto; display: block; }
.foot { align-items: center; }
