:root {
  --brand: #2f4a2a;
  --on-primary: #f4efe6;
  --bg: #fbf7ef;
  --surface: #ffffff;
  --muted: #5a6254;
  --border: #d5ccbc;
  --ink: #12180f;
  --ok-bg: #dce8d4;
  --warn-bg: #f0b4b4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(18, 24, 15, 0.08);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; min-height: 100vh; }
body.embedded { min-height: 0; background: transparent; overflow: auto; }
html.embedded .topbar,
body.embedded .topbar { display: none; }
body.embedded .wrap { padding-bottom: 1rem; }
.topbar {
  background: var(--bg); color: var(--ink);
  padding: 0.85rem 1rem 0.35rem; position: sticky; top: 0; z-index: 10;
}
.topbar-logo {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  text-decoration: none;
}
.topbar-logo img {
  display: block;
  height: 36px;
  width: auto;
  max-width: min(220px, 100%);
}
@media (min-width: 768px) {
  .topbar {
    padding: 1rem 1.2rem 0.5rem;
  }
  .topbar-logo img {
    height: 60px;
    max-width: min(280px, 100%);
  }
}
.wrap { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem; margin-bottom: 1rem;
}
.card h2 { margin: 0 0 0.5rem; font-family: Poppins, sans-serif; font-size: 1.2rem; color: var(--brand); }
.muted { color: var(--muted); font-size: 0.9rem; }
.err { background: #fde8e8; border: 1px solid #f0b4b4; color: #5a2020; padding: 0.75rem 1rem; border-radius: var(--radius); margin: 0.5rem 0; }
.ok { background: var(--ok-bg); color: var(--brand); padding: 0.75rem 1rem; border-radius: var(--radius); margin: 0.5rem 0; }
label { display: block; font-size: 0.82rem; color: var(--muted); margin: 0.65rem 0 0.25rem; }
input, select {
  width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1rem; background: #fff;
}
/* iOS Safari sizes a native date control from its min-content and ignores width until appearance is none. */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  line-height: 1.3;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value,
input[type="week"]::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
  margin: 0;
}
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="month"]::-webkit-datetime-edit,
input[type="week"]::-webkit-datetime-edit {
  display: inline-block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.row > * { flex: 1 1 140px; }
.btn {
  appearance: none; border: none; background: var(--brand); color: var(--on-primary);
  padding: 0.7rem 1.1rem; border-radius: 999px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  margin-top: 0.75rem;
}
.btn.secondary { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.light { background: #e8e0d2; color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.member {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem 0; border-bottom: 1px dashed var(--border);
}
.member:last-child { border-bottom: none; }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 0.28rem 0.55rem; border-radius: 999px; white-space: nowrap;
}
.badge.firmado { background: var(--ok-bg); color: var(--brand); }
.badge.por-firmar { background: var(--warn-bg); color: #5a2020; }
.badge.tipo { background: #e8e0d2; color: var(--ink); }
details.doc {
  border: 1px solid var(--border); border-radius: 10px; margin: 0.5rem 0;
  background: #fff; overflow: hidden;
}
details.doc summary {
  cursor: pointer; padding: 0.85rem 1rem; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  list-style: none;
}
details.doc summary::-webkit-details-marker { display: none; }
details.doc .body { padding: 0 1rem 1rem; font-size: 0.92rem; color: var(--muted); }
details.doc .body .notice {
  background: #f4efe6; padding: 0.75rem; border-radius: 8px; margin: 0.5rem 0; color: var(--ink);
}
.documento {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0.75rem 0 0.25rem;
}
.documento h1,
.documento h2,
.documento h3 { color: var(--brand); margin: 1rem 0 0.4rem; }
.documento ul,
.documento ol { padding-left: 1.25rem; }
.documento li { margin-bottom: 0.4rem; }
/* Document text grows the page (and the /waiver iframe). No nested scroll. */
details.doc[open] .body,
.leer-panel,
.review-docs {
  max-height: none;
  overflow: visible;
}
.documento .notice,
.documento .acceptance {
  background: #f4efe6;
  padding: 0.75rem;
  border-radius: 8px;
  margin: 0.65rem 0;
}
.documento .applies { margin: 0 0 0.6rem; }
.documento .version,
.documento .small { color: var(--muted); font-size: 0.82rem; }
.consent { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.65rem 0; font-size: 0.92rem; }
.consent input { width: auto; margin-top: 0.2rem; }
#sigPad {
  width: 100%; height: 180px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; touch-action: none; display: block;
}
.hidden { display: none !important; }
.preflight { font-size: 0.8rem; color: var(--muted); margin-top: 1rem; }

.docs-checklist {
  margin: 0.85rem 0 0.5rem;
  padding: 0.85rem 0.95rem;
  background: #f4efe6;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.docs-checklist-title,
.family-section-title {
  margin: 0 0 0.35rem;
  font-family: Poppins, Inter, sans-serif;
  font-size: 1rem;
  color: var(--brand);
}
.family-section-title { margin-top: 1rem; }
.docs-checklist-hint { margin: 0 0 0.55rem; font-size: 0.82rem; }
.docs-checklist details.doc {
  margin: 0.4rem 0 0;
  background: #fff;
}
.docs-checklist details.doc:first-of-type { margin-top: 0.15rem; }
.docs-checklist details.doc summary { padding: 0.65rem 0.85rem; font-size: 0.92rem; }
.docs-checklist details.doc .body { padding: 0 0.85rem 0.85rem; }
.client-id {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.client-id code {
  font-size: 0.9em;
  color: var(--ink);
  background: #efe8dc;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.doc-choice {
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
}
.doc-choice-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.doc-choice label.choice {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0;
  flex: 1 1 200px;
  color: var(--ink);
  font-size: 1rem;
}
.doc-choice label.choice input { width: auto; margin-top: 0.2rem; }
.linkish {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.95rem;
}
.leer-panel { margin: 0.35rem 0 0.25rem; }
.review-docs { margin: 0.35rem 0 0.75rem; padding-left: 1.2rem; }
.review-docs li { margin: 0.2rem 0; }
.person-row { padding: 0.75rem 0; border-bottom: 1px dashed var(--border); }
.legacy-person { padding: 0.85rem 0; border-bottom: 1px dashed var(--border); }
.legacy-person label.choice {
  display: flex; gap: 0.55rem; align-items: flex-start; margin: 0 0 0.35rem;
  color: var(--ink); font-size: 1rem;
}
.legacy-person label.choice input { width: auto; margin-top: 0.2rem; }
.todo-mark {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  color: #5a2020;
  background: var(--warn-bg);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
}
input[readonly] { background: #f4efe6; color: var(--ink); }
.aviso-privacidad { color: var(--muted); font-size: 0.9rem; margin: 0.85rem 0 0.35rem; }
.aviso-privacidad a {
  color: var(--brand);
  font-weight: 600;
  text-underline-offset: 0.15em;
}
