/* ----------------------------------------------------------------
   Stepper, thin segmented bars below the logo
---------------------------------------------------------------- */
.stepper {
  width: 100%;
}

.stepper__bar {
  display: flex;
  gap: 4px;
  width: 100%;
}

.stepper__seg {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.stepper__bar[data-step="1"] .stepper__seg:nth-child(-n+1),
.stepper__bar[data-step="2"] .stepper__seg:nth-child(-n+2),
.stepper__bar[data-step="3"] .stepper__seg:nth-child(-n+3),
.stepper__bar[data-step="4"] .stepper__seg:nth-child(-n+4),
.stepper__bar[data-step="5"] .stepper__seg:nth-child(-n+5),
.stepper__bar[data-step="6"] .stepper__seg:nth-child(-n+6),
.stepper__bar[data-step="7"] .stepper__seg:nth-child(-n+7) {
  background: var(--brisbane-primary);
}

/* ----------------------------------------------------------------
   Page title block (sits in .app-content, above fields)
---------------------------------------------------------------- */
.page-title,
.welcome-title {
  font-size: 24px;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  line-height: 1.2;
  margin: 0 0 8px 0;
}

.page-subtitle,
.welcome-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
  margin: 0;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .page-title,    .welcome-title    { font-size: 30px; }
  .page-subtitle, .welcome-subtitle { font-size: 18px; }
}

@media (min-width: 1024px) {
  .page-title, .welcome-title { font-size: 36px; }
}

/* ----------------------------------------------------------------
   Buttons
---------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-6);
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1;
  height: 56px;
  transition: background-color 120ms ease, border-color 120ms ease,
              color 120ms ease, transform 120ms ease, opacity 120ms ease;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .btn { height: 58px; }
}

.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--brisbane-primary);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--brisbane-primary-h);
  text-decoration: none;
}

.btn--secondary {
  background: var(--bg-card);
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--bg-page);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-strong);
}

.btn--block { width: 100%; }

/* Right-side chevron icon on bottom action buttons */
.btn__chevron {
  position: absolute;
  right: var(--sp-5);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
}

/* ----------------------------------------------------------------
   Form fields, label above, light bordered input
---------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  letter-spacing: 0.2px;
  margin: 0;
}

.field__hint {
  font-size: var(--fs-helper);
  color: var(--text-muted);
}

.field__error {
  font-size: var(--fs-helper);
  color: var(--error);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0 var(--sp-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  height: 56px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  color: var(--text-strong);
}

.textarea {
  height: auto;
  padding: var(--sp-3) var(--sp-4);
  min-height: 100px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brisbane-primary);
  outline: none;
  box-shadow: 0 0 0 4px var(--brisbane-soft);
}

.input::placeholder {
  color: var(--text-soft);
  font-weight: var(--fw-regular);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23272361' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
  padding-right: 44px;
}

/* Subtle background for OCR-prefilled fields */
.input--ocr {
  background: var(--brisbane-soft-2);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

@media (max-width: 540px) {
  .field-grid { grid-template-columns: 1fr; }
}

/* Address grid, dirección + número + complemento side by side.
   Used in pf/07b cuando el usuario destilda un domicilio. */
.address-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 0.7fr) minmax(0, 1.2fr);
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

@media (max-width: 540px) {
  .address-grid {
    grid-template-columns: 1fr 1fr;
  }
  .address-grid > :first-child {
    grid-column: 1 / -1;
  }
}

/* ----------------------------------------------------------------
   Phone input, country code + number side by side
---------------------------------------------------------------- */
.phone-input {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--sp-2);
}

.phone-input__country {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  font-size: var(--fs-body);
}

/* ----------------------------------------------------------------
   OTP digit boxes
---------------------------------------------------------------- */
.otp {
  display: flex;
  gap: var(--sp-2);
  justify-content: space-between;
  width: 100%;
}

.otp__digit {
  flex: 1 1 0;
  min-width: 0;          /* defeats input's intrinsic 20-char min-width */
  width: 100%;
  padding: 0;            /* avoid horizontal padding pushing layout */
  height: 64px;
  text-align: center;
  font-size: 26px;
  font-weight: var(--fw-bold);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-strong);
}

.otp__digit:focus {
  border-color: var(--brisbane-primary);
  outline: none;
  box-shadow: 0 0 0 4px var(--brisbane-soft);
}

/* ----------------------------------------------------------------
   Choices (radio + checkbox cards)
---------------------------------------------------------------- */
.choice-list {
  display: grid;
  gap: var(--sp-3);
}

.choice-list--two-cols {
  grid-template-columns: 1fr 1fr;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
  text-align: center;
}

@media (min-width: 768px) {
  .choice { padding: var(--sp-4); min-height: 56px; }
}

.choice:hover { border-color: var(--brisbane-primary); }

.choice:has(input:checked) {
  border-color: var(--brisbane-primary);
  background: var(--brisbane-soft-2);
}

.choice input[type="radio"],
.choice input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice__title {
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  font-size: var(--fs-body);
}

.choice__desc {
  font-size: var(--fs-helper);
  color: var(--text-muted);
}

/* Domicilio group (pf/07b), label uppercase + checkbox compacto */
.domicilio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.domicilio-group + .domicilio-group {
  margin-top: var(--sp-3);
}

.domicilio-group__label {
  font-size: var(--fs-helper);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Choice with native checkbox/radio visible (for terms list), compact, sin card */
.choice--check {
  justify-content: flex-start;
  text-align: left;
  padding: 6px 2px;
  min-height: 0;
  border: 0;
  background: transparent;
  gap: 10px;
}

.choice--check:hover {
  border-color: transparent;
  background: transparent;
}

.choice--check:has(input:checked) {
  border-color: transparent;
  background: transparent;
}

.choice--check input[type="checkbox"],
.choice--check input[type="radio"] {
  position: static;
  opacity: 1;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  accent-color: var(--brisbane-primary);
  flex-shrink: 0;
}

.choice--check .choice__text {
  font-weight: var(--fw-medium);
  color: var(--text-default);
  font-size: var(--fs-body);
  line-height: 1.4;
}
.choice--check .choice__text a { color: var(--brisbane-primary); text-decoration: underline; }

/* ----------------------------------------------------------------
   Document frame (DNI capture screens)
---------------------------------------------------------------- */
.doc-frame {
  position: relative;
  border: 2px solid var(--brisbane-primary);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  background: var(--brisbane-soft-2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  margin-bottom: var(--sp-4);
}

.doc-frame__label {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  background: var(--bg-card);
  color: var(--brisbane-primary);
  font-weight: var(--fw-semibold);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--brisbane-primary);
}

.doc-mock {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1.586 / 1;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #d6e4f5 0%, #c8d6ed 100%);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-3);
}

.doc-mock__photo {
  background: rgba(39, 35, 97, 0.18);
  border-radius: 4px;
}

.doc-mock__lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.doc-mock__line {
  height: 7px;
  background: rgba(39, 35, 97, 0.18);
  border-radius: 2px;
}

.doc-mock__line--w70 { width: 70%; }
.doc-mock__line--w50 { width: 50%; }
.doc-mock__line--w90 { width: 90%; }

.doc-mock__barcode {
  position: absolute;
  bottom: var(--sp-3);
  left: var(--sp-3);
  right: var(--sp-3);
  height: 22px;
  background: repeating-linear-gradient(
    to right,
    var(--text-strong) 0 2px,
    transparent 2px 4px,
    var(--text-strong) 4px 7px,
    transparent 7px 9px
  );
  border-radius: 2px;
  opacity: 0.8;
}

/* ----------------------------------------------------------------
   Tips list (DNI screens)
---------------------------------------------------------------- */
.tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.tips li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-page);
  border-radius: var(--radius-md);
  font-size: var(--fs-helper);
  color: var(--text-strong);
  font-weight: var(--fw-medium);
}

.tips__icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

/* ----------------------------------------------------------------
   Tip cards (3 sections in selfie prep, good / bad / info)
---------------------------------------------------------------- */
.tip-section + .tip-section {
  margin-top: var(--sp-5);
}

.tip-section__title {
  font-size: var(--fs-helper);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}

.tip-cards {
  display: grid;
  gap: var(--sp-2);
}

.tip-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-helper);
  font-weight: var(--fw-medium);
}

.tip-card--good { background: var(--success-soft); color: #166534; }
.tip-card--bad  { background: var(--error-soft);   color: #991b1b; }
.tip-card--info { background: var(--brisbane-soft); color: var(--text-strong); }

.tip-card__mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: 12px;
  flex-shrink: 0;
}

.tip-card--good .tip-card__mark { background: var(--success); color: #fff; }
.tip-card--bad  .tip-card__mark { background: var(--error);   color: #fff; }
.tip-card--info .tip-card__mark { background: var(--brisbane-primary); color: #fff; }

/* ----------------------------------------------------------------
   Welcome carousel, illustration + dots
---------------------------------------------------------------- */
/* ---------- Welcome carousel, exact layout from reference ----------
   Sections:
     .welcome-top    : title + subtitle, padding 40px 60px 0  (md)
     .welcome-mid    : illustration + description + dots, fills space
     .welcome-bottom : action button, padding 8px 60px 52px   (md)
*/
.welcome-top {
  flex-shrink: 0;
  padding: 24px 30px 0;
}

.welcome-logo {
  height: 48px;
  width: auto;
  max-width: 100%;
  margin: 0 auto 20px;
  display: block;
}

@media (min-width: 768px) {
  .welcome-logo { height: 60px; margin-bottom: 24px; }
}

.welcome-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 30px;
  gap: 24px;
}

.welcome-illustration {
  width: 220px;
  height: auto;
  max-width: 100%;
}

/* Halo / background shapes, soft shadow tinted with brand color */
.welcome-illustration .svg-clip,
.welcome-illustration .svg-face-bg,
.welcome-illustration .svg-check-bg,
.welcome-illustration .svg-photo-bg,
.welcome-illustration .svg-seal-bg {
  filter: drop-shadow(0 2px 6px rgba(115, 103, 240, 0.35));
}

/* Staggered appear, each direct child fades + scales in.
   Reused by .welcome-illustration and by .appear-stagger (utility class). */
.welcome-illustration > *,
.appear-stagger > * {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: svg-element-appear 0.45s cubic-bezier(0.2, 0.7, 0.3, 1.1) forwards;
}

.welcome-illustration > defs,
.appear-stagger > defs { animation: none; opacity: 1; }

.welcome-illustration > *:nth-child(1),
.appear-stagger > *:nth-child(1)  { animation-delay: 0.05s; }
.welcome-illustration > *:nth-child(2),
.appear-stagger > *:nth-child(2)  { animation-delay: 0.15s; }
.welcome-illustration > *:nth-child(3),
.appear-stagger > *:nth-child(3)  { animation-delay: 0.25s; }
.welcome-illustration > *:nth-child(4),
.appear-stagger > *:nth-child(4)  { animation-delay: 0.35s; }
.welcome-illustration > *:nth-child(5),
.appear-stagger > *:nth-child(5)  { animation-delay: 0.45s; }
.welcome-illustration > *:nth-child(6),
.appear-stagger > *:nth-child(6)  { animation-delay: 0.55s; }
.welcome-illustration > *:nth-child(7),
.appear-stagger > *:nth-child(7)  { animation-delay: 0.65s; }
.welcome-illustration > *:nth-child(8),
.appear-stagger > *:nth-child(8)  { animation-delay: 0.75s; }
.welcome-illustration > *:nth-child(9),
.appear-stagger > *:nth-child(9)  { animation-delay: 0.85s; }
.welcome-illustration > *:nth-child(10),
.appear-stagger > *:nth-child(10) { animation-delay: 0.95s; }
.welcome-illustration > *:nth-child(11),
.appear-stagger > *:nth-child(11) { animation-delay: 1.05s; }
.welcome-illustration > *:nth-child(12),
.appear-stagger > *:nth-child(12) { animation-delay: 1.15s; }
.welcome-illustration > *:nth-child(13),
.appear-stagger > *:nth-child(13) { animation-delay: 1.25s; }

@keyframes svg-element-appear {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-illustration animate { display: none; }
  .welcome-illustration > *,
  .appear-stagger > * {
    opacity: 1;
    animation: none;
  }
}

.welcome-text {
  font-size: 16px;
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  text-align: center;
  margin: 0 auto;
  padding: 0 16px;
  max-width: 420px;
  line-height: 1.5;
}

.welcome-bottom {
  flex-shrink: 0;
  padding: 8px 24px 40px;
}

.welcome-mid .dots {
  margin: 0;
}

.welcome-dots {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 0 24px 16px;
}

@media (min-width: 768px) {
  .welcome-dots { padding: 0 60px 20px; }
}

@media (min-width: 768px) {
  .welcome-top    { padding: 40px 60px 0; }
  .welcome-mid    { padding: 32px 60px; }
  .welcome-bottom { padding: 8px 60px 52px; }
  .welcome-text   { font-size: 18px; }
}

@media (min-width: 1024px) {
  .welcome-top    { padding: 40px 70px 0; }
  .welcome-bottom { padding: 8px 60px 56px; }
}

.dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: var(--sp-6);
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--border-strong);
  border-radius: 4px;
  transition: width 200ms ease, background-color 200ms ease, transform 120ms ease;
  display: block;
  cursor: pointer;
  text-decoration: none;
}

a.dot:hover { background: var(--text-muted); transform: scale(1.15); }
a.dot:focus-visible {
  outline: 2px solid var(--brisbane-primary);
  outline-offset: 3px;
}

.dot--active {
  width: 28px;
  background: var(--text-strong);
}

a.dot--active:hover { transform: none; }

/* ----------------------------------------------------------------
   Summary list (e.g. address confirmation)
---------------------------------------------------------------- */
.summary-list {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
}

.summary-list__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.summary-list__row:last-child { border-bottom: 0; }

.summary-list__label {
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: var(--fw-regular);
}

.summary-list__value {
  color: var(--text-strong);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  text-align: right;
}

/* ----------------------------------------------------------------
   Selfie circle frame, oval, dark background like DNI camera
---------------------------------------------------------------- */
.selfie-circle {
  width: 240px;
  height: 300px;
  border-radius: 50%;
  margin: var(--sp-4) auto;
  background: #2a2a32;
  border: 4px solid var(--brisbane-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.selfie-circle::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px dashed var(--brisbane-primary);
  opacity: 0.4;
}

.selfie-instruction {
  text-align: center;
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  margin: var(--sp-4) 0 var(--sp-2);
}

/* ----------------------------------------------------------------
   Spinner
---------------------------------------------------------------- */
.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid var(--brisbane-soft);
  border-top-color: var(--brisbane-primary);
  margin: 0 auto var(--sp-5);
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------
   Map preview
---------------------------------------------------------------- */
.map-preview {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #e6efee 0%, #d8e7ec 100%);
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 32px 32px;
}

.map-preview__pin {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  background: var(--brisbane-primary);
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-shadow: var(--shadow-md);
}

.map-preview__hint {
  position: absolute;
  bottom: var(--sp-2);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-strong);
  font-size: var(--fs-helper);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: var(--fw-medium);
}

/* ----------------------------------------------------------------
   Info link / details (PEP, SO tooltips)
---------------------------------------------------------------- */
.info-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-helper);
  color: var(--brisbane-primary);
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.info-link::before {
  content: "ⓘ";
  font-size: 14px;
}

.info-box {
  background: var(--brisbane-soft-2);
  border-left: 3px solid var(--brisbane-primary);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-helper);
  color: var(--text-strong);
  font-weight: var(--fw-regular);
}

details.info-disclosure summary { list-style: none; cursor: pointer; }
details.info-disclosure summary::-webkit-details-marker { display: none; }

/* ----------------------------------------------------------------
   Result icon (success / loading screens)
---------------------------------------------------------------- */
.result-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--brisbane-soft);
  color: var(--brisbane-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin: 0 auto var(--sp-5);
}

/* ----------------------------------------------------------------
   Resend OTP row
---------------------------------------------------------------- */
.resend-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  font-size: var(--fs-helper);
}

.resend-row a,
.resend-row button {
  color: var(--brisbane-primary);
  font-weight: var(--fw-semibold);
}

/* ----------------------------------------------------------------
   Question block (PEP / SO declarations), title + Yes/No buttons
---------------------------------------------------------------- */
.question {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.question__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.question__title {
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  line-height: 1.3;
}

.question + .question { margin-top: var(--sp-3); }

@media (min-width: 768px) {
  .question { gap: var(--sp-3); }
  .question__title { font-size: var(--fs-body); }
  .question + .question { margin-top: var(--sp-6); }
}

/* ----------------------------------------------------------------
   Terms box, scrollable container with the full T&C text inside.
   Used on pf/01-terminos.html. Combine with .page-fields--no-scroll
   on the parent so the box scrolls internally.
---------------------------------------------------------------- */
.terms-box {
  flex: 0 0 auto;
  height: clamp(200px, 38vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  scrollbar-width: thin;
}

.terms-box h3 {
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 18px 0 8px;
}

.terms-box h3:first-child { margin-top: 0; }

.terms-box h4 {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  margin: 14px 0 6px;
}

.terms-box p {
  margin: 0 0 10px;
}

.terms-box p:last-child { margin-bottom: 0; }

.page-fields--no-scroll {
  overflow: visible;
}

/* ----------------------------------------------------------------
   Captured photo (review screens after DNI capture)
---------------------------------------------------------------- */
.captured-photo {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1.586 / 1;        /* ISO ID-1 card ratio = DNI proportion */
  margin: 8px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-page);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.captured-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;            /* mostrar el documento completo sin recortar */
  object-position: center;
  padding: 6px;
}

@media (min-width: 768px) {
  .captured-photo { max-width: 400px; }
}

/* ----------------------------------------------------------------
   Camera viewport (DNI capture screens, dark mock)
---------------------------------------------------------------- */
.camera-viewport {
  width: 100%;
  max-width: 366px;
  max-height: 50dvh;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  background: #2a2a32;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .camera-viewport { max-width: 546px; max-height: 55dvh; }
}

@media (min-width: 1024px) {
  .camera-viewport { max-width: 666px; max-height: 60dvh; }
}

.camera-viewport__frame {
  position: absolute;
  inset: 18% 6%;
  border: 2px solid var(--brisbane-primary);
  border-radius: 8px;
}

.camera-viewport__pill {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brisbane-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-helper);
  font-weight: var(--fw-semibold);
  text-align: center;
  max-width: 80%;
}

.capture-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--text-strong);
  border: 4px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--text-strong);
  margin: var(--sp-4) auto var(--sp-2);
  display: block;
  cursor: pointer;
  padding: 0;
}

@media (min-width: 768px) {
  .capture-button { margin: var(--sp-2) auto var(--sp-2); }
}

.upload-link {
  display: block;
  text-align: center;
  color: var(--text-strong);
  text-decoration: underline;
  font-size: var(--fs-helper);
  font-weight: var(--fw-medium);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
}

/* ----------------------------------------------------------------
   Document orientation cards (pf/01b-orientaciones-documento)
---------------------------------------------------------------- */
.doc-orient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin: var(--sp-4) auto;
  max-width: 380px;
}

.doc-orient-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  margin: 0;
}

.doc-orient-card__art {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 2px solid var(--brisbane-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-orient-card__art svg {
  width: 100%;
  height: auto;
  display: block;
}

.doc-orient-card--bad .doc-orient-card__art {
  border: 2px dashed var(--border-strong);
  background: var(--bg-page);
  transform: rotate(9deg);
  opacity: 0.7;
}

.doc-orient-card__caption {
  font-size: var(--fs-helper);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

/* ----------------------------------------------------------------
   Comparison cards (Correto / Incorreto illustrations)
---------------------------------------------------------------- */
.compare-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin: var(--sp-2) 0 var(--sp-4);
}

.compare-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  text-align: center;
}

.compare-card__illustration {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 48px;
  color: var(--text-soft);
}

.compare-card--ok .compare-card__illustration {
  border: 1.5px solid var(--text-strong);
  background: var(--bg-card);
}

.compare-card--bad .compare-card__illustration {
  border: 1.5px dashed var(--border-strong);
  background: var(--bg-page);
  transform: rotate(2deg);
  opacity: 0.75;
}

.compare-card__mark {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}

.compare-card--ok .compare-card__mark { background: var(--text-strong); }
.compare-card--bad .compare-card__mark { background: var(--text-soft); }

.compare-card__label {
  font-size: var(--fs-helper);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

/* ----------------------------------------------------------------
   Numbered list (steps / retry instructions)
---------------------------------------------------------------- */
.numbered-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.numbered-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-helper);
  color: var(--text-default);
}

.numbered-list__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brisbane-soft);
  color: var(--brisbane-primary);
  font-weight: var(--fw-semibold);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Actions split (two side-by-side buttons, 50/50)
---------------------------------------------------------------- */
.actions--split {
  flex-direction: row;
  gap: var(--sp-3);
}

.actions--split .btn { flex: 1; }
.actions--split .btn__chevron { display: none; }

@media (max-width: 540px) {
  .actions--split { flex-direction: column-reverse; }
}

/* ----------------------------------------------------------------
   Status list (resultado / cadastro concluído)
---------------------------------------------------------------- */
.status-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.status-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-default);
  font-size: var(--fs-body);
}

.status-list__icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-strong);
  flex-shrink: 0;
}

.status-list__icon svg { width: 24px; height: 24px; }

.status-list li.status--pending,
.status-list li.status--pending .status-list__icon { color: var(--text-soft); }

.status-list strong {
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

/* ----------------------------------------------------------------
   Contact footer (after the status list on resultado)
---------------------------------------------------------------- */
.contact-footer {
  margin-top: var(--sp-10);
  font-size: var(--fs-helper);
  color: var(--text-muted);
}

.contact-footer__rows {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.contact-footer__row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-strong);
  font-weight: var(--fw-medium);
}

.contact-footer__row svg { width: 14px; height: 14px; flex-shrink: 0; }
.contact-footer__row a { color: var(--brisbane-primary); }

/* ----------------------------------------------------------------
   Help link ("Precisa de ayuda?" below title)
---------------------------------------------------------------- */
.help-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-helper);
  color: var(--text-strong);
  font-weight: var(--fw-medium);
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.help-link::before { content: "ⓘ"; font-size: 14px; text-decoration: none; }

/* Icon-only variant, no text, just the (i). Used in declaraciones finales. */
.help-link--icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  text-decoration: none;
  color: var(--brisbane-primary);
  justify-content: center;
}

.help-link--icon::before {
  font-size: 18px;
  line-height: 1;
}

.help-link--icon:hover { background: var(--brisbane-soft); }

/* ----------------------------------------------------------------
   Modal (uses native <dialog>), used in pf/13-declaraciones for
   "Más información" of each declaration.
---------------------------------------------------------------- */
dialog.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow: visible;
}

dialog.modal::backdrop {
  background: rgba(31, 31, 46, 0.55);
}

.modal__card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 24px 24px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.modal__close:hover { background: var(--bg-page); }
.modal__close svg { width: 18px; height: 18px; }

.modal__title {
  font-size: 17px;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  margin: 0 0 12px;
  padding-right: 36px;
  line-height: 1.3;
}

.modal__body {
  font-size: var(--fs-helper);
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.modal__body p { margin: 0; }
.modal__body p + p { margin-top: 10px; }
.modal__body strong {
  color: var(--text-strong);
  font-weight: var(--fw-semibold);
}

/* ----------------------------------------------------------------------------
   Field row — duas colunas lado a lado (Número/Complemento, Cidade/UF)
   ---------------------------------------------------------------------------- */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Quando o segundo item é UF (curto), reduz coluna */
.field-row .field:last-child .select[id="uf"] { min-width: 80px; }

/* ----------------------------------------------------------------------------
   Upload dropzone — área tracejada para envio de comprovantes
   ---------------------------------------------------------------------------- */
.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4);
  background: var(--travelex-navy-soft);
  border: 2px dashed var(--travelex-navy);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.upload-dropzone:hover {
  background: var(--travelex-red-soft);
  border-color: var(--travelex-red);
}

.upload-dropzone__icon {
  flex-shrink: 0;
}

.upload-dropzone__title {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.upload-dropzone__hint {
  margin: 0;
  font-size: var(--fs-helper);
  color: var(--text-muted);
}


/* ----------------------------------------------------------------------------
   Welcome logo Travelex (sobrescreve qualquer regra anterior)
   ---------------------------------------------------------------------------- */
.welcome-logo {
  height: 32px;
  width: auto;
  max-width: 100%;
  margin: 0 auto 20px;
  display: block;
  object-fit: contain;
}

@media (min-width: 768px) {
  .welcome-logo { height: 40px; margin-bottom: 24px; }
}

/* ----------------------------------------------------------------------------
   Sticky bottom button — "Continuar" sempre visível no rodapé
   ---------------------------------------------------------------------------- */
.page-bottom {
  position: sticky;
  bottom: 0;
  background: var(--bg-page);
  padding-top: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  margin-top: auto;
  z-index: 5;
  border-top: 1px solid var(--border);
}

/* Adiciona espaço entre conteúdo e botão para não colar visualmente */
.page-fields {
  padding-bottom: 8px;
}

/* ----------------------------------------------------------------------------
   CEP — feedback (spinner + endereço descoberto)
   ---------------------------------------------------------------------------- */

.cep-feedback {
  margin-top: 16px;
  min-height: 80px;
}

.cep-spinner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 12px 0;
}

.cep-spinner[hidden] { display: none; }

.spin { animation: spin 1s linear infinite; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cep-result {
  padding: 16px 0;
}

.cep-result[hidden] { display: none; }

.cep-result__street {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.35;
}

.cep-result__locality {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.cep-result--inline {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--travelex-navy-soft);
  border-radius: var(--radius-md);
}

/* ----------------------------------------------------------------------------
   Review card — confirmação de endereço (tabela leve)
   ---------------------------------------------------------------------------- */
.review-card {
  margin: 0;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.review-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.review-row:last-child { border-bottom: none; }

.review-row dt {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.review-row dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  text-align: right;
}

/* ============================================================================
   BOTTOM BAR FIXO — botão "Continuar" sempre na mesma posição (welcome → fim)
   ============================================================================ */

.page-bottom,
.welcome-bottom {
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-page);
  border-top: 1px solid var(--border);
  padding: 16px 24px max(20px, env(safe-area-inset-bottom));
  margin: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Centraliza os botões dentro da largura do app-frame */
.page-bottom > *,
.welcome-bottom > * {
  max-width: var(--app-frame);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Conteúdo precisa de padding-bottom para não ficar atrás do bottom bar fixo */
.page-fields,
.welcome-mid {
  padding-bottom: 120px !important;
}

@media (min-width: 768px) {
  .page-bottom,
  .welcome-bottom {
    padding: 18px 60px max(28px, env(safe-area-inset-bottom));
  }
  .page-fields,
  .welcome-mid {
    padding-bottom: 140px !important;
  }
}

/* welcome-dots (paginação) ficam acima do bottom fixo, no fluxo normal */
.welcome-dots {
  margin-bottom: 0;
}

/* ============================================================================
   OVERRIDE bottom bar — alinha à largura do app-frame (não full viewport)
   ============================================================================ */
.page-bottom,
.welcome-bottom {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-frame);
  box-sizing: border-box;
}

/* Botões herdam largura natural do container; remove o wrap interno */
.page-bottom > *,
.welcome-bottom > * {
  max-width: none;
  width: auto;
  margin-left: 0;
  margin-right: 0;
}

/* Botões .btn--block continuam ocupando 100% da largura disponível */
.page-bottom > .btn--block,
.welcome-bottom > .btn--block {
  width: 100%;
}

/* ============================================================================
   FIX: bottom bar com align-items center (capture-button não pode esticar)
   ============================================================================ */
.page-bottom,
.welcome-bottom {
  align-items: center;
}

/* .btn--block continua 100% de largura mesmo com align-items: center */
.page-bottom > .btn--block,
.welcome-bottom > .btn--block,
.page-bottom > button.btn--block,
.welcome-bottom > button.btn--block {
  width: 100%;
  align-self: stretch;
}

/* capture-button mantém tamanho fixo circular */
.page-bottom > .capture-button {
  flex-shrink: 0;
}

/* ============================================================================
   FIX FINAL: capture-button precisa ser CÍRCULO 72×72px (não esticar)
   ============================================================================ */
.page-bottom > .capture-button,
.welcome-bottom > .capture-button,
button.capture-button {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px;
  min-height: 72px;
  max-width: 72px;
  max-height: 72px;
  border-radius: 50% !important;
  align-self: center !important;
  flex-shrink: 0;
  padding: 0;
  display: block;
  background: var(--text-strong);
  border: 4px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--text-strong);
  margin: 8px auto;
}

/* ============================================================================
   CAMERA-VIEWPORT — reduzido para caber sem scroll
   ============================================================================ */
.camera-viewport {
  max-width: 320px !important;
  max-height: 38dvh !important;
  aspect-ratio: 4 / 3;
  margin: 0 auto !important;
}

@media (min-width: 768px) {
  .camera-viewport {
    max-width: 420px !important;
    max-height: 42dvh !important;
  }
}

@media (min-width: 1024px) {
  .camera-viewport {
    max-width: 480px !important;
    max-height: 44dvh !important;
  }
}

/* Garante que a tela de captura não scrolla — viewport encolhe se necessário */
.page-fields--no-scroll {
  overflow: hidden !important;
}

/* Selfie circle também menor para não estourar */
.selfie-circle {
  max-width: 240px !important;
  max-height: 38dvh !important;
}

/* ============================================================================
   FIX: bordas laterais continuam até o final da página (através do bottom bar)
   ============================================================================ */
.page-bottom,
.welcome-bottom {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Garante app-frame com altura total para a borda chegar ao chão */
.app-frame {
  min-height: 100dvh;
}

html, body {
  min-height: 100dvh;
  height: auto;
}

/* Mobile (sem bordas laterais), bottom bar também sem */
@media (max-width: 540px) {
  .page-bottom,
  .welcome-bottom {
    border-left: 0;
    border-right: 0;
  }
}


/* ============================================================================
   welcome-dots dentro do welcome-bottom: linha divisória entre dots e botão
   (dots em cima, linha embaixo dos dots, botão por último)
   ============================================================================ */
.welcome-bottom { border-top: none !important; }
.welcome-bottom > .welcome-dots {
  margin: -16px -24px 0;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
}
@media (min-width: 768px) {
  .welcome-bottom > .welcome-dots {
    margin: -18px -60px 0;
    padding: 14px 60px;
  }
}


/* ============================================================================
   choice-list--two-cols (Sim/Não binário): cards mais finos, menos padding
   ============================================================================ */
.choice-list--two-cols .choice {
  min-height: 36px;
  padding: 6px var(--sp-3);
}
@media (min-width: 768px) {
  .choice-list--two-cols .choice {
    min-height: 40px;
    padding: 8px var(--sp-3);
  }
}
.choice-list--two-cols .choice__title {
  font-size: var(--fs-body);
  line-height: 1.1;
}


/* ============================================================================
   Font 14px em botões e subtítulos (mobile + desktop)
   ============================================================================ */
.btn { font-size: 14px !important; }
.page-subtitle,
.welcome-subtitle { font-size: 14px !important; }
