/* Homepage — content specific to /. Shared header/drawer/footer/hero-pill
   CSS lives in /static/base.css. */

/* ── DESKTOP HERO STRIP ── */
.hero-strip {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 28px 40px 24px;
}

.hero-strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* hero-top: stacked column — headline, then full-width stats bar */
.hero-top {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-headline-block { width: 100%; }

.hero-headline-block h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 10px;
  /* No nowrap: translated headlines (e.g. German) run longer than the
     English original and need to wrap rather than overflow. */
}

.hero-headline-block p {
  font-size: 0.9rem;
  color: var(--ink-light);
  font-weight: 300;
  line-height: 1.7;
}

/* stats bar stretches full width */
.hero-stats-block {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}

.hero-stat {
  flex: 1;
  padding: 16px 20px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.hero-stat:last-child { border-right: none; }

.hero-stat-num {
  display: block;
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 3px;
}
.hero-stat-label { font-size: 0.7rem; color: var(--ink-light); white-space: nowrap; }

.hero-bottom {
  display: flex;
  align-items: center;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.privacy-strip {
  background: #f0faf4;
  border: 1px solid #b7e4c7;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 0.82rem;
  color: #1a6b3a;
  width: 100%;
  text-align: center;
}

/* ── MAIN GRID ── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px 60px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.col-upload, .col-right { display: flex; flex-direction: column; }

.col-upload #upload-card { flex: 1; display: flex; flex-direction: column; }
.col-upload #upload-card .notes-section { flex: 1; display: flex; flex-direction: column; }
.col-upload #upload-card .notes-section textarea { flex: 1; min-height: 80px; resize: none; }

/* results-panel lives in col-upload, hidden until analysis completes */
.col-upload #results-panel { flex: 1; }
.col-right #slideshow-panel { flex: 1; }

/* ── SHARED PANEL ── */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.panel-section:last-child { border-bottom: none; }

.section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-light); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 2rem; margin-bottom: 8px; display: block; }
.upload-zone h3 { font-size: 0.9rem; font-weight: 500; margin-bottom: 4px; }
.upload-zone p { font-size: 0.78rem; color: var(--ink-light); }

/* ── PREVIEW GRID ── */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, 72px); gap: 8px; margin-top: 12px; }
.preview-item { position: relative; width: 72px; aspect-ratio: 1; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .remove {
  position: absolute; top: 3px; right: 3px;
  background: rgba(0,0,0,0.6); color: white; border: none;
  border-radius: 50%; width: 20px; height: 20px; cursor: pointer;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
}

/* ── ANGLE TIPS ── */
.angle-tips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 12px; }
.angle-tips-label { font-size: 0.72rem; color: var(--ink-faint); white-space: nowrap; }
.angle-tip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px;
  font-size: 0.72rem; color: var(--ink-light); font-weight: 500;
}
.angle-tip svg { width: 10px; height: 10px; opacity: 0.5; }

.upload-section { padding-bottom: 8px; }
.no-upload-note { font-size: 0.76rem; color: var(--ink-light); margin-top: 10px; }
.no-upload-note a { color: var(--accent); text-decoration: none; font-weight: 500; }
.no-upload-note a:hover { text-decoration: underline; }

/* ── INLINE STEPS ── */
.inline-steps { display: flex; flex-direction: column; gap: 12px; }
.inline-step { display: flex; align-items: flex-start; gap: 11px; }
.inline-step-num {
  width: 22px; height: 22px; min-width: 22px;
  background: var(--accent); color: white;
  border-radius: 50%; font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.inline-step-text h4 { font-size: 0.82rem; font-weight: 600; margin-bottom: 1px; }
.inline-step-text p { font-size: 0.73rem; color: var(--ink-light); line-height: 1.4; }

/* ── TEXTAREA ── */
textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; color: var(--ink); background: var(--bg);
  transition: border-color 0.2s; outline: none;
}
textarea:focus { border-color: var(--accent); background: var(--white); }
textarea::placeholder { color: var(--ink-faint); }

/* ── BUTTONS ── */
.btn-analyze {
  width: 100%; background: var(--accent); color: white; border: none;
  border-radius: 9px; padding: 14px;
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500;
  cursor: pointer; transition: background 0.2s, transform 0.1s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-analyze:hover { background: #224830; }
.btn-analyze:active { transform: scale(0.99); }
.btn-analyze:disabled { background: var(--ink-faint); cursor: not-allowed; transform: none; }

.btn-download {
  width: 100%; background: var(--accent); color: white; border: none;
  border-radius: 9px; padding: 13px; font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px;
}
.btn-download:hover { background: #224830; }
.btn-download:disabled { background: var(--ink-faint); cursor: not-allowed; }

.btn-reset {
  width: 100%; background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 9px; padding: 12px;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-reset:hover { background: var(--accent-light); }

.error-box {
  display: none; background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 7px; padding: 12px 14px; color: #991b1b; font-size: 0.82rem; margin-top: 10px;
}
.error-box.active { display: block; }

/* ── LOADING ── */
.loading { display: none; text-align: center; flex: 1; align-items: center; justify-content: center; flex-direction: column; min-height: 400px; }
.loading.active { display: flex; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: var(--ink-light); font-size: 0.88rem; }

/* ── RESULTS ── */
#results-panel { display: none; }
#results-panel.active { display: block; }

.result-hero { background: var(--accent); color: white; padding: 24px; text-align: center; }
.graft-number { font-family: 'DM Serif Display', serif; font-size: 3rem; line-height: 1; margin-bottom: 4px; }
.graft-range { font-size: 0.82rem; opacity: 0.8; margin-bottom: 12px; }
.result-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.tag { background: rgba(255,255,255,0.2); border-radius: 20px; padding: 3px 10px; font-size: 0.75rem; font-weight: 500; }

.cc-cost-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.cc-cost-table th {
  text-align: left; font-size: 0.68rem; font-weight: 600; color: var(--ink-light);
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0 0 8px;
  border-bottom: 2px solid var(--border);
}
.cc-cost-table th:last-child, .cc-cost-table td:last-child { text-align: right; }
.cc-cost-table td {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; color: var(--ink);
}
.cc-cost-table tr:last-child td { border-bottom: none; }
.cc-cost-table td.cc-cost-value { font-family: 'DM Serif Display', serif; font-size: 1.05rem; color: var(--accent); }
.cost-caption { font-size: 0.76rem; color: var(--ink-light); }
.cost-caption a { color: var(--accent); text-decoration: none; }
.cost-caption a:hover { text-decoration: underline; }

.zones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.zone-card { background: var(--bg); border-radius: 9px; padding: 13px; }
.zone-card .zone-name { font-size: 0.7rem; color: var(--ink-light); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.05em; }
.zone-card .zone-val { font-size: 1.3rem; font-weight: 600; color: var(--accent); }
.zone-card .zone-unit { font-size: 0.75rem; color: var(--ink-light); font-weight: 400; }

.confidence-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.confidence-level { font-weight: 500; text-transform: capitalize; font-size: 0.9rem; }
.confidence-reason { font-size: 0.76rem; color: var(--ink-light); text-align: right; max-width: 60%; }
.confidence-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.confidence-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.6s ease; }

.obs-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.obs-list li { display: flex; gap: 8px; font-size: 0.83rem; color: var(--ink-light); line-height: 1.5; }
.obs-list li::before { content: '→'; color: var(--accent); flex-shrink: 0; }

.rec-box {
  background: var(--accent-light); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 13px 15px; font-size: 0.85rem; color: var(--ink); line-height: 1.7;
}

.disclaimer {
  background: var(--warn-light); border-radius: 7px; padding: 11px 13px;
  font-size: 0.76rem; color: var(--warn); display: flex; gap: 7px; align-items: flex-start; margin-top: 14px;
}

.result-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-image { aspect-ratio: 1; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); cursor: pointer; transition: transform 0.15s; }
.result-image:hover { transform: scale(1.03); }
.result-image img { width: 100%; height: 100%; object-fit: cover; }

.chars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.char-item { background: var(--bg); border-radius: 7px; padding: 10px; text-align: center; }
.char-item .char-label { font-size: 0.66rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.char-item .char-val { font-size: 0.83rem; font-weight: 500; color: var(--ink); text-transform: capitalize; }

/* ── SLIDESHOW ── */
.panel-header { padding: 18px 22px 0; }
.panel-title { font-family: 'DM Serif Display', serif; font-size: 1.1rem; margin-bottom: 3px; }
.panel-subtitle { font-size: 0.78rem; color: var(--ink-light); font-weight: 300; margin-bottom: 16px; }

.slide-stage { position: relative; }
.slide {
  padding: 16px 22px 20px;
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.slide.leaving { position: absolute; opacity: 0; }
.slide.active { position: relative; opacity: 1; pointer-events: auto; }

.slide-img-wrap {
  position: relative; border-radius: 9px; overflow: hidden;
  margin-bottom: 14px; background: var(--bg); aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.slide-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.slide-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8f0eb 0%, #d1e8d8 100%); gap: 10px;
}
.slide-placeholder .head-svg { width: 80px; opacity: 0.4; }
.slide-label {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.55); color: white;
  font-size: 0.7rem; padding: 3px 9px; border-radius: 20px; font-weight: 500;
}

.slide-result { background: var(--accent); border-radius: 9px; padding: 14px 16px; color: white; margin-bottom: 12px; }
.slide-graft { font-family: 'DM Serif Display', serif; font-size: 2rem; line-height: 1; margin-bottom: 2px; }
.slide-range { font-size: 0.75rem; opacity: 0.8; margin-bottom: 10px; }
.slide-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.slide-tag { background: rgba(255,255,255,0.2); border-radius: 20px; padding: 3px 10px; font-size: 0.72rem; font-weight: 500; }

.slide-zones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 12px; }
.slide-zone { background: var(--bg); border-radius: 7px; padding: 10px 12px; }
.slide-zone-name { font-size: 0.68rem; color: var(--ink-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.slide-zone-val { font-size: 1.1rem; font-weight: 600; color: var(--accent); }
.slide-zone-unit { font-size: 0.72rem; color: var(--ink-light); font-weight: 400; }

.slide-cost-box { background: var(--accent-light); border-radius: 9px; padding: 11px 14px; margin-bottom: 12px; }
.slide-cost-label { font-size: 0.68rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.slide-cost-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; padding: 2px 0; }
.slide-cost-row span:first-child { color: var(--ink-light); }
.slide-cost-val { font-weight: 700; color: var(--accent); }

.slide-obs { font-size: 0.78rem; color: var(--ink-light); line-height: 1.5; font-style: italic; border-left: 2px solid var(--accent-light); padding-left: 10px; }

.slide-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px 18px; border-top: 1px solid var(--border); }
.slide-dots { display: flex; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); cursor: pointer; transition: background 0.2s; }
.dot.active { background: var(--accent); }
.slide-arrows { display: flex; gap: 6px; }
.arrow-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: var(--ink-light); font-size: 0.8rem; transition: all 0.15s;
}
.arrow-btn:hover { border-color: var(--accent); color: var(--accent); }
.slide-caption { font-size: 0.72rem; color: var(--ink-faint); }

/* ── LIGHTBOX ── */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 100; align-items: center; justify-content: center; padding: 24px; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 10px; object-fit: contain; }
.lightbox-close { position: fixed; top: 16px; right: 20px; color: white; font-size: 2rem; cursor: pointer; background: none; border: none; line-height: 1; opacity: 0.8; }
.lightbox-close:hover { opacity: 1; }

/* ── MOBILE ── */
@media (max-width: 900px) {
  .hero-strip { display: none; }

  .main-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    align-items: start;
    padding: 16px 16px 48px;
    gap: 16px;
  }

  .mobile-hero {
    display: block;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px 20px 18px;
  }

  .mobile-hero .hero-pill {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--accent-light); color: var(--accent);
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em;
    padding: 5px 12px; border-radius: 20px; margin-bottom: 12px;
  }

  .mobile-hero .mobile-hero-title { font-family: 'DM Serif Display', serif; font-size: 1.5rem; line-height: 1.2; margin-bottom: 8px; }
  .mobile-hero p { font-size: 0.83rem; color: var(--ink-light); font-weight: 300; line-height: 1.6; margin-bottom: 14px; }

  .mobile-hero .hero-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 12px;
  }

  .mobile-hero .hero-stat { padding: 12px 8px; text-align: center; border-right: 1px solid var(--border); }
  .mobile-hero .hero-stat:last-child { border-right: none; }
  .mobile-hero .hero-stat-num { display: block; font-family: 'DM Serif Display', serif; font-size: 1.2rem; color: var(--accent); line-height: 1.1; margin-bottom: 2px; }
  .mobile-hero .hero-stat-label { font-size: 0.65rem; color: var(--ink-light); }

  .mobile-hero .privacy-strip { text-align: center; background: #f0faf4; border: 1px solid #b7e4c7; border-radius: 8px; padding: 9px 12px; font-size: 0.76rem; color: #1a6b3a; }
}

@media (min-width: 901px) {
  .mobile-hero { display: none; }
}
