/* =============================================================
   NueveLunas — styles.css
   1. Tokens  2. Reset  3. Utilities  4. Typography  5. Components
   6. Sections  7. Effects  8. Responsive  9. Reduced motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #fbf7f2;
  --bg-alt: #f3ece3;
  --card: #ffffff;
  --text: #2c2620;
  --text-soft: #6b6153;
  --accent: #c17a5a;
  --accent-strong: #a35f42;
  --accent-soft: #f1ddd0;
  --sage: #7c9473;
  --sage-soft: #e7ede3;
  --rose: #dd9f96;
  --powder: #93b7cf;
  --mustard: #d1a23f;
  --line: #e6ddd1;
  --error-bg: #fbe6e2;
  --error-text: #96351f;
  --focus: #a35f42;

  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 16px;
  --radius-sm: 10px;
  --gutter: 1.25rem;
  --container: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211d18;
    --bg-alt: #2a251e;
    --card: #2b261f;
    --text: #f3ece1;
    --text-soft: #c3b7a4;
    --accent: #e0a37e;
    --accent-strong: #eeb794;
    --accent-soft: #3a2f26;
    --sage: #a9c19c;
    --sage-soft: #2c332a;
    --rose: #e8b4ab;
    --powder: #add0e6;
    --mustard: #e3bb5f;
    --line: #443b30;
    --error-bg: #3a2620;
    --error-text: #f2a08e;
    --focus: #e0a37e;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  background-image: url("assets/img/estampado-nueve-lunas.svg");
  background-repeat: repeat;
  background-size: 360px 360px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
@media (min-width: 960px) {
  body { background-size: 450px 450px; }
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; font-family: var(--serif); font-weight: 600; }
ul, ol { padding-left: 1.2em; }
::selection { background: var(--accent-soft); color: var(--accent-strong); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--card); color: var(--text);
  z-index: 9999; border-radius: 8px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Typography
   ============================================================= */
.hero-title { font-size: clamp(1.9rem, 4.4vw, 2.9rem); max-width: 20ch; margin-inline: auto; }
.hero-subtitle { color: var(--text-soft); font-size: 1.05rem; max-width: 46ch; margin: .75rem auto 0; }
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .6rem; }
.lead { color: var(--text-soft); max-width: 62ch; }

/* =============================================================
   5. Components
   ============================================================= */

/* header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1rem; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--sage));
  display: inline-block;
}

/* tabs */
.tabs { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tab-btn {
  padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600; font-size: .95rem;
  color: var(--text-soft); transition: background .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.tab-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-btn:hover:not(.is-active) { border-color: var(--accent); color: var(--text); }

/* tool card + generic panel — the "paper" that sits over the pattern */
.tool-card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 12px 34px -18px rgba(60, 40, 20, .28);
}
.hero-panel { max-width: 640px; margin-inline: auto; }
.footer-panel { box-shadow: none; }
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field-hint { font-size: .85rem; color: var(--text-soft); }
input[type="date"], input[type="radio"] { font: inherit; }
input[type="date"] {
  padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 1rem; width: 100%;
}
.radio-row { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.radio-option { display: flex; align-items: center; gap: .45rem; font-size: .95rem; cursor: pointer; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1.02rem;
  padding: .85rem 1.5rem; border-radius: 999px; width: 100%;
  transition: background .2s var(--ease-out), transform .15s var(--ease-out);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: scale(.98); }

.result-box {
  margin-top: 1.5rem; padding: 1.25rem; border-radius: var(--radius-sm);
  background: var(--sage-soft); border: 1px solid var(--line);
}
.result-box[hidden] { display: none; }
.result-headline { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin-bottom: .4rem; }
.result-line { margin-top: .35rem; color: var(--text); }
.result-line.muted { color: var(--text-soft); font-size: .92rem; }

.progress {
  margin-top: 1rem; height: 10px; border-radius: 999px; background: var(--line);
  overflow: hidden;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--sage)); border-radius: 999px; transition: width .4s var(--ease-out); }

.error-box {
  margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--error-bg); color: var(--error-text); font-size: .95rem; font-weight: 600;
}
.error-box[hidden] { display: none; }

.privacy-badge {
  display: flex; align-items: flex-start; gap: .6rem; margin-top: 1.25rem;
  font-size: .88rem; color: var(--text-soft);
}
.privacy-badge svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--sage); }

/* ad slots */
.ad-slot {
  min-height: 90px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
  margin-block: 2rem;
}

/* faq */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); padding-block: .9rem; }
.faq-item summary {
  cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); flex: none; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: .6rem; color: var(--text-soft); }

/* how it works */
.steps { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-block: 1.5rem; }
.step { display: flex; gap: .9rem; align-items: flex-start; }
.step-num {
  flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-strong); font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* footer */
.site-footer {
  margin-top: 3rem; padding-block: 2rem;
  color: var(--text-soft); font-size: .88rem;
}
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: .75rem; }
.footer-links a:hover { color: var(--accent); }

/* =============================================================
   6. Sections
   ============================================================= */
.hero { text-align: center; padding-block: 2.5rem 1.5rem; }
.tool-section { padding-block: 1rem 1.5rem; }
.content-section { padding-block: 1.25rem; }

/* =============================================================
   7. Effects
   ============================================================= */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .tool-card, .panel { padding: 2rem; }
}

/* =============================================================
   9. Reduced motion — only the intrusive stuff
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-fill { transition: none; }
}
