:root {
  --orange:       #ef7300;
  --orange-dark:  #c45f00;
  --orange-light: #fdf3e7;
  --green:        #27a047;
  --black:        #1a1a1a;
  --dark:         #4b4948;
  --gray:         #7a7877;
  --light:        #f4f4f4;
  --rule:         #e0e0e0;
  --white:        #ffffff;
  --shadow:       0 2px 16px rgba(0,0,0,0.07);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scrollbar-gutter: stable;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--light);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", sans-serif;
  color: var(--black);
  font-size: 16px;
  line-height: 1.5;
}

.progress-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.progress-wrap[hidden] { display: none; }
.progress-track {
  flex: 1;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width 0.35s ease;
  width: 0%;
}
.progress-label { font-size: 12px; color: var(--gray); white-space: nowrap; }

.wizard {
  min-height: calc(100vh - 45px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 36px 16px 72px;
}
.is-embedded .wizard { min-height: 0; }
.is-embedded body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.is-embedded .wizard { flex: 1 0 auto; }
.is-embedded .page-footer { flex: 0 0 auto; }

.step { display: none; width: 100%; max-width: 680px; }
.step.step-wide { max-width: 920px; }
.step.active { display: block; }

.step-card {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow);
}
.step-card.center { text-align: center; padding: 56px 40px; }

.intro-card .tag {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  margin-bottom: 20px;
}
.intro-card h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.05;
  color: var(--black);
}
.intro-card .lead {
  color: var(--dark);
  font-size: 17px;
  max-width: 520px;
  margin: 0 0 28px;
}
.feature-list {
  list-style: none;
  padding: 0; margin: 0 0 32px;
  display: flex; flex-direction: column; gap: 10px;
}
.feature-list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--dark);
}
.tick {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.contact-line { margin: 16px 0 0; font-size: 14px; color: var(--gray); }
.contact-line a { color: var(--orange); font-weight: 700; text-decoration: none; }
.contact-line a:hover { text-decoration: underline; }

.step-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; color: var(--black); }
.step-hint    { margin: 0 0 22px; color: var(--gray); font-size: 14px; }

.addr-grid {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.8fr 1.6fr;
  gap: 12px;
  margin-bottom: 8px;
}
.addr-hint { margin: 0 0 24px; font-size: 12px; color: var(--gray); }
.field { display: block; position: relative; }

.ac-dropdown {
  position: absolute;
  top: calc(100% + 2px); left: 0; right: 0;
  z-index: 50;
  background: var(--white);
  border: 1px solid var(--rule);
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
.ac-dropdown[hidden] { display: none; }
.ac-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
}
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.active {
  background: var(--orange-light);
}
.ac-main { font-size: 14px; font-weight: 600; color: var(--black); line-height: 1.3; }
.ac-sub  { font-size: 12px; color: var(--gray); margin-top: 2px; }
.ac-empty { padding: 12px 14px; font-size: 13px; color: var(--gray); }
.ac-attrib {
  padding: 5px 14px 7px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--gray);
  text-align: right;
  white-space: nowrap;
  border-top: 1px solid var(--rule, #e6e6e6);
  background: #fafafa;
}
.field > span {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--dark); margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"] {
  width: 100%; height: 48px;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--black);
  font: inherit; font-size: 15px;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(239,115,0,0.13);
}

.choice-grid { display: grid; gap: 12px; margin-bottom: 24px; }
.choice-grid.four { grid-template-columns: repeat(4, 1fr); }
.choice-grid.two  { grid-template-columns: 1fr 1fr; }

.choice {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 20px 12px;
  border: 1.5px solid var(--rule);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center; font: inherit;
}
.choice:hover, .choice.selected {
  border-color: var(--orange);
  background: var(--orange-light);
}
.choice-wide {
  align-items: flex-start; text-align: left; padding: 20px;
}
.choice strong { font-size: 14px; color: var(--black); display: block; line-height: 1.3; }
.choice-sub    { font-size: 12px; color: var(--gray); display: block; margin-top: 4px; line-height: 1.4; }

.choice-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: var(--orange-light);
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  font-size: 11px; font-weight: 800; color: var(--orange);
  letter-spacing: 0.03em;
  transition: background 0.15s, border-color 0.15s;
}
.choice:hover .choice-badge,
.choice.selected .choice-badge {
  background: var(--orange); color: var(--white); border-color: var(--orange);
}

.roof-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--light);
  border: 1px solid var(--rule);
  margin: 18px 0 18px;
  overflow: hidden;
}
.roof-preview img,
.confirm-map {
  width: 100%;
  height: 100%;
  display: block;
}
.roof-preview img {
  object-fit: cover;
}
.confirm-actions {
  margin-top: 0;
}

.persons-label { font-size: 14px; color: var(--dark); margin: 0 0 12px; }
.persons-grid  {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 24px;
}
.persons-btn {
  padding: 14px 8px; border: 1.5px solid var(--rule);
  background: var(--white); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700;
  text-align: center; line-height: 1.4;
  transition: border-color 0.15s, background 0.15s;
}
.persons-btn span { font-weight: 400; color: var(--gray); font-size: 11px; }
.persons-btn:hover, .persons-btn.selected {
  border-color: var(--orange); background: var(--orange-light);
}

.mode-tabs {
  display: inline-flex; margin-bottom: 20px;
  border: 1px solid var(--rule); overflow: hidden;
}
.mode-tab {
  padding: 8px 16px; border: 0; border-right: 1px solid var(--rule);
  background: var(--white); font: inherit; font-size: 13px;
  cursor: pointer; color: var(--gray);
}
.mode-tab:last-child { border-right: 0; }
.mode-tab.active { background: var(--orange); color: var(--white); font-weight: 700; }

.kwh-row { display: flex; align-items: center; gap: 10px; }
.kwh-unit { font-size: 14px; color: var(--gray); }

.info-banner {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 24px; background: var(--orange-light);
  border-left: 4px solid var(--orange);
}
.info-icon-wrap {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--orange); flex-shrink: 0; position: relative;
}
.info-icon-wrap::after {
  content: 'i';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 900; font-size: 15px;
}
.info-banner h3 { margin: 0 0 8px; font-size: 18px; color: var(--black); }
.info-banner p  { margin: 0; color: var(--dark); font-size: 14px; line-height: 1.5; }

.nav-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 24px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 28px;
  background: var(--orange); color: var(--white);
  font: inherit; font-size: 15px; font-weight: 700;
  border: 0; cursor: pointer; text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover    { background: var(--orange-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-primary.loading  { cursor: wait; }
.btn-lg { height: 52px; font-size: 16px; }

.btn-ghost {
  display: inline-flex; align-items: center;
  height: 48px; padding: 0 20px;
  background: transparent; border: 1px solid var(--rule);
  color: var(--gray); font: inherit; font-size: 14px;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--dark); color: var(--dark); }

.spinner {
  width: 48px; height: 48px; margin: 0 auto 28px;
  border: 3px solid var(--rule); border-top-color: var(--orange);
  border-radius: 50%;
  display: block;
  transform-origin: 50% 50%;
  animation: spin 0.85s linear infinite;
  -webkit-animation: spin 0.85s linear infinite;
  }
@keyframes spin { to { transform: rotate(360deg); } }
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }

.gen-steps { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.gen-step  { font-size: 15px; color: var(--rule); transition: color 0.4s; }
.gen-step.active { color: var(--dark); font-weight: 600; }
.gen-step.done   { color: var(--green); }
.gen-step.done::before { content: '\2713\00a0'; }

.result-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.result-tick {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.result-head h2 { margin: 0; font-size: 22px; }
.result-head p  { margin: 4px 0 0; color: var(--gray); font-size: 14px; }

.result-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.btn-download { flex: 1; min-width: 200px; }
.result-actions .btn-primary,
.result-actions .btn-ghost { gap: 9px; }   .btn-icon { flex-shrink: 0; }
.map-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 18px;
}
.mode-chip {
  appearance: none;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 11px;
  cursor: pointer;
}
.mode-chip.active {
  border-color: var(--orange);
  color: var(--orange);
  box-shadow: inset 0 -2px 0 var(--orange);
}
.mode-chip:disabled {
  cursor: wait;
  opacity: 0.65;
}

.pdf-preview {
  position: relative;
  width: 100%;
  background: var(--light);
  border: 1px solid var(--rule);
  margin-bottom: 28px;
  overflow: hidden;
}
.pdf-preview iframe {
  width: 100%;
  height: 820px;
  border: 0;
  display: block;
  background: var(--light);
}
@media (max-width: 700px) {
  .pdf-preview iframe { height: 600px; }
  .result-actions { flex-direction: column; gap: 12px; }
  .result-actions .btn-primary,
  .result-actions .btn-ghost {
    width: 100%;
    height: 54px;
    justify-content: center;
    font-size: 16px;
    border-radius: 12px;
  }
}

.pdf-mobile-note { display: none; }
@media (hover: none) and (pointer: coarse) {
  .pdf-preview { display: none; }
  .pdf-mobile-note {
    display: block;
    background: var(--orange-light);
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 18px 16px;
    margin-bottom: 28px;
    color: var(--dark);
    font-size: 14px;
    line-height: 1.5;
  }
  #btn-fullscreen {
    order: -1;
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
    font-weight: 700;
  }
  #btn-fullscreen:hover { border-color: var(--orange); color: var(--white); }
  .btn-download {
    background: var(--white);
    border: 1px solid var(--orange);
    color: var(--orange);
  }
  .btn-download:hover { background: var(--orange-light); }
}

.contact-section {
  border-top: 1px solid var(--rule);
  padding-top: 28px;
}
.contact-section h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.25;
}
.contact-section > p {
  max-width: 700px;
  color: var(--gray);
  font-size: 14px;
  margin: 0 0 14px;
}
.contact-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  margin: 0 0 18px;
}
.contact-flow span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 650;
}
.contact-flow svg {
  flex: 0 0 auto;
  color: var(--green);
}
.contact-how {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--gray);
  font-size: 13px;
  margin: 0 0 10px;
}
.contact-how strong {
  color: var(--dark);
  font-size: 14px;
}
.contact-how span { text-align: right; }
.contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}
.contact-or {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.contact-comment {
  display: block;
  margin-bottom: 14px;
}
.contact-comment > span {
  display: block;
  margin-bottom: 6px;
}
.contact-comment small {
  color: var(--gray);
  font-weight: 400;
}
.contact-comment textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  font: inherit;
}
.contact-comment .character-count {
  display: block;
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
}
.status { font-size: 14px; color: var(--gray); margin: 10px 0 0; min-height: 20px; }
.status.error   { color: #c0392b; }
.status.success { color: var(--green); font-weight: 600; }

.privacy-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
}
.privacy-note a { color: var(--gray); text-decoration: underline; }
.privacy-note a:hover { color: var(--dark); }
.page-footer {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  padding: 20px 16px 28px;
}
.page-footer a { color: var(--gray); text-decoration: underline; }
.page-footer a:hover { color: var(--dark); }
.page-footer span { margin: 0 6px; }
@media (max-width: 620px) {
  .addr-grid { grid-template-columns: 1fr 1fr; }
  .addr-street, .addr-city { grid-column: 1 / -1; }
  .choice-grid.four { grid-template-columns: 1fr 1fr; }
  .choice-grid.two  { grid-template-columns: 1fr; }
  .persons-grid { grid-template-columns: 1fr 1fr; }
  .contact-flow { display: grid; gap: 8px; }
  .contact-how  { display: block; }
  .contact-how span {
    display: block;
    margin-top: 2px;
    text-align: left;
  }
  .contact-row  { grid-template-columns: 1fr; gap: 10px; }
  .contact-or {
    height: auto;
    justify-content: center;
  }
  .mode-tabs    { width: 100%; }
  .mode-tab     { flex: 1; text-align: center; }
}
@media (max-width: 420px) {
  .choice-grid.four { grid-template-columns: 1fr 1fr; }
  .persons-grid { grid-template-columns: 1fr 1fr; }
}
