:root {
  --bg: #f6f0e7;
  --panel: rgba(255, 251, 246, 0.92);
  --text: #201913;
  --muted: #68584f;
  --line: rgba(111, 87, 66, 0.18);
  --accent: #cb5d2e;
  --accent-dark: #9d3f17;
  --accent-soft: rgba(203, 93, 46, 0.12);
  --mint: #2f7763;
  --mint-soft: rgba(47, 119, 99, 0.12);
  --shadow: 0 20px 60px rgba(52, 35, 24, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

.back-to-fons {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 251, 246, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(111, 87, 66, 0.18);
  border-radius: 8px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(52, 35, 24, 0.1);
  transition: background 0.15s, border-color 0.15s;
}

.back-to-fons:hover {
  background: rgba(255, 251, 246, 1);
  border-color: rgba(111, 87, 66, 0.32);
}

body {
  margin: 0;
  font-family: Aptos, "Aptos Display", Bahnschrift, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(203, 93, 46, 0.18), transparent 36%),
    radial-gradient(circle at 85% 10%, rgba(47, 119, 99, 0.18), transparent 22%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
}

a {
  color: var(--accent-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 22px;
}

.hero-copy,
.hero-panel,
.search-panel,
.results-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  border-radius: var(--radius-xl);
  padding: 36px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.lede {
  margin: 18px 0 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.hero-panel {
  border-radius: var(--radius-xl);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.panel-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.panel-card.accent {
  background: linear-gradient(180deg, rgba(203, 93, 46, 0.12), rgba(255, 255, 255, 0.78));
}

.panel-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-value {
  margin-top: 8px;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.2;
}

.panel-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.content-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.search-panel,
.results-panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.section-head h2,
.results-toolbar h2,
.privacy-card h3 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.section-head p,
.results-toolbar p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.search-box,
.status-card,
.privacy-card {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.search-box label,
.filters label,
.note-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.94rem;
  font-weight: 700;
}

.search-box input,
.filters select,
.saved-note {
  width: 100%;
  border: 1px solid rgba(111, 87, 66, 0.26);
  background: #fffdf9;
  color: var(--text);
  border-radius: 14px;
  padding: 14px 15px;
}

.search-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid rgba(111, 87, 66, 0.18);
}

.microcopy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.address-error {
  margin: 6px 0 0;
  color: var(--accent-dark);
  font-size: 0.88rem;
  line-height: 1.5;
}

.filters {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.status-card strong {
  display: block;
  font-size: 1.08rem;
}

.status-card p,
.privacy-card ul {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

@keyframes status-flash-ok {
  0%   { background: rgba(47, 119, 99, 0.22); border-color: rgba(47, 119, 99, 0.5); }
  100% { background: rgba(255, 255, 255, 0.74); border-color: var(--line); }
}

@keyframes status-flash-err {
  0%   { background: rgba(203, 93, 46, 0.18); border-color: rgba(203, 93, 46, 0.45); }
  100% { background: rgba(255, 255, 255, 0.74); border-color: var(--line); }
}

@keyframes status-flash-neutral {
  0%   { background: rgba(111, 87, 66, 0.12); border-color: rgba(111, 87, 66, 0.35); }
  100% { background: rgba(255, 255, 255, 0.74); border-color: var(--line); }
}

.status-card--flash-ok {
  animation: status-flash-ok 1.2s ease-out forwards;
}

.status-card--flash-err {
  animation: status-flash-err 1.2s ease-out forwards;
}

.status-card--flash-neutral {
  animation: status-flash-neutral 0.9s ease-out forwards;
}

.results-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.stat-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  color: var(--muted);
}

.results-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.72fr);
  gap: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(252, 246, 239, 0.88));
  padding: 20px;
}

.result-card.is-saved {
  box-shadow: inset 0 0 0 1px rgba(47, 119, 99, 0.25);
  background: linear-gradient(180deg, rgba(47, 119, 99, 0.08), rgba(255, 255, 255, 0.9));
}

.result-topline,
.procedures,
.wait-days {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.distance-chip,
.city-chip,
.procedure-chip,
.wait-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.9rem;
}

.distance-chip {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.city-chip {
  background: rgba(32, 25, 19, 0.06);
  color: var(--muted);
}

.provider-name {
  margin: 10px 0 0;
  font-size: 1.34rem;
  letter-spacing: -0.03em;
}

.provider-address {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.5;
}

.phone-row {
  margin-bottom: 12px;
}

.phone-link {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(47, 119, 99, 0.1);
  color: var(--mint);
  text-decoration: none;
  font-weight: 700;
}

.procedure-chip {
  background: rgba(32, 25, 19, 0.06);
}

.wait-chip {
  background: var(--mint-soft);
  color: var(--mint);
}

.result-notes {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(111, 87, 66, 0.14);
  border-radius: 20px;
  padding: 16px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-weight: 700;
}

.checkline input {
  width: 20px;
  height: 20px;
  accent-color: var(--mint);
}

.saved-note {
  resize: vertical;
  min-height: 120px;
}

.empty-state {
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(111, 87, 66, 0.25);
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .hero,
  .content-grid,
  .result-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .hero-copy,
  .hero-panel,
  .search-panel,
  .results-panel {
    border-radius: 24px;
    padding: 18px;
  }

  .search-actions,
  .filters {
    grid-template-columns: 1fr;
  }

  .results-toolbar {
    flex-direction: column;
  }
}
