:root {
  --orange: #FF6F00;
  --orange-dark: #C23B01;
  --navy: #002233;
  --heading: #2B2B2B;
  --border: #69727D;
  --muted: #5B6B75;
  --bg-soft: #FFF6EE;
  --bg-grey: #F5F7F8;
  --line: #E4E7EA;
  --error: #C62828;
  --ok: #2CA53E;
  --radius-field: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--navy);
  font-family: "Open Sans", "Noto Sans", "PingFang SC", "Microsoft YaHei", "Segoe UI", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Open Sans", sans-serif; }
.i18n-loading main { visibility: hidden; }

a { color: var(--orange); }
a:hover { color: var(--orange-dark); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap { max-width: 1100px; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
}
.logo img { display: block; height: 60px; width: auto; }
.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-select {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lang-icon {
  position: absolute;
  inset-inline-start: 12px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--navy);
  stroke-width: 1.8;
  pointer-events: none;
}
.lang-select select {
  appearance: none;
  -webkit-appearance: none;
  font: 500 15px "Open Sans", sans-serif;
  color: var(--navy);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23002233' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat;
  background-size: 16px;
  background-position: right 10px center;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 9px 34px 9px 38px;
  cursor: pointer;
}
html[dir="rtl"] .lang-select select { background-position: left 10px center; padding: 9px 38px 9px 34px; }
.lang-select select:hover { border-color: var(--border); }
.lang-select select:focus-visible { outline: 3px solid rgba(255, 111, 0, .35); outline-offset: 1px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--orange);
  color: #fff;
  border: 0;
  border-radius: 28px;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, transform .1s;
}
.btn:hover { background: var(--orange-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(255, 111, 0, .4); outline-offset: 2px; }
.btn-header {
  border-radius: 14px;
  box-shadow: 0 0 10px rgba(0, 0, 0, .3);
  padding: 11px 18px;
  font-size: 16px;
}
.btn-outline {
  background: #fff;
  color: var(--orange);
  box-shadow: inset 0 0 0 2px var(--orange);
}
.btn-outline:hover { background: var(--bg-soft); color: var(--orange-dark); }
.btn-link {
  background: none;
  border: 0;
  padding: 6px 0;
  font: 600 15px "Open Sans", sans-serif;
  color: var(--orange);
  cursor: pointer;
  white-space: nowrap;
}
.btn-link:hover { color: var(--orange-dark); text-decoration: underline; }

/* Typography */
h1, h2, h3, h4 { font-family: "Montserrat", "Noto Sans", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
html[lang="ar"] :is(h1, h2, h3, h4) { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif; }
p { margin: 0 0 12px; }

.hero { text-align: center; padding: 40px 0 8px; }
h1 {
  color: var(--heading);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 14px;
}
.hero-sub { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 18px; }

.block { margin: 36px 0; }
.step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 18px;
}
.step-num {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 18px;
}

/* Essentials */
.essentials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.ess-card {
  display: flex;
  gap: 14px;
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 16px 18px;
}
.ess-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-top: 2px;
}
.ess-card h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.ess-card p { font-size: 15px; line-height: 1.5; margin: 0; }

/* Documento completo (acordeón) */
.doc {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-grey);
}
.doc-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.doc-hint { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.translation-note {
  margin: 0;
  padding: 10px 20px;
  font-size: 14px;
  background: #FFF9E6;
  border-bottom: 1px solid var(--line);
}
.doc-item { border-top: 1px solid var(--line); }
.doc-item summary {
  list-style: none;
  position: relative;
  cursor: pointer;
  padding: 14px 52px 14px 20px;
  font-family: "Montserrat", "Noto Sans", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 16px;
}
html[dir="rtl"] .doc-item summary { padding: 14px 20px 14px 52px; }
.doc-item summary::-webkit-details-marker { display: none; }
.doc-item summary::after {
  content: "+";
  position: absolute;
  inset-inline-end: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 18px/1 "Open Sans", sans-serif;
  color: var(--orange);
  background: var(--bg-soft);
}
.doc-item[open] summary::after { content: "−"; }
.doc-item summary:hover { background: #FAFBFC; }
.doc-item summary:focus-visible { outline: 3px solid rgba(255, 111, 0, .35); outline-offset: -3px; }
.doc-intro summary { color: var(--muted); font-weight: 500; }
.doc-body { padding: 0 20px 16px; font-size: 16px; }
.doc-body h4 { font-size: 16px; font-weight: 600; margin: 14px 0 4px; }
.doc-body ul { margin: 0 0 12px; padding-inline-start: 22px; }
.doc-body li { margin-bottom: 5px; }
.doc-body li::marker { color: var(--orange); }

/* Form section */
.form-section {
  padding: 32px 36px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 30px rgba(0, 34, 51, .07);
  scroll-margin-top: 90px;
}
#documento { scroll-margin-top: 90px; }
.form-intro { color: var(--navy); }
.form-intro p { font-size: 16px; }

form { margin-top: 22px; }

.field { margin-bottom: 18px; min-width: 0; }
.field label, .menores legend {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  padding-bottom: 7px;
}
.req { color: var(--orange); }
.opt { color: var(--muted); font-size: 14px; }

input[type="text"], input[type="tel"] {
  width: 100%;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  padding: 11px 14px;
  transition: border-color .15s, box-shadow .15s;
}
html[dir="rtl"] input[type="tel"] { text-align: right; }
input[type="text"]:focus, input[type="tel"]:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 111, 0, .18);
}

.hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.error-msg { display: none; font-size: 14px; color: var(--error); margin: 6px 0 0; }
.field.invalid input { border-color: var(--error); }
.field.invalid .error-msg { display: block; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  align-items: end;
}
.grid-2 .field { align-self: start; }

/* Teléfono con prefijo (intl-tel-input) */
.iti { display: block; width: 100%; }
.iti__country-container { font-family: "Roboto", sans-serif; }
.iti__selected-dial-code { color: var(--navy); font-size: 16px; }
.iti__search-input { font-size: 16px; }
.field.invalid .iti input { border-color: var(--error); }
.iti--inline-dropdown .iti__dropdown-content { z-index: 20; }

/* Fecha de la actividad */
.field-label { display: block; font-size: 16px; line-height: 1.3; padding-bottom: 8px; }
.date-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-block;
  padding: 9px 18px;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  background: #fff;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover span { border-color: var(--orange); }
.chip input:checked + span { background: var(--orange); border-color: var(--orange); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid rgba(255, 111, 0, .35); outline-offset: 2px; }
.date-input {
  display: block;
  margin-top: 10px;
  font: 16px "Roboto", sans-serif;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  padding: 10px 12px;
  min-width: 200px;
}
.date-input[hidden] { display: none; }
.date-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 111, 0, .18); }
.fecha-preview { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--orange-dark); }
.fecha-preview::first-letter { text-transform: uppercase; }
.fecha-preview:empty { display: none; }
.field-fecha.invalid .date-input { border-color: var(--error); }
.field-fecha.invalid .chip input:not(:checked) + span { border-color: var(--error); }

/* Menores */
.menores {
  border: 1px dashed #C9CED3;
  border-radius: 8px;
  padding: 16px 18px 16px;
  margin: 6px 0 22px;
  min-width: 0;
}
.menores legend { padding: 0 6px; margin-inline-start: -6px; }
.menores > .hint { margin: 0 0 12px; }
.menor-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 0 14px;
  align-items: start;
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.menor-row .field { margin-bottom: 8px; }
.menor-row .field label { font-size: 15px; }
.btn-remove {
  margin-top: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.btn-remove:hover { color: var(--error); border-color: var(--error); }
.btn-add {
  background: none;
  border: 0;
  padding: 6px 0;
  font: 600 16px "Open Sans", sans-serif;
  color: var(--orange);
  cursor: pointer;
}
.btn-add:hover { color: var(--orange-dark); text-decoration: underline; }

/* Checkbox */
.check {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.check input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--orange);
  cursor: pointer;
}
.field-check { background: var(--bg-soft); border-radius: 8px; padding: 16px 18px; }
.field-check.invalid { box-shadow: inset 0 0 0 1px var(--error); }

.rgpd { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 14px 0 22px; }
.rgpd summary { cursor: pointer; font-weight: 600; }
.rgpd p { margin: 8px 0 0; }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Submit */
.btn-submit {
  width: 100%;
  max-width: 320px;
  font-size: 21px;
  padding: 16px 28px;
}
.btn-submit[disabled] { opacity: .75; cursor: wait; }
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn-submit.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status {
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 16px;
  background: #FDECEA;
  color: var(--error);
}

/* Success */
.success { text-align: center; padding: 12px 0; outline: none; }
.success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 40px;
  line-height: 72px;
}
.success h2 { margin-top: 8px; }
.success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  padding: 26px 0;
  margin-top: 48px;
}
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: #fff; }
.footer-inner { text-align: center; }

/* Responsive */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .header-inner { min-height: 64px; }
  .logo img { height: 48px; }
  .btn-header { padding: 8px 12px; font-size: 14px; border-radius: 10px; box-shadow: none; }
  .header-actions { gap: 8px; }
  .lang-select select { font-size: 14px; padding-block: 8px; max-width: 132px; }
  .hero { padding-top: 26px; }
  h1 { font-size: 27px; }
  .hero-sub { font-size: 16px; }
  .step-title { font-size: 21px; }
  .essentials { grid-template-columns: 1fr; gap: 10px; }
  .ess-card { padding: 14px 16px; }
  .doc-head { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .doc-item summary { padding-inline-start: 16px; }
  .doc-body { padding: 0 16px 14px; }
  .form-section { padding: 22px 16px 26px; margin-inline: -4px; }
  .grid-2 { grid-template-columns: 1fr; }
  .menores { padding: 14px 12px; }
  .menor-row { grid-template-columns: 1fr auto; }
  .menor-row .field:nth-child(2) { grid-column: 1; }
  .menor-row .btn-remove { grid-column: 2; grid-row: 1; }
  .btn-submit { max-width: none; }
  .success-actions .btn { width: 100%; }
}
