:root {
  --bg: #f7f2ea;
  --surface: #ffffff;
  --text: #2a2218;
  --muted: #6f6252;
  --accent: #c85a28;
  --accent-dark: #9a4520;
  --accent-soft: rgba(200, 90, 40, 0.1);
  --gold: #d4a853;
  --gold-soft: rgba(212, 168, 83, 0.18);
  --border: #e6ddd0;
  --image-bg: #efe6da;
  --shadow: 0 8px 32px rgba(42, 34, 24, 0.07);
  --shadow-sm: 0 2px 12px rgba(42, 34, 24, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% -5%, rgba(212, 168, 83, 0.22), transparent 45%),
    radial-gradient(ellipse at 90% 110%, rgba(200, 90, 40, 0.1), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ── Header ── */

.site-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 0.5rem 0 1rem;
}

.site-badge {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.9rem;
  background: var(--gold-soft);
  border: 1px solid rgba(212, 168, 83, 0.45);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.site-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.65rem);
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: var(--accent-dark);
  line-height: 1.15;
}

.site-subtitle {
  color: var(--muted);
  margin: 0 auto;
  font-size: 1.05rem;
  max-width: 36rem;
}

.home-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.15s;
}

.home-link:hover {
  background: #fffaf4;
  transform: translateY(-1px);
}

.lang-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  z-index: 10;
}

.lang-toggle:hover {
  background: #fffaf4;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ── Layout grid ── */

.grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 820px) {
  .grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.5rem;
  }

  .card-form {
    grid-row: span 2;
  }
}

/* ── Cards ── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 1rem;
  color: var(--accent-dark);
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--gold);
}

.section-intro {
  margin: -0.35rem 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Image frames (consistent photo display) ── */

.image-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--image-bg);
  border-radius: var(--radius-sm);
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-position: center;
}

.image-frame--profile {
  aspect-ratio: 4 / 5;
  max-height: 420px;
}

.image-frame--profile img {
  object-fit: contain;
}

.image-frame--heat {
  aspect-ratio: 16 / 10;
}

.image-frame--heat img {
  object-fit: cover;
}

.image-frame--thumb {
  aspect-ratio: 5 / 4;
}

.image-frame--thumb img {
  object-fit: cover;
}

/* ── Profile showcase ── */

.card-profile {
  display: flex;
  flex-direction: column;
}

.profile-showcase {
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--image-bg);
}

.profile-showcase .image-frame {
  border-radius: 0;
  flex: 1;
  max-height: none;
}

.profile-showcase figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, #fff9f2, #fff5eb);
  border-top: 1px solid var(--border);
}

.profile-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.profile-note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Form ── */

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

select,
input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.radio-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
  background: var(--bg);
  transition: all 0.2s;
}

.radio-group input {
  accent-color: var(--accent);
}

.radio-group label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.btn {
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  margin-top: 0.5rem;
  box-shadow: 0 4px 14px rgba(154, 69, 32, 0.25);
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(154, 69, 32, 0.3);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  filter: none;
}

.field-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
  line-height: 1.45;
}

/* ── Heat gallery ── */

.card-heat {
  grid-column: 1 / -1;
}

.heat-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

.heat-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.heat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 90, 40, 0.45);
  box-shadow: var(--shadow-sm);
}

.heat-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.heat-card .image-frame {
  border-radius: 0;
}

.heat-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-dark);
  padding: 0.55rem 0.7rem 0.1rem;
  line-height: 1.3;
}

.heat-card-desc {
  font-size: 0.74rem;
  color: var(--muted);
  padding: 0 0.7rem 0.2rem;
  line-height: 1.4;
  flex: 1;
}

.photo-credit {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.3rem;
  line-height: 1.35;
  font-weight: 400;
}

.photo-credit a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.photo-credit a:hover {
  color: var(--accent);
}

.heat-card .photo-credit {
  padding: 0 0.7rem 0.6rem;
  margin-top: 0;
}

/* ── How it works ── */

.how-it-works {
  grid-column: 1 / -1;
}

.steps-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 900px) {
  .steps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.steps-grid li {
  margin: 0;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
  counter-increment: step;
}

.steps-grid {
  counter-reset: step;
}

.steps-grid li::before {
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Results ── */

.results-card {
  grid-column: 1 / -1;
}

.results-card.has-results {
  border-color: rgba(212, 168, 83, 0.55);
  background: linear-gradient(180deg, #ffffff, #fffcf8);
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 0.75rem;
  text-align: center;
}

.stat .value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1.2;
}

.stat .label {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.3rem;
  line-height: 1.3;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-dark);
  margin: 1.75rem 0 0.85rem;
}

.card h3:first-of-type {
  margin-top: 0.5rem;
}

.pax-banner {
  background: linear-gradient(135deg, var(--accent-soft), var(--gold-soft));
  border: 1px solid rgba(212, 168, 83, 0.5);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.45;
}

/* ── Result media cards ── */

.heat-result-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .heat-result-images {
    grid-template-columns: 1fr 1fr;
  }
}

.media-card {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--image-bg);
  display: flex;
  flex-direction: column;
}

.media-card .image-frame {
  border-radius: 0;
  flex-shrink: 0;
}

.media-card figcaption {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.media-card figcaption strong {
  display: block;
  color: var(--accent-dark);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.media-desc {
  display: block;
  margin-bottom: 0.35rem;
}

/* ── Ingredients & caldo ── */

.ingredient-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

@media (min-width: 600px) {
  .ingredient-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

.ingredient-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
}

.ingredient-list .amount {
  font-weight: 700;
  color: var(--accent-dark);
  white-space: nowrap;
}

.caldo-box {
  background: linear-gradient(135deg, var(--gold-soft), var(--accent-soft));
  border: 1px solid rgba(212, 168, 83, 0.45);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}

.caldo-box p {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.caldo-box .highlight {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.cooking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.cooking-stat {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  text-align: center;
}

.cooking-stat .label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.3;
}

.cooking-stat .value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-top: 0.25rem;
}

.cooking-stat .heat-value {
  font-size: 0.82rem;
  line-height: 1.25;
}

.recipe-steps {
  margin: 0;
  padding-left: 1.4rem;
  color: var(--text);
}

.recipe-steps li {
  margin-bottom: 0.7rem;
  padding-left: 0.25rem;
  line-height: 1.55;
}

.recipe-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* ── Warnings & location ── */

.warnings {
  background: #fff8e8;
  border: 1px solid #e8d4a0;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: #7a6520;
  line-height: 1.5;
}

.warnings ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.location-status {
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
  min-height: 1.25rem;
  font-weight: 500;
}

.location-status.loading {
  color: var(--muted);
  font-style: italic;
}

.location-status.ok {
  color: #2d6a3e;
}

.location-status.error {
  color: #a32b1a;
}

.location-banner {
  background: #eef6f0;
  border: 1px solid #b8d9c0;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin-top: 1.25rem;
  font-size: 0.92rem;
  color: #2d6a3e;
  font-weight: 500;
}

/* ── Sources ── */

.sources {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--muted);
}

.sources ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.6;
}

.sources a {
  color: var(--accent);
}

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

/* ── Utilities ── */

.hidden {
  display: none !important;
}

#results-empty {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  font-size: 0.95rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}