:root {
  --ink: #16281f;
  --muted: #5c6b62;
  --accent: #0f6b42;
  --accent-dark: #0a4c2f;
  --gold: #c9a227;
  --gold-dark: #a4841e;
  --gold-tint: #faf3de;
  --bg: #f6f8f5;
  --card: #ffffff;
  --border: #dde5dd;
  --error: #c0392b;
  --success: #0f6b42;
  --font-heading: "Orbitron", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Smooch Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  background: var(--bg);
  color: var(--ink);
}

h1,
h2,
h3,
h4,
.logo {
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 20px;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  border-bottom: 2px solid var(--gold);
  display: inline-block;
  padding-bottom: 4px;
  margin-bottom: 32px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 12px;
  padding: 32px;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 8px;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 0.95rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 18px 0 6px;
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.plan-options {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.plan-option {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
}

.plan-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--gold-tint);
}

.plan-option-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plan-title {
  font-weight: 600;
  color: var(--ink);
}

.plan-sub {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

.plan-option input {
  width: auto;
  margin-top: 3px;
}

button {
  width: 100%;
  margin-top: 26px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

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

.message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.message.error {
  display: block;
  background: #fdecea;
  color: var(--error);
}

.message.success {
  display: block;
  background: #eaf7ee;
  color: var(--success);
}

.confirmation {
  text-align: center;
}

.confirmation .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

[hidden] {
  display: none !important;
}

/* ── Legal / e-sign pages (firma.html) ─────────────────────────── */

.wrap-wide {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 20px 96px;
}

.hero {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 1.6rem;
  margin: 0 0 6px;
}

.hero p {
  color: var(--muted);
  margin: 0;
}

.intro-note {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.signer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.signer-fields > div label {
  margin-top: 0;
}

@media (max-width: 560px) {
  .signer-fields {
    grid-template-columns: 1fr;
  }
}

.doc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 22px;
  margin-bottom: 20px;
  line-height: 1.65;
  font-size: 0.92rem;
}

.doc h2 {
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.doc h3 {
  font-size: 1rem;
  margin: 22px 0 8px;
}

.doc > p:first-of-type {
  color: var(--muted);
  margin-top: 0;
}

.doc dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 16px 0;
  font-size: 0.88rem;
}

.doc dt {
  color: var(--muted);
  font-weight: 600;
}

.doc dd {
  margin: 0;
}

.pendiente {
  color: #a15c00;
  background: #fff4e0;
  padding: 0 4px;
  border-radius: 4px;
}

.callout {
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 0.88rem;
  background: var(--gold-tint);
  border: 1px solid var(--gold);
}

.callout--warning {
  background: #fff4e0;
  border-color: #ffdfa3;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 12px 0;
}

.doc th,
.doc td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.accept {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  cursor: pointer;
}

.accept input {
  width: auto;
  margin-top: 3px;
}

.signed-note {
  display: block;
  color: var(--success);
  font-size: 0.82rem;
  margin-top: 4px;
}

.submit-wrap {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  padding: 20px 0 8px;
}

/* ── Questionnaire wizard (cuestionario.html) ──────────────────── */

.family-group {
  margin-bottom: 20px;
}

.family-group h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 8px;
}

.vertical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.vertical-card {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  margin: 0;
}

.vertical-card:hover {
  border-color: var(--accent);
}

.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
}

.section-card h2 {
  font-size: 1.05rem;
  margin: 0 0 18px;
}

.field-row {
  margin-bottom: 18px;
}

.field-row label {
  margin: 0 0 6px;
}

.field-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  min-height: 70px;
  resize: vertical;
}

.field-row.boolean {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-row.boolean label {
  margin: 0;
  font-weight: 500;
}

.field-row.boolean input {
  width: auto;
}

.field-save-state {
  font-size: 0.76rem;
  color: var(--success);
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.field-save-state.visible {
  opacity: 1;
}

.vertical-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.vertical-current button {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 0.82rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.vertical-current button:hover {
  background: var(--gold-tint);
}

.branches-intro {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.branch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.branch-row label {
  margin: 0;
  min-width: 70px;
  font-weight: 500;
  font-size: 0.88rem;
}

.branch-row input {
  width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.branch-row .field-save-state {
  margin-left: 0;
}

button.secondary {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  margin-top: 0.75rem;
}

button.secondary:hover:not(:disabled) {
  background: rgba(127, 127, 127, 0.12);
}

/* ── Checkout pages (pago.html, gracias.html): logo + larger type ── */

.brand-logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 8px;
}

body.checkout {
  font-size: 1.75rem;
  line-height: 1.35;
}

body.checkout .wrap {
  max-width: 640px;
}

body.checkout h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

body.checkout .subtitle {
  font-size: 1.6rem;
}

body.checkout label {
  font-size: 1.45rem;
}

body.checkout input,
body.checkout select {
  font-size: 1.6rem;
  padding: 10px 14px;
}

body.checkout button {
  font-family: inherit;
  font-size: 1.7rem;
  padding: 12px 18px;
}

body.checkout .plan-sub {
  font-size: 1.2rem;
}

body.checkout .plan-option input {
  width: auto;
  margin-top: 6px;
}

body.checkout .message {
  font-size: 1.45rem;
}

body.checkout .confirmation .subtitle {
  margin-bottom: 4px;
}

/* ── firma.html + cuestionario.html: header centred in its band, Smooch Sans
   at checkout size (the .wrap-wide pages) ── */

/* The band above the content used to be 48px above the logo and 28px below
   the client line; the same 76px is now split evenly around logo + name. */
body.wide-checkout .wrap-wide {
  padding-top: 0;
}

body.wide-checkout .page-header {
  padding: 38px 0;
}

body.wide-checkout .page-header .hero {
  margin-bottom: 0;
}

body.wide-checkout {
  font-size: 1.75rem;
  line-height: 1.35;
}

body.wide-checkout .hero p,
body.wide-checkout .intro-note,
body.wide-checkout .doc,
body.wide-checkout .confirmation .subtitle {
  font-size: 1.6rem;
}

body.wide-checkout .confirmation h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

body.wide-checkout .doc dl,
body.wide-checkout .callout,
body.wide-checkout .doc table,
body.wide-checkout .accept,
body.wide-checkout .branches-intro,
body.wide-checkout .branch-row label,
body.wide-checkout .vertical-current {
  font-size: 1.5rem;
}

body.wide-checkout .signed-note,
body.wide-checkout .family-group h3 {
  font-size: 1.4rem;
}

body.wide-checkout .field-save-state {
  font-size: 1.3rem;
}

body.wide-checkout label {
  font-size: 1.45rem;
}

body.wide-checkout input,
body.wide-checkout select,
body.wide-checkout textarea {
  font-size: 1.6rem;
}

body.wide-checkout button,
body.wide-checkout .btn {
  font-family: inherit;
  font-size: 1.7rem;
}

/* Declared after the button rule above so these smaller buttons win. */
body.wide-checkout .vertical-card {
  font-size: 1.5rem;
}

body.wide-checkout .vertical-current button {
  font-size: 1.4rem;
}

body.wide-checkout .message {
  font-size: 1.45rem;
}

body.wide-checkout .family-group {
  margin-bottom: 28px;
}

body.wide-checkout .family-group h3 {
  margin-bottom: 12px;
}

/* Picker cards: green fill + white text on hover, same font and size. */
.vertical-card:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Questionnaire: mandatory marker, help icon, locked answers, plan panel ── */

.req {
  color: var(--error);
  font-weight: 700;
}

.required-legend {
  color: var(--muted);
  margin: 0 0 16px;
}

.field-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-head label {
  margin-bottom: 6px;
}

.field-head .field-save-state {
  margin-left: 0;
}

.help {
  position: relative;
  display: inline-flex;
  flex: none;
}

.help-btn,
.help-btn-inline {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
}

body.wide-checkout .help-btn {
  width: 1.5em;
  margin: 0;
  padding: 0;
  font-size: 1.1rem;
  cursor: help;
  background: transparent;
  color: var(--accent);
}

body.wide-checkout .help-btn:hover:not(:disabled),
body.wide-checkout .help-btn:focus-visible {
  background: var(--accent);
  color: #fff;
}

.help-tip {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: -8px;
  width: max-content;
  max-width: min(340px, calc(100vw - 72px));
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.3;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.help:hover .help-tip,
.help:focus-within .help-tip {
  display: block;
}

.field-row.boolean {
  flex-wrap: wrap;
}

.field-note {
  flex-basis: 100%;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.3rem;
}

.field-row.locked label {
  color: var(--muted);
}

.field-row.missing {
  border-left: 3px solid var(--error);
  padding-left: 12px;
  margin-left: -15px;
}

.field-row.missing label {
  color: var(--error);
}

.plan-panel {
  background: var(--gold-tint);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.plan-panel p {
  margin: 0 0 6px;
}

.plan-panel-title {
  font-weight: 600;
}

.plan-panel-price {
  margin-top: 8px;
  font-weight: 600;
}

.plan-conditions {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.plan-conditions li.done {
  color: var(--success);
}

/* ── pago.html: logo centred in its band (equal space above and below) ── */

body.pago .wrap {
  padding-top: 0;
}

body.pago .page-header {
  padding: 28px 0;
}

body.pago .page-header .brand-logo {
  margin: 0 auto;
}

/* ── Final page of firma / cuestionario: laid out like verificar / gracias ── */

body.is-done .page-header .hero {
  display: none;
}

body.is-done .card.confirmation {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
