/* =====================================================================
   CEMEDES — estilos comunes (marca: monocromo cálido + rosa empolvado)
   ===================================================================== */
@font-face { font-family: "DM Serif Display"; src: url("../fonts/dmserif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../fonts/dmserif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --bg: #f4f3f1;
  --bg-2: #ecebe8;
  --surface: #ffffff;
  --ink: #202126;
  --ink-2: #3d3e44;
  --muted: #6c6e75;
  --logo: #808184;
  --line: #e2e1de;
  --accent: #b8877b;          /* rosa empolvado */
  --accent-ink: #8f6257;
  --accent-soft: #f5ece8;
  --ok: #2f7a4d;   --ok-bg: #e6f2ea;
  --warn: #9a6b00; --warn-bg: #fbf1d6;
  --err: #a83232;  --err-bg: #f8e3e1;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(32,33,38,.06), 0 10px 30px -12px rgba(32,33,38,.18);
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 20px; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 14px 22px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 700; font-size: 17px; text-decoration: none;
  cursor: pointer; transition: transform .12s ease, background .2s, opacity .2s; width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-soft { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-row { display: grid; gap: 12px; }
@media (min-width: 520px) { .btn-row.two { grid-template-columns: 1fr 1fr; } }
.btn svg { width: 20px; height: 20px; flex: none; }
.link-btn { background: none; border: 0; padding: 8px 4px; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 15px; }

/* --- Tarjetas --- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 22px; }
@media (min-width: 520px) { .card { padding: 36px 34px; } }

/* --- Formularios --- */
.field { display: block; }
.field + .field { margin-top: 18px; }
.label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.input {
  width: 100%; min-height: 54px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: #fff; font-size: 17px; transition: border-color .2s;
}
.input:focus { outline: none; border-color: var(--ink); }
.input.invalid { border-color: var(--err); background: #fffafa; }
.err-msg { color: var(--err); font-size: 14px; margin-top: 6px; font-weight: 600; }
.prefix { display: flex; align-items: stretch; }
.prefix span { display: flex; align-items: center; padding: 0 14px; border: 1.5px solid var(--line); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--bg); font-weight: 700; color: var(--muted); }
.prefix .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Chips (opciones tocables) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 10px 18px;
  border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: 15px;
  user-select: none; -webkit-tap-highlight-color: transparent; transition: all .15s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip.on, .chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Casillas */
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; line-height: 1.45; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--ink); }

/* Avisos */
.notice { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.err { background: var(--err-bg); color: var(--err); }
.notice.soft { background: var(--accent-soft); color: var(--accent-ink); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 14px; font-weight: 600;
  box-shadow: var(--shadow); transition: transform .3s ease; z-index: 1000; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Spinner */
.spin { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spin.dark { border-color: rgba(32,33,38,.15); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cabecera mínima */
.topbar { display: flex; align-items: center; justify-content: center; padding: 22px 0 8px; }
.topbar img { height: 64px; width: auto; }

.footer { padding: 40px 0 48px; text-align: center; font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
