:root {
  --bg: #eef5fb;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #667385;
  --primary: #1368aa;
  --primary-dark: #0d4c7c;
  --border: #d9e3ec;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --success: #067647;
  --success-bg: #edfcf2;
  --warning: #b54708;
  --shadow: 0 18px 45px rgba(21, 40, 64, .11);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); }
body { margin: 0; min-height: 100vh; }
.page-bg { background: radial-gradient(circle at top left, #d8ebfb, transparent 38%), var(--bg); }
.topbar { max-width: 1180px; margin: 0 auto; padding: 28px 20px 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.05; margin-bottom: 0; }
h2 { font-size: 1.45rem; margin-bottom: 12px; }
h3 { font-size: 1.05rem; margin: 22px 0 12px; }
p { color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--primary-dark); font-weight: 800; }
.small-link { color: var(--primary-dark); font-weight: 800; text-decoration: none; padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1px solid var(--border); }
.container { width: 100%; margin: 0 auto 48px; padding: 0 20px; }
.container.narrow { max-width: 920px; }
.container.wide { max-width: 1240px; }
.card { background: rgba(255,255,255,.94); border: 1px solid rgba(217, 227, 236, .95); box-shadow: var(--shadow); border-radius: var(--radius); padding: clamp(18px, 3vw, 30px); margin: 16px 0; }
.intro-card { padding-bottom: 22px; }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.progress-step { padding: 10px 12px; border-radius: 12px; background: #f4f8fb; color: var(--muted); font-weight: 800; font-size: .88rem; text-align: center; border: 1px solid var(--border); }
.progress-step.active, .progress-step.done { background: var(--primary); color: #fff; border-color: var(--primary); }
.form-step { display: none; }
.form-step.active { display: block; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: block; font-weight: 800; color: #253243; }
input, textarea, select { width: 100%; margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; font: inherit; background: #fff; color: var(--text); }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(19,104,170,.18); border-color: var(--primary); }
input.invalid, textarea.invalid, select.invalid { border-color: var(--danger); background: #fffafa; }
fieldset { border: 0; padding: 0; margin: 0; }
.radio-card { margin: 16px 0; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: #f9fbfd; }
.radio-card legend { font-weight: 900; margin-bottom: 12px; }
.radio-card label { display: inline-flex; align-items: center; gap: 8px; margin-right: 18px; font-weight: 700; }
.radio-card input, .check-line input { width: auto; margin: 0; }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; line-height: 1.45; }
.check-line.strong { padding: 14px; border-radius: 14px; background: #f6fbff; border: 1px solid #d7ecff; }
.hidden { display: none !important; }
.legal-box { max-height: 285px; overflow: auto; padding: 18px; background: #fbfdff; border: 1px solid var(--border); border-radius: 16px; margin: 16px 0; }
.legal-box li { margin: 0 0 10px; line-height: 1.5; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); margin-top: 26px; padding-top: 20px; }
.btn { appearance: none; border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 900; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s ease, opacity .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.btn.primary { color: #fff; background: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { color: var(--primary-dark); background: #eef6fd; border: 1px solid #cce3f6; }
.btn.danger { color: #fff; background: var(--danger); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid #ffccc7; padding: 14px; border-radius: 14px; margin-top: 18px; }
.alert ul { margin: 8px 0 0 18px; }
.success { background: var(--success-bg); border: 1px solid #abefc6; color: var(--success); padding: 18px; border-radius: 16px; margin-top: 18px; }
.signature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.signature-card { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: #fbfdff; }
.signature-pad { width: 100%; height: 190px; background: #fff; border: 2px dashed #b8c8d6; border-radius: 14px; touch-action: none; display: block; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: .92rem; }
code { background: #eef3f7; padding: 2px 6px; border-radius: 6px; }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-form label { min-width: 260px; flex: 1; }
.split-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.qr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 22px; align-items: center; }
.qr-box { min-height: 220px; display: flex; justify-content: center; align-items: center; border: 1px dashed var(--border); border-radius: 18px; background: #fbfdff; }
.qr-box img { width: 210px; height: 210px; image-rendering: pixelated; }
.filters-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; margin: 22px 0; }
.filter-actions { display: flex; gap: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; }
.records-table { width: 100%; border-collapse: collapse; background: #fff; min-width: 980px; }
.records-table th, .records-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.records-table th { background: #f4f8fb; font-size: .86rem; text-transform: uppercase; letter-spacing: .04em; color: #526172; }
.records-table td { font-size: .93rem; }
.records-table tr:last-child td { border-bottom: 0; }
.empty { text-align: center !important; color: var(--muted); padding: 28px !important; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: .78rem; font-weight: 900; margin: 2px 3px 2px 0; }
.badge.ok { background: #eefdf5; color: var(--success); }
.badge.warn { background: #fff7ed; color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.detail-dialog { width: min(920px, calc(100vw - 24px)); border: 0; border-radius: 20px; box-shadow: var(--shadow); padding: 0; }
.detail-dialog::backdrop { background: rgba(16, 24, 40, .55); }
.dialog-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; }
.icon-btn { width: 42px; height: 42px; border: 0; border-radius: 999px; background: #eef3f7; font-size: 28px; cursor: pointer; }
#detailContent { padding: 22px 24px; max-height: 70vh; overflow: auto; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.detail-item { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: #fbfdff; }
.detail-item span { display: block; color: var(--muted); font-size: .8rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.detail-wide { grid-column: 1 / -1; }
.signature-img { max-width: 100%; border: 1px dashed var(--border); border-radius: 14px; background: #fff; }
.dialog-actions { padding: 18px 24px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 800px) {
  .topbar, .split-heading { flex-direction: column; }
  .grid.two, .signature-grid, .qr-layout, .detail-grid { grid-template-columns: 1fr; }
  .progress { grid-template-columns: 1fr 1fr; }
  .filters-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .btn { width: 100%; }
  .small-link { align-self: flex-start; }
}

@media print {
  body { background: #fff; }
  .topbar, .card:not(#recordsPanel), .dialog-actions, .icon-btn, .filters-grid, .table-wrap, #recordsPanel > .split-heading { display: none !important; }
  dialog { display: block; position: static; width: 100%; box-shadow: none; border-radius: 0; }
  #detailContent { max-height: none; overflow: visible; }
}
.signature-pad { cursor: crosshair; user-select: none; -webkit-user-select: none; }

/* ---- Añadidos v2: multi-hotel, idiomas, FAQ ---- */
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hotel-name { margin: 4px 0 0; font-weight: 600; opacity: .85; }
.lang-switcher { display: inline-flex; gap: 4px; }
.lang-btn { border: 1px solid rgba(0,0,0,.15); background: #fff; border-radius: 8px; padding: 4px 8px; font-size: .8rem; cursor: pointer; line-height: 1; }
.lang-btn.active { background: #101828; color: #fff; border-color: #101828; }
.hotel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.hotel-pick { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid rgba(0,0,0,.12); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .15s, transform .05s; }
.hotel-pick:hover { border-color: #101828; transform: translateY(-1px); }
.hotel-pick span { font-size: .85rem; opacity: .7; }
.legal-note { font-style: italic; opacity: .7; font-size: .85rem; }
.faq-item { padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.faq-item summary { font-weight: 600; cursor: pointer; }
.faq-item p { margin: 8px 0 0; opacity: .85; }

/* ---- Página de bienvenida (Fase 3, marca Playa Hoteles) ---- */
.welcome-topbar { align-items: center; max-width: 1180px; }
.brand-logo { height: 46px; width: auto; display: block; }
.welcome-hero { text-align: center; padding: clamp(28px, 5vw, 52px) clamp(20px, 4vw, 44px); background: linear-gradient(165deg, #ffffff 0%, #e9f4f8 100%); }
.welcome-hero .eyebrow { color: #1a8bac; }
.welcome-hero h1 { margin: 8px 0 0; }
.welcome-hero .hotel-name { margin: 14px 0 0; font-weight: 700; color: #1a8bac; }
.welcome-lead { font-size: 1.12rem; max-width: 620px; margin: 16px auto 28px; color: var(--text); }
.welcome-cta { display: inline-block; background: #1a8bac; color: #fff; text-decoration: none; padding: 16px 34px; border-radius: 999px; font-weight: 800; font-size: 1.06rem; box-shadow: 0 14px 30px rgba(26,139,172,.32); transition: transform .05s, background .15s; cursor: pointer; }
.welcome-cta:hover { background: #15768f; }
.welcome-cta:active { transform: translateY(1px); }
.welcome-note { margin-top: 14px; font-size: .92rem; color: var(--muted); }
.welcome-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 6px; margin-bottom: 50px; }
.welcome-feature { margin: 0; text-align: left; }
.welcome-feature h3 { margin: 14px 0 8px; }
.welcome-feature p { margin: 0; font-size: .98rem; }
.wf-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: #e6f3f7; color: #1a8bac; }
.wf-ico svg { width: 26px; height: 26px; }
@media (max-width: 640px) { .welcome-grid { grid-template-columns: 1fr; } .brand-logo { height: 38px; } }

/* selector de país al inicio del registro */
.country-field { display: block; margin-bottom: 18px; }
.country-field select { width: 100%; padding: 12px 14px; font-size: 1rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-top: 6px; }
.country-field select:focus { outline: none; border-color: var(--primary); }

/* ---- Casillas de alérgenos / condiciones (formulario) ---- */
.health-pick { margin: 10px 0 6px; }
.health-pick-title { font-weight: 700; font-size: .95rem; margin: 0 0 8px; color: var(--text); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.health-opt { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer; background: #fff; transition: border-color .14s, background .14s; }
.health-opt:hover { border-color: var(--primary); }
.health-opt input { margin: 0; }
.health-opt input:checked ~ .health-lbl { font-weight: 700; }
.health-opt:has(input:checked) { border-color: var(--primary); background: #eef6fb; }
.health-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: currentColor; flex: none; }
.health-ico svg { width: 17px; height: 17px; stroke: #fff; }
.health-lbl { font-size: .9rem; }

/* aviso de datos heredados del hermano */
.sibling-note { background: #eef7fb; border: 1.5px solid #bfe2ee; color: #0f6b86; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
#successBox #anotherBtn { margin-top: 16px; }

/* Campo de fecha con escritura manual + botón calendario */
.date-combo { position: relative; display: flex; align-items: stretch; }
.date-combo input[type="text"] { flex: 1; width: 100%; padding-right: 44px; }
.date-cal-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: none; background: transparent; color: var(--primary, #1a8bac); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.date-cal-btn:hover { background: rgba(26,139,172,.08); }
.date-cal-btn svg { width: 22px; height: 22px; }
.date-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; right: 8px; bottom: 0; }

/* Texto del formulario en MAYÚSCULAS (coherencia de nombres) */
#registroForm input[type="text"],
#registroForm input:not([type]),
#registroForm textarea {
  text-transform: uppercase;
}
#registroForm #childBirthdate { text-transform: none; }
/* La fecha de firma queda fijada a hoy (solo lectura) */
#registroForm input[name="signatureDate"][readonly] {
  background: #f1f3f5;
  color: #6b7280;
  cursor: not-allowed;
}

/* Nombre del tutor encima de su cuadro de firma */
.sig-name {
  font-weight: 700;
  font-size: 14px;
  color: #0B6F8E;
  margin: 2px 0 6px;
  min-height: 18px;
  text-transform: uppercase;
}
