:root {
  --ink: #17202a;
  --muted: #637083;
  --line: #d9e2ec;
  --paper: #ffffff;
  --soft: #f5f7fa;
  --brand: #176b87;
  --brand-dark: #104d61;
  --accent: #f2a13a;
  --danger: #c7352f;
  --warning: #b86b00;
  --success: #28765a;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.12), transparent 35%),
    linear-gradient(180deg, #eef5f7 0%, #f7f5f0 44%, #f5f7fa 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(217, 226, 236, 0.8);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.top-nav a,
.eyebrow,
.field-help,
.form-note,
.drop-zone small,
.category-tile small {
  color: var(--muted);
}

.top-nav {
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
  font-weight: 700;
}

.top-nav a:hover {
  color: var(--brand);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(38px, 7vw, 92px) clamp(18px, 4vw, 56px) 56px;
}

.hero-copy {
  padding-top: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2.35rem, 7vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.65rem, 4vw, 2.65rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.hero-lead {
  max-width: 620px;
  color: #364557;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.hero-badges,
.benefits-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges span,
.benefits-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 700;
}

.diagnostic-card,
.result-section,
.contact-section {
  background: var(--paper);
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.diagnostic-card {
  padding: clamp(18px, 3vw, 30px);
}

.card-heading p:last-child {
  color: var(--muted);
}

fieldset {
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

legend,
.field-label,
.contact-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

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

.category-tile {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 126px;
  padding: 16px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.1);
}

.category-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-tile:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.16);
}

.tile-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #eef5f7;
  font-weight: 800;
}

.auto-tile .tile-icon {
  color: #fff;
  background: var(--ink);
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 144px;
  padding: 14px;
  resize: vertical;
}

input {
  min-height: 48px;
  padding: 0 13px;
}

textarea:focus,
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.15);
}

.field-help {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 22px;
  font-size: 0.88rem;
}

.drop-zone {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 172px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  border: 1.5px dashed #abc1ce;
  border-radius: var(--radius);
  background: #f8fbfc;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone.is-dragover {
  border-color: var(--brand);
  background: #eef8fa;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 700;
}

.photo-preview {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.photo-preview img {
  width: 112px;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
}

.photo-preview button,
.secondary-button {
  width: fit-content;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand-dark);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(23, 107, 135, 0.22);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-note {
  margin: 12px 0 0;
  font-size: 0.88rem;
}

.loading-state {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fbfc;
}

.pulse-ring {
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border: 4px solid rgba(23, 107, 135, 0.14);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-state ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.loading-state li {
  min-height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf3f5, #ffffff, #edf3f5);
  background-size: 220% 100%;
  color: #425161;
  padding: 8px 12px;
  animation: shimmer 1.4s ease-in-out infinite;
}

.result-section,
.steps-section,
.services-section,
.benefits-section,
.contact-section {
  max-width: 1180px;
  margin: 34px auto;
  padding: clamp(22px, 4vw, 42px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

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

.result-card,
.cta-box,
.follow-up-box,
.steps-grid article,
.service-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
}

.result-card.wide,
.cta-box,
.follow-up-box {
  grid-column: 1 / -1;
}

.result-card ul,
.service-card ul {
  margin: 0;
  padding-left: 19px;
}

.urgency-pill,
.confidence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  color: #fff;
  font-weight: 800;
}

.urgency-niska,
.confidence-wysoka {
  background: var(--success);
}

.urgency-średnia,
.confidence-średnia {
  background: var(--warning);
}

.urgency-wysoka,
.urgency-niebezpieczeństwo,
.confidence-niska {
  background: var(--danger);
}

.safety-warning {
  border-color: rgba(199, 53, 47, 0.35);
  background: #fff3f1;
}

.service-box {
  border-color: rgba(23, 107, 135, 0.28);
  background: #eef8fa;
}

.cta-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
  background: #17202a;
  color: #fff;
}

.cta-box p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
}

.cta-box .primary-button {
  width: auto;
  min-width: 260px;
  margin-top: 0;
  background: var(--accent);
  color: #231709;
  box-shadow: none;
}

.follow-up-box {
  margin-top: 18px;
}

.follow-up-box ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.follow-up-form {
  display: grid;
  gap: 12px;
}

.steps-grid,
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.steps-grid span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.service-card {
  min-height: 292px;
}

.service-card h3 {
  padding-bottom: 10px;
  border-bottom: 3px solid var(--line);
}

.service-card.electric h3 {
  border-color: #f2c14e;
}

.service-card.water h3 {
  border-color: #4aa3c7;
}

.service-card.gas h3 {
  border-color: #e16b3d;
}

.benefits-list span {
  background: #fff;
}

.contact-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(24px, 5vw, 60px);
}

.contact-copy p:last-child {
  color: var(--muted);
}

.contact-form {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-form textarea {
  min-height: 132px;
}

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.consent-field input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 2px;
}

.status-message {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 800;
}

.error-message {
  color: var(--danger);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@media (max-width: 980px) {
  .hero,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-top: 0;
  }

  .top-nav {
    display: none;
  }

  .cta-box {
    grid-template-columns: 1fr;
  }

  .cta-box .primary-button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 12px 16px;
  }

  .hero {
    padding: 28px 14px 26px;
  }

  .diagnostic-card,
  .result-section,
  .steps-section,
  .services-section,
  .benefits-section,
  .contact-section {
    margin: 18px 14px;
    padding: 18px;
  }

  .category-grid,
  .result-grid,
  .steps-grid,
  .services-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .category-tile {
    min-height: 104px;
  }

  .photo-preview {
    grid-template-columns: 1fr;
  }

  .photo-preview img {
    width: 100%;
    height: auto;
    max-height: 220px;
  }

  .site-footer {
    display: block;
  }
}
