/* ============================================================
   SKINOVA — Design tokens
   Palet diambil dari logo: teal gelap, dusty rose/blush, krem hangat
   ============================================================ */
:root {
  [hidden] { display: none !important; }
  /* feedback visual saat drag foto ke area upload */
.scan-frame.is-dragover {
  border-color: var(--rose-deep);
  background: var(--rose-light);
  transform: scale(1.01);
}

/* transisi halus saat preview foto muncul */
.scan-frame__img {
  animation: fadeInPreview 0.25s ease;
}
@keyframes fadeInPreview {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

/* jarak antar tombol Analisis & Coba foto lain lebih rapi */
#uploadForm { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.tool__panel > form > .scan-frame,
.tool__panel #analyzeBtn,
.tool__panel #resetBtn { margin: 0; }
  --bg: #FBF8F4;
  --surface: #FFFFFF;
  --surface-tint: #F3EFE8;

  --ink: #1F3A36;
  --ink-soft: #4A5F5A;
  --muted: #8A9A94;

  --teal: #1F3D3A;
  --teal-light: #2F6B5E;
  --rose: #D99C8E;
  --rose-light: #F0C9BE;
  --rose-deep: #C97B6D;

  --amber: #C98A3E;
  --danger: #B5482D;
  --success: #3C8562;

  --border: #E7E0D6;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --shadow: 0 20px 50px -25px rgba(31, 58, 54, 0.35);

  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--teal);
  margin: 0 0 0.4em;
  font-weight: 500;
  letter-spacing: -0.01em;
}

em { font-style: italic; color: var(--rose-deep); }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: inherit; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin: 0 0 0.8em;
}

/* ============ TOPBAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 244, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand__logo { height: 42px; display: block; }
.topnav { display: flex; align-items: center; gap: 28px; }
.topnav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.topnav__cta {
  background: var(--teal);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn--primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(31, 58, 54, 0.55);
}
.btn--primary:hover { transform: translateY(-1px); }
.btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn--lg { padding: 16px 32px; font-size: 1rem; }
.btn--ghost {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--border);
  margin-top: 10px;
}
.btn--ghost:hover { border-color: var(--teal); }

/* ============ HERO ============ */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 28px 60px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.3rem, 4.2vw, 3.4rem);
  line-height: 1.08;
}
.hero__desc { max-width: 46ch; font-size: 1.02rem; }
.hero__stats {
  display: flex;
  gap: 34px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--teal);
}
.stat__label { font-size: 0.78rem; color: var(--muted); }

.hero__art {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__blob {
  position: absolute;
  inset: 6%;
  background: linear-gradient(160deg, var(--rose-light), var(--rose) 55%, var(--teal-light));
  border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
  opacity: 0.35;
  filter: blur(2px);
  animation: blobmove 10s ease-in-out infinite alternate;
}
@keyframes blobmove {
  from { border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%; }
  to   { border-radius: 58% 42% 40% 60% / 55% 60% 40% 45%; }
}
.hero__logo-art { position: relative; width: 62%; z-index: 1; }

/* badge kecil di atas judul, biar ada aksen visual sebelum teks besar */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.hero__badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

/* glow lembut di belakang lingkaran blob, biar tidak flat */
.hero__art::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle, var(--rose-light) 0%, transparent 70%);
  opacity: 0.5;
  z-index: -1;
}

/* bayangan halus di bawah logo supaya "melayang" */
.hero__logo-art {
  filter: drop-shadow(0 20px 30px rgba(31, 58, 54, 0.15));
}

/* ============ SECTION HEAD ============ */
.section-head {
  max-width: 640px;
  margin: 0 auto 44px;
  text-align: center;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-desc { color: var(--ink-soft); }

/* ============ CONDITIONS GRID ============ */
.conditions { max-width: 1180px; margin: 0 auto; padding: 70px 28px; }
.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.condition-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.condition-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.condition-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.condition-card p { font-size: 0.87rem; margin: 0; color: var(--ink-soft); }
.condition-card__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.condition-card--tinggi { border-color: rgba(181, 72, 45, 0.35); }
.condition-card--tinggi .condition-card__badge { background: rgba(181, 72, 45, 0.12); color: var(--danger); }
.condition-card--sedang .condition-card__badge { background: rgba(201, 138, 62, 0.14); color: var(--amber); }
.condition-card--rendah .condition-card__badge { background: rgba(60, 133, 98, 0.13); color: var(--success); }

/* ============ HOW IT WORKS ============ */
/* ============ HOW IT WORKS ============ */
.how { background: var(--surface-tint); padding: 70px 28px; }
.how-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}
.how-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.how-step:hover {
  transform: translateY(-4px);
}
.how-step__num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--rose-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--surface-tint);
  border-radius: 50%;
  margin-bottom: 16px;
}
.how-step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.how-step p { font-size: 0.9rem; margin: 0; }

/* ============ TOOL / UPLOAD ============ */
.tool { max-width: 900px; margin: 0 auto; padding: 80px 28px; }
.tool__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.scan-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  border: 1.6px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.scan-frame:hover { border-color: var(--rose-deep); }
.scan-frame__empty {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}
.scan-frame__empty svg { color: var(--rose-deep); margin-bottom: 10px; }
.scan-frame__empty p { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 6px; }
.scan-frame__hint { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.scan-frame__img { width: 100%; height: 100%; object-fit: cover; }

.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rose-deep), transparent);
  box-shadow: 0 0 14px 2px rgba(201, 123, 109, 0.8);
  animation: scanmove 1.6s linear infinite;
}
@keyframes scanmove {
  0%   { top: 0%; }
  100% { top: 100%; }
}

.upload-error {
  color: var(--danger);
  font-size: 0.88rem;
  text-align: center;
}

/* ============ RESULT (SPA - tidak dipakai sekarang, dibiarkan aman) ============ */
.result {
  width: 100%;
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.result__urgency {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(181, 72, 45, 0.1);
  color: var(--danger);
  border: 1px solid rgba(181, 72, 45, 0.3);
}

.result__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.result__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.result__identity h2 { font-size: 1.6rem; margin: 6px 0 4px; }
.result__code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.gauge { position: relative; width: 160px; }
.gauge__svg { width: 100%; }
.gauge__value {
  position: absolute;
  bottom: 2px; left: 0; right: 0;
  text-align: center;
}
.gauge__value span#gaugePercent {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--teal);
}
.gauge__caption { font-size: 0.68rem; color: var(--muted); }

.result__top3 { display: flex; flex-direction: column; gap: 10px; }
.result__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.ai-card {
  background: linear-gradient(160deg, rgba(31,61,58,0.04), rgba(217,156,142,0.08));
  border: 1px solid rgba(31, 61, 58, 0.14);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.ai-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-card__badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--teal);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
}
.ai-card__head h3 { font-size: 1rem; margin: 0; }
.ai-card__body { font-size: 0.92rem; color: var(--ink-soft); white-space: pre-line; }
.ai-card__loading { color: var(--muted); font-style: italic; }

/* ============ TRUST ============ */
.trust { padding: 90px 28px; }
.trust__inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.trust__mark { width: 64px; margin-bottom: 18px; opacity: 0.9; }
.trust p { font-size: 0.94rem; }

/* ============ FOOTER ============ */
.footer {
  text-align: center;
  padding: 28px;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ============ RESPONSIVE (halaman index) ============ */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .hero__art { order: -1; max-width: 280px; margin: 0 auto; }
  .hero__stats { flex-wrap: wrap; gap: 20px; }
  .result__grid { grid-template-columns: 1fr; }
  .topnav a:not(.topnav__cta) { display: none; }
}

/* ============================================================
   RESULT PAGE (templates/result.html) — halaman hasil deteksi
   Class-class di bawah ini dipakai LANGSUNG oleh result.html,
   beda penamaan dari index.html di atas, jadi butuh definisi sendiri.
   ============================================================ */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px 70px; }

.hero-band {
  position: relative;
  padding-top: 30px;
  overflow: hidden;
}
.deco-plus {
  position: absolute;
  width: 20px;
  height: 20px;
  color: var(--rose-deep);
  opacity: 0.3;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark img { height: 38px; display: block; }
.wordmark {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--teal);
  font-weight: 600;
  line-height: 1.2;
}
.tagline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.header-pill {
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.header-pill:hover { border-color: var(--teal); }

.result-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}

.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(181, 72, 45, 0.1);
  border: 1px solid rgba(181, 72, 45, 0.3);
  color: var(--danger);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}
.warning-banner svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}

.result-top {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.result-photo {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.result-name { font-size: 1.5rem; margin: 4px 0 10px; }

.confidence-row { display: flex; align-items: center; gap: 12px; max-width: 320px; }
.confidence-bar {
  flex: 1;
  height: 8px;
  background: var(--surface-tint);
  border-radius: 999px;
  overflow: hidden;
}
.confidence-bar span {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}
.confidence-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--teal);
  font-size: 0.9rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--teal);
  margin: 0 0 14px;
}
.section-title svg { width: 18px; height: 18px; color: var(--rose-deep); flex-shrink: 0; }

.top3-list { display: flex; flex-direction: column; gap: 12px; }
.top3-item { display: flex; flex-direction: column; gap: 6px; }
.top3-row { display: flex; justify-content: space-between; font-size: 0.88rem; }
.top3-row .name { color: var(--ink-soft); }
.top3-row .pct { font-family: var(--font-mono); color: var(--muted); }
.top3-bar { height: 6px; background: var(--surface-tint); border-radius: 999px; overflow: hidden; }
.top3-bar span { display: block; height: 100%; background: var(--rose-deep); border-radius: 999px; }

.body-text { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.65; margin: 0; }

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--teal);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.ai-badge svg { width: 13px; height: 13px; }
.ai-content {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.75;
  white-space: pre-line; /* WAJIB: supaya newline dari Groq tetap tampil sebagai baris baru */
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  margin-top: 4px;
}
.back-link svg { width: 18px; height: 18px; }
.back-link:hover { text-decoration: underline; }

.disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface-tint);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}
.disclaimer svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.bottom-disclaimer { margin-top: 6px; }

@media (max-width: 560px) {
  .result-top { flex-direction: column; align-items: flex-start; }
  .confidence-row { max-width: 100%; }
}