/* =========================
   0) Reset ringan + variable
   ========================= */
:root {
  --bg:#F7FAF5;
  --surface: #E8F5EE;
  --card: #FFFFFF;
  --text: #1A3328;
  --muted:#4A7A65;
  --primary: #1D9E75;
  --primary-2:#0F6E56;
  --border: #C8E6D8;
  --accent: #D4A843;
  --accent-light:#F5E9C8;
  --cta: #C4622D;
  --cta-dark: #A34E22;
}

* {
  box-sizing: border-box; /* Box sizing: border-box */
}

html,
body {
  height: 100%;
}

body {
  margin: 0; /* menghapus margin default */
  font-family: 'Playfair Display', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Setting the viewport sudah dilakukan di <meta name="viewport" ...> di HTML */

.container {
  width: 92%;               /* Using percentages */
  max-width: 980px;         /* max-width */
  margin: 0 auto;
}

/* =========================
   1) Header + Nav (Flexbox)
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; /* Flexbox element */
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: inline-grid; /* Display: inline-block alternative */
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cta), var(--cta-dark));
  color: var(--text);
  font-weight: 800;
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
}

.nav-links a:hover {
  color: var(--text); /* Pseudo class */
  background: var(--accent);
}

/* =========================
   2) Hero
   ========================= */
.hero {
  padding: 44px 0 18px;
}

.hero-inner {
  display: flex;
  gap: 22px;
  align-items: center;
}

.hero-copy {
  flex: 1;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cta);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-media {
  flex: 1;
}

.hero h1 {
  line-height: 1.15;
  margin: 0 0 12px;
  font-size: clamp(28px, 3.2vw, 44px); /* Units - "vw" */
}

.lead {
  color: var(--muted);
  margin: 0 0 18px;
}

.hero-media img {
  width: 100%;
  max-width: 100%; /* max-width: 100% */
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover ;
  border-radius: 999px 999px 16px 16px; /* lengkung atas, lurus bawah */;
  border: 1px solid var(--border);
}
.hero-image-frame img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
/* =========================
   3) Buttons (display + hover)
   ========================= */
.btn {
  display: inline-block; /* Display: inline-block */
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cta), var(--cta-dark));
  color: var(--text);
  border-color: transparent;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
}

.hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.small-note {
  color:var(--text);
  font-size: 14px;
}

/* =========================
   4) Sections + Cards
   ========================= */
.section {
  padding: 34px 0;
}

.section-alt {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0 0 6px;
  font-size: 26px;
}

/* Pseudo element */
.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.section-subtitle {
  margin: 0 0 18px;
  color: var(--text);
}

.cards {
  display: flex; /* Flexbox layout */
  gap: 14px;
  flex-wrap: wrap;
}

.card {
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  flex: 1;
  min-width: 220px;
}

.card h3 {
  margin: 0 0 8px;
}

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.masalah-narasi {
  max-width: 680px;
  margin: 32px auto 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  padding: 20px 28px;
  background: var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
}

/* =========================
   5) Table
   ========================= */
.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.tabel-cara-kerja {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  background: var(--card);
}

.tabel-cara-kerja th,
.tabel-cara-kerja td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.tabel-cara-kerja th {
  color: var(--primary);          /* hijau teal */
  background: var(--surface);     /* hijau sangat muda */
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tabel-cara-kerja td {
  color: var(--text);
}

/* =========================
   6) Contoh Output
   ========================= */
.contoh-output {
  background: var(--surface);
  padding: 80px 0;
}

.tabel-output {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  background: var(--card);
}

.tabel-output th,
.tabel-output td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.tabel-output th {
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tabel-output tbody tr:hover {
  background: var(--faded);
}

.tabel-output tbody tr:last-child td {
  border-bottom: none;
}

.bahan-nama {
  font-weight: 600;
  color: var(--primary);
}

.bahan-harga {
  font-weight: 600;
  color: var(--cta);
  white-space: nowrap;
}

.output-note {
  font-size: 12px;
  color: var(--muted-2);
  font-style: italic;
  margin-top: 12px;
}

/* =========================
   7) Fitur
   ========================= */
.fitur {
  background: var(--bg);
  padding: 80px 0;
}

.fitur-list {
  list-style: none;    /* hapus bullet default */
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  }

.fitur-list li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.fitur-judul {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.fitur-desc {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* =========================
   8) Demo Form
   ========================= */
.demo {
  background: var(--surface);
  padding: 80px 0;
}

.demo-form {
  max-width: 720px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
}

.form-group input::placeholder {
  color: var(--muted-2);
}

.btn-submit {
  margin-top: 8px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--cta);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: var(--cta-dark);
}

.form-note {
  font-size: 12px;
  color: var(--muted-2);
  font-style: italic;
  margin-top: 12px;
}

#untuk-kader {
  padding: 5rem 0;
  background: var(--bg);
}

.kader-why {
  background: var(--primary);
  color: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.kader-why h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: white;
}

.kader-why p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.88);
}

.kader-fit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.kader-fit-card {
  background: var(--card);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
}

.kader-fit-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.kader-fit-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.kader-benefits {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
}

.kader-benefits h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.benefits-list li {
  padding-left: 1rem;
  border-left: 3px solid var(--primary);
}

.benefits-list strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.benefits-list p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  .kader-fit-grid {
    grid-template-columns: 1fr;
  }
}

#Tips-Gizi {
  padding: 5rem 0;
  background:var(--accent-light);
}

.accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accordion-item {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.accordion-trigger:hover {
  color: var(--primary);
}

.accordion-arrow {
  font-size: 1rem;
  color: var(--primary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.accordion-item.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-item.open .accordion-content {
  max-height: 600px;
}

.accordion-body {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-top: 1px solid var(--border);
}

.tips-group h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.35rem;
  padding-top: 1.25rem;
}

.tips-group p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* =========================
   8) Display: none vs visibility: hidden (demo section)
   ========================= */
/* Demo snippet:
.hidden-demo-1 { display: none; }
.hidden-demo-2 { visibility: hidden; }
*/

/* =========================
   9) Footer
   ========================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 36px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* =========================
   9) Media Query (Responsive)
   ========================= */
@media (max-width: 640px) {
  .hero-inner {
    flex-direction: column; /* Responsive: jadi 1 kolom */
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    gap: 10px;
    flex-wrap: wrap;
  }

  .nav-links a {
    padding: 8px 8px;
  }
}

/* State awal: elemen tersembunyi dan geser ke bawah */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* State akhir: elemen terlihat normal */
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

footer {
  background: var(--text);
  color: white;
  padding: 3rem 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-logo .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
}

.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.footer-credit {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.7;
}

.footer-nav h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* =========================
   DEMO — API Key Input
   ========================= */
.demo-apikey {
  max-width: 720px;
  margin-bottom: 16px;
}

.demo-apikey label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.apikey-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.apikey-row input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.apikey-row input:focus {
  border-color: var(--primary);
}

#btn-toggle-key {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

#btn-toggle-key:hover {
  background: var(--border);
}

.demo-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.demo-note a {
  color: var(--primary);
  text-decoration: none;
}

.demo-note a:hover {
  text-decoration: underline;
}

/* =========================
   DEMO — Loading Spinner
   ========================= */
.demo-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =========================
   DEMO — Area Hasil AI
   ========================= */
#demo-hasil {
  max-width: 720px;
  margin: 24px auto 0;
}

.demo-output {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.demo-output h3 {
  font-size: 16px;
  color: var(--primary);
  margin: 0 0 16px;
}

.demo-output table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

.demo-output th {
  background: var(--primary);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}

.demo-output td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.demo-output tr:last-child td {
  border-bottom: none;
}

.demo-output tr:nth-child(even) td {
  background: var(--surface);
}

.demo-error {
  background: #fff0f0;
  border: 1px solid #ffcccc;
  border-radius: 12px;
  padding: 20px 24px;
  color: #cc0000;
  font-size: 14px;
}