:root {
  --bg-top: #e8e6eb;
  --bg-bottom: #f5f6f3;
  --ink: #211b2a;
  --muted: #6a6573;
  --line: #d0ccd6;
  --surface: #ffffff;
  --surface-alt: #f3f2f5;
  --brand: #739b6c;
  --brand-dark: #5a7d54;
  --steel: #211b2a;
  --danger: #9f1a1a;
  --warning: #7a5a00;
  --warning-bg: #f7efd4;
  --ok: #5a7d54;
  --radius: 4px;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: linear-gradient(165deg, var(--bg-top) 0%, var(--bg-bottom) 45%, #eef1ea 100%);
  position: relative;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(33, 27, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 27, 42, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 22px 72px;
}

/* —— Hero / brand —— */
.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 3px solid var(--ink);
  animation: rise-in 0.55s ease both;
}

.brand-logo {
  display: block;
  width: min(280px, 72vw);
  height: auto;
  margin: 0 0 14px;
}

.hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}

.intro {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.02rem;
}

/* —— Layout —— */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.78fr);
  gap: 22px;
  align-items: start;
}

.calculator-panel,
.quote-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: rise-in 0.65s ease both;
}

.calculator-panel {
  padding: 28px 26px 32px;
  animation-delay: 0.06s;
}

.quote-panel {
  padding: 0;
  border-top: 4px solid var(--brand);
  animation-delay: 0.12s;
}

.quote-sticky {
  position: sticky;
  top: 16px;
  padding: 22px 22px 24px;
}

/* —— Sections —— */
.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 6px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.step-index {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--brand);
  flex: 0 0 auto;
  padding-top: 2px;
}

.section-heading h2 {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.room-heading { margin-top: 36px; }

.grid { display: grid; gap: 15px; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 6px;
  color: var(--steel);
  font-size: 0.88rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input:hover,
select:hover {
  border-color: #a8b4c0;
}

input:focus,
select:focus {
  border-color: var(--steel);
  background: #fafbfc;
}

.input-affix {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.input-affix:focus-within {
  border-color: var(--steel);
}

.input-affix input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.input-affix span {
  padding-left: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.input-affix.suffix span {
  padding: 0 12px 0 0;
}

.checkbox-panel {
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  display: grid;
  gap: 10px;
  background: var(--surface-alt);
}

.checkbox-panel legend {
  padding: 0 6px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkbox-panel label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  color: var(--ink);
}

.checkbox-panel input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

/* —— Rooms —— */
.room-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin-bottom: 14px;
  background: var(--surface-alt);
  animation: rise-in 0.35s ease both;
}

.room-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.room-topline h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.remove-room {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0;
}

.remove-room:hover { text-decoration: underline; }

.room-result {
  margin-top: 14px;
  padding: 11px 12px;
  background: var(--surface);
  border-left: 3px solid var(--brand);
  display: grid;
  gap: 0.45rem;
}

.room-result > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

.room-result span { color: var(--muted); }

/* —— Buttons —— */
.primary-button,
.secondary-button {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.primary-button {
  background: var(--brand);
  color: #fff;
  width: 100%;
  margin-top: 16px;
}

.primary-button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.primary-button:active { transform: translateY(0); }

.secondary-button {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.secondary-button:hover {
  border-color: var(--steel);
  background: var(--surface-alt);
}

.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.full-width { width: 100%; margin-top: 4px; }

.hero .secondary-button {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 8px;
}

/* —— Quote panel —— */
.quote-label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.total-price {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-top: 6px;
  color: var(--ink);
  transition: color 0.2s ease;
}

.vat-note {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pre-markup-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.94rem;
}

.pre-markup-row span { color: var(--muted); }
.pre-markup-row strong { font-weight: 600; }

.summary-block {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  display: grid;
  gap: 9px;
}

.summary-block div,
.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.94rem;
}

.summary-block span,
.breakdown-row span { color: var(--muted); }

.summary-block strong { text-align: right; font-weight: 600; }

.breakdown {
  padding: 14px 0;
  display: grid;
  gap: 9px;
}

.breakdown-row.total {
  border-top: 1px solid var(--ink);
  padding-top: 11px;
  margin-top: 2px;
  font-size: 1.02rem;
  font-weight: 600;
}

.breakdown-row.discount strong { color: var(--ok); }

.warnings { display: grid; gap: 8px; }

.warning {
  padding: 10px 12px;
  border-radius: var(--radius);
  border-left: 3px solid var(--warning);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 0.86rem;
  line-height: 1.45;
}

.disclaimer {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 14px 0 0;
}

.equipment-reference {
  margin: 0.75rem 0;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  line-height: 1.45;
}

.equipment-reference > div { margin-top: 0.6rem; }

.equipment-reference a {
  display: inline-block;
  margin-top: 0.55rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.equipment-reference a:hover { text-decoration: underline; }

.equipment-reference small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .quote-sticky { position: static; }
  .hero { align-items: flex-start; }
}

@media (max-width: 640px) {
  .app-shell { padding: 24px 14px 48px; }
  .hero {
    flex-direction: column;
    align-items: stretch;
  }
  .hero .secondary-button { align-self: stretch; }
  .calculator-panel { padding: 20px 16px 24px; }
  .two-column { grid-template-columns: 1fr; }
  .total-price { font-size: 2.45rem; }
}

/* —— PDF document (rendered off-screen for download) —— */
.pdf-document {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 794px;
  background: #fff;
  color: #211b2a;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
}

.pdf-document.pdf-render {
  left: 0;
  top: 0;
  opacity: 1;
  z-index: 0;
}

.pdf-sheet {
  padding: 36px 40px 44px;
  box-sizing: border-box;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 3px solid #211b2a;
  margin-bottom: 22px;
}

.pdf-header img {
  width: 220px;
  height: auto;
  display: block;
}

.pdf-meta {
  text-align: right;
  font-size: 12px;
  color: #6a6573;
  line-height: 1.5;
}

.pdf-meta strong {
  display: block;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #211b2a;
  margin-bottom: 4px;
}

.pdf-section {
  margin-bottom: 18px;
  page-break-inside: avoid;
}

.pdf-section h2 {
  margin: 0 0 10px;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #739b6c;
  border-bottom: 1px solid #d0ccd6;
  padding-bottom: 6px;
}

.pdf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  font-size: 13px;
}

.pdf-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #eee;
}

.pdf-grid span { color: #6a6573; }
.pdf-grid strong { text-align: right; font-weight: 600; }

.pdf-total-block {
  background: #f3f2f5;
  border-left: 4px solid #739b6c;
  padding: 14px 16px;
  margin-bottom: 18px;
  page-break-inside: avoid;
}

.pdf-total-block .label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6a6573;
}

.pdf-total-block .amount {
  margin: 4px 0 6px;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: #211b2a;
}

.pdf-total-block .sub {
  margin: 0;
  font-size: 13px;
  color: #6a6573;
}

.pdf-rows {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.pdf-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.pdf-row.total {
  border-top: 1px solid #211b2a;
  border-bottom: 0;
  margin-top: 4px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 14px;
}

.pdf-row.discount strong { color: #5a7d54; }
.pdf-row span { color: #6a6573; }

.pdf-note,
.pdf-warning {
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #f7efd4;
  border-left: 3px solid #7a5a00;
  color: #7a5a00;
}

.pdf-equip {
  font-size: 12px;
  line-height: 1.5;
  color: #211b2a;
}

.pdf-equip > div { margin-top: 8px; }
.pdf-equip small { display: block; color: #6a6573; margin-top: 2px; }

.pdf-disclaimer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #d0ccd6;
  font-size: 11px;
  color: #6a6573;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
