/* base.css · identidad visual y componentes compartidos (marca: Mamá Control) */
:root {
  --bg: #fff8f5;
  --bg2: #fdeee9;
  --surface: #ffffff;
  --ink: #2b2430;
  --ink2: #5d5266;
  --ink3: #7d7287;
  --line: #ecdcdd;
  --accent: #a63d6f;
  --accent-h: #8f3260;
  --on-accent: #ffffff;
  --accent-soft: #f8e4ed;
  --ok: #2b744f;
  --ok-soft: #e1f2e9;
  --warn: #a4372d;
  --warn-soft: #fdebe8;
  --amber: #7a4f00;
  --amber-soft: #fff1d6;
  --shadow: 0 8px 28px rgba(120, 40, 80, .10);
  --shadow-btn: 0 8px 20px rgba(166, 61, 111, .28);
  --r: 20px;
  --r-sm: 14px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191420;
    --bg2: #221a2a;
    --surface: #2a2132;
    --ink: #f6edf1;
    --ink2: #d3c6d8;
    --ink3: #a99cb2;
    --line: #43364d;
    --accent: #e384ae;
    --accent-h: #ee9dc0;
    --on-accent: #2a0f1c;
    --accent-soft: #3c2331;
    --ok: #7fd1a3;
    --ok-soft: #1f3a2d;
    --warn: #ff9b8f;
    --warn-soft: #43211f;
    --amber: #f0c36a;
    --amber-soft: #3b2e12;
    --shadow: 0 8px 28px rgba(0, 0, 0, .35);
    --shadow-btn: 0 8px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(28px, 7.6vw, 36px); }
h2 { font-size: 23px; }
h3 { font-size: 18px; }
p, ul, ol, dl { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink2); }
.lead { color: var(--ink2); font-size: 18px; line-height: 1.5; }
.big-emo { font-size: 56px; line-height: 1; }
.pad { padding: 24px; }
.small { font-size: 14px; line-height: 1.45; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 54px; padding: 0 24px; border-radius: var(--r-sm); border: 2px solid transparent;
  font-weight: 700; font-size: 17px; cursor: pointer; text-decoration: none; text-align: center;
  background: transparent; transition: transform .08s ease, background .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: var(--warn); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-danger { color: #2b0d0a; } }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.link-btn { background: none; border: 0; padding: 10px 4px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; }
p .link-btn { display: inline; padding: 0; font: inherit; font-weight: 700; line-height: inherit; text-align: inherit; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--accent-soft); }

/* tarjetas y etiquetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); background: var(--amber-soft); color: var(--ink); border: 1px solid var(--line); }
.banner-warn { background: var(--warn-soft); }
.banner-ok { background: var(--ok-soft); }
.banner .emo { font-size: 22px; line-height: 1.2; }

/* formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 700; font-size: 15px; }
.help { color: var(--ink2); font-size: 14px; }
.input, .textarea, .select {
  width: 100%; min-height: 54px; padding: 12px 16px; border-radius: var(--r-sm);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--warn); }
.err { color: var(--warn); font-weight: 600; font-size: 15px; min-height: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--accent); }

/* avisos efímeros */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg);
  font-weight: 600; font-size: 15px; box-shadow: var(--shadow); z-index: 50; text-align: center;
}
.toast-err { background: var(--warn); color: #fff; }
@media (prefers-color-scheme: dark) { .toast-err { color: #2b0d0a; } }

/* carga */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; gap: 12px; min-height: 40vh; color: var(--ink2); }

/* marca */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 19px; }
.logo { width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.logo svg { width: 18px; height: 18px; fill: var(--on-accent); }

/* pie legal */
.legal { color: var(--ink3); font-size: 13px; line-height: 1.5; text-align: center; padding: 8px 0 4px; }
.legal a { color: inherit; }

/* barra de consentimiento de medición */
.consent {
  position: fixed; inset: auto 0 0 0; z-index: 40; padding: 12px max(16px, env(safe-area-inset-left, 0px)) calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 28px rgba(0, 0, 0, .12);
}
.consent .in { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.45; }
.consent .btns { display: flex; gap: 10px; }
.consent .btns .btn { flex: 1; min-height: 46px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
