:root {
  --green: #0f6b4f;
  --green2: #149263;
  --ink: #19352d;
  --muted: #6e7e78;
  --line: #dfe8e4;
  --bg: #f3f7f5;
  --soft: #eaf4ef;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.public-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 107, 79, 0.09);
}
.public-header-inner {
  max-width: 1280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}
.public-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--green), var(--green2));
  color: #fff;
}
.public-brand strong,
.public-brand small {
  display: block;
}
.public-brand small {
  font-size: 0.72rem;
  color: var(--muted);
}
.public-header nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.public-header nav > a:not(.btn) {
  color: #52665f;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.public-hero {
  background:
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.18),
      transparent 26%
    ),
    linear-gradient(135deg, #0b533f, #0f6b4f 56%, #17855f);
  color: #fff;
}
.public-hero .container {
  max-width: 1180px;
  min-height: 450px;
}
.public-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 1.02;
  max-width: 760px;
  margin: 18px 0;
}
.public-hero p {
  max-width: 720px;
  font-size: 1.06rem;
  color: rgba(255, 255, 255, 0.8);
}
.hero-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}
.hero-summary {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  backdrop-filter: blur(6px);
}
.hero-summary > strong {
  font-size: 1.1rem;
}
.hero-summary > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.hero-summary span {
  display: grid;
  gap: 7px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px 8px;
  border-radius: 15px;
  font-size: 0.76rem;
}
.hero-summary i {
  font-size: 1.35rem;
}
.registration-wrap {
  max-width: 1180px;
}
.registration-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  margin-top: -18px;
  position: relative;
  box-shadow: 0 22px 55px rgba(27, 67, 54, 0.09);
  padding: clamp(22px, 4vw, 44px);
}
.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 30px;
}
.step {
  border: 0;
  background: none;
  color: #8a9893;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  white-space: nowrap;
}
.step span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf2f0;
  color: #788782;
}
.step.active {
  color: var(--green);
}
.step.active span,
.step.done span {
  background: var(--green);
  color: #fff;
}
.form-step {
  display: none;
}
.form-step.active {
  display: block;
}
.step-heading {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 25px;
}
.step-heading > span {
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--green);
  background: var(--soft);
  padding: 7px 9px;
  border-radius: 9px;
}
.step-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}
.step-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}
.form-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: #3a5048;
}
.form-control,
.form-select {
  min-height: 48px;
  border-radius: 12px;
  border-color: var(--line);
}
.form-control:focus,
.form-select:focus {
  border-color: #63aa8d;
  box-shadow: 0 0 0 0.2rem rgba(15, 107, 79, 0.1);
}
.yesno-card {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 15px;
  background: #fbfdfc;
}
.yesno-card > span {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 12px;
}
.yesno-card > div {
  display: flex;
  gap: 8px;
}
.yesno-card label {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  background: #fff;
}
.yesno-card input {
  accent-color: var(--green);
}
.form-step[data-step="2"] .row.g-3 > [class*="col-"] {
  display: flex;
  flex-direction: column;
}
.form-step[data-step="2"] .row.g-3 > [class*="col-"] > .form-select,
.form-step[data-step="2"] .row.g-3 > [class*="col-"] > .form-control {
  margin-top: auto;
}
.geo-box,
.privacy-note {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid #d5e8df;
}
.geo-box > div {
  flex: 1;
}
.geo-box p,
.privacy-note p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.privacy-note > i {
  font-size: 1.7rem;
  color: var(--green);
}
.upload-card {
  display: block;
  border: 1px dashed #a9c8ba;
  border-radius: 16px;
  padding: 18px;
  background: #fbfdfc;
  cursor: pointer;
  transition: 0.2s;
}
.upload-card:hover {
  border-color: var(--green);
  background: var(--soft);
}
.upload-card > span {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
}
.upload-card i {
  grid-row: 1/3;
  font-size: 1.5rem;
  color: var(--green);
}
.upload-card strong,
.upload-card small {
  display: block;
}
.upload-card small {
  color: var(--muted);
}
.upload-card input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.file-field {
  position: relative;
}
.file-field-display {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.6rem 0.8rem;
  min-height: 42px;
  font-size: 0.87rem;
}
.file-field:focus-within .file-field-display {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}
.file-field-display > i {
  color: var(--green);
  font-size: 1rem;
  flex: none;
}
.file-field-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.file-field-display small {
  flex: none;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}
.file-field-hint.is-saved {
  color: var(--green);
  font-weight: 800;
}
.file-field.is-filled .file-field-display {
  border-color: #9fd3ba;
  background: #f2faf6;
}
.upload-card.file-field .file-field-display {
  margin-top: 12px;
  border-style: dashed;
  background: #fbfdfc;
}
.upload-card.file-field.is-filled,
.upload-card.file-field.is-draft {
  border-style: solid;
  border-color: rgba(15, 107, 79, 0.45);
}
.upload-card.file-field.is-filled .file-field-display,
.file-field.is-draft .file-field-display {
  border-style: solid;
  border-color: rgba(15, 107, 79, 0.35);
  background: #eaf4ef;
}
.conditional-doc {
  display: none;
}
.form-actions {
  display: flex;
  align-items: center;
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.form-actions .btn {
  min-height: 46px;
  border-radius: 12px;
  font-weight: 800;
}
.public-footer {
  padding: 28px 0;
  color: #789087;
  text-align: center;
  font-size: 0.82rem;
}
.success-card,
.lookup-card {
  max-width: 760px;
  margin: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(28px, 5vw, 55px);
  box-shadow: 0 22px 55px rgba(27, 67, 54, 0.08);
}
.success-card {
  text-align: center;
}
.success-icon {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: var(--soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  margin: 0 auto 20px;
}
.eyebrow-public {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--green);
}
.success-card h1,
.lookup-card h1 {
  font-size: 2rem;
  margin: 8px 0;
}
.success-card p,
.lookup-card p {
  color: var(--muted);
}
.registration-code {
  display: inline-block;
  padding: 15px 22px;
  border-radius: 14px;
  background: #122d25;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 1.15rem;
  margin: 0;
}
.code-box {
  max-width: 420px;
  margin: 8px auto 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.code-label {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.next-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 6px;
  text-align: left;
}
.next-steps > div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.next-steps i {
  color: var(--green);
  font-size: 1.3rem;
  margin-bottom: 8px;
  display: block;
}
.next-steps strong {
  display: block;
  font-size: 0.92rem;
}
.next-steps small {
  color: var(--muted);
  line-height: 1.35;
}
@media (max-width: 760px) {
  .next-steps {
    grid-template-columns: 1fr;
  }
}
.lookup-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 26px;
}
.lookup-heading > span {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 1.2rem;
}
.lookup-result {
  padding: 20px;
  border-radius: 16px;
  background: var(--soft);
}
.lookup-result h2 {
  font-size: 1.3rem;
  margin: 9px 0;
}
.lookup-result p {
  margin: 0;
}
.public-menu-toggle {
  display: none;
}
@media (max-width: 900px) and (min-width: 761px) {
  .step {
    font-size: 0.7rem;
    gap: 5px;
  }
  .step span {
    width: 24px;
    height: 24px;
  }
}
@media (max-width: 760px) {
  .public-header-inner {
    padding: 11px 16px;
  }
  .public-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--green);
    font-size: 1.35rem;
    cursor: pointer;
  }
  .public-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid rgba(15, 107, 79, 0.12);
    box-shadow: 0 14px 28px rgba(15, 42, 29, 0.12);
    padding: 8px 16px 14px;
  }
  .public-header nav.open {
    display: flex;
  }
  .public-header nav > a:not(.btn) {
    display: block;
    padding: 13px 6px;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .public-header nav > .btn {
    margin-top: 12px;
    text-align: center;
    padding: 9px 12px;
  }
  .stepper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    position: sticky;
    top: 8px;
    z-index: 40;
    margin: 0 0 22px;
    padding: 7px;
    border: 1px solid rgba(15, 107, 79, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 8px 22px rgba(15, 42, 29, 0.1);
  }
  .stepper::-webkit-scrollbar {
    height: 0;
  }
  .step {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    gap: 0;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    font-size: 0;
    color: #7a8a84;
    background: #fff;
    white-space: nowrap;
  }
  .stepper > .step:first-child {
    margin-left: auto;
  }
  .stepper > .step:last-child {
    margin-right: auto;
  }
  .step span,
  .step.done span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: none;
    color: inherit;
    font-size: 0.78rem;
    font-weight: 800;
  }
  .step.done {
    background: var(--soft);
    border-color: #9fd3ba;
    color: var(--green);
  }
  .step.active {
    width: auto;
    min-width: 34px;
    height: auto;
    min-height: 34px;
    gap: 6px;
    padding: 0 15px 0 6px;
    border: 0;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--green2));
  }
  .step.active span {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
    background: #fff;
    color: var(--green);
  }
  .registration-card {
    border-radius: 20px;
    margin-top: 0;
  }
  .hero-summary > div {
    grid-template-columns: 1fr;
  }
  .public-hero h1 {
    font-size: 2.35rem;
  }
}

.flash-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(420px, calc(100vw - 2rem));
}
.flash-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid rgba(15, 42, 29, 0.08);
  box-shadow: 0 0.5rem 1.5rem rgba(15, 42, 29, 0.18);
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.flash-toast i {
  font-size: 1.05rem;
  line-height: 1.3;
}
.flash-toast.flash-success {
  border-left: 4px solid var(--green, #0f6b4f);
}
.flash-toast.flash-success i {
  color: var(--green, #0f6b4f);
}
.flash-toast.flash-error {
  border-left: 4px solid #b02a37;
}
.flash-toast.flash-error i {
  color: #b02a37;
}
.flash-toast span {
  flex: 1;
}
.flash-close {
  background: none;
  border: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: #6c757d;
  padding: 0 0.15rem;
  cursor: pointer;
}
.flash-close:hover {
  color: #212529;
}
.flash-toast.flash-hide {
  opacity: 0;
  transform: translateX(1rem);
}

.review-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.review-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 18px 20px;
}
.review-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.review-section h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--green);
}
.review-section dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 22px;
}
.review-section dl > div {
  min-width: 0;
}
.review-section dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
.review-section dd {
  margin: 2px 0 0;
  font-size: 0.93rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.review-section dl.review-docs {
  grid-template-columns: 1fr;
  gap: 0;
}
.review-section dl.review-docs > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--line);
}
.review-section dl.review-docs > div:last-child {
  border-bottom: 0;
}
.review-section dl.review-docs dt {
  margin: 0;
  font-size: 0.78rem;
}
.review-section dl.review-docs dd {
  margin: 0;
  text-align: right;
  font-size: 0.88rem;
}
.review-pending {
  color: #b02a37;
  font-weight: 700;
}
.review-file-meta {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}

.street-card{border:1px solid var(--line);border-radius:16px;padding:16px 18px;background:#fbfdfc;display:flex;flex-direction:column;gap:12px}
.street-segment{display:flex;flex-direction:column;gap:6px}
.street-seg-label{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:800}
.street-fields{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.street-fields select{flex:1 1 110px;min-width:96px}
.street-fields select.street-small{flex:0 1 80px;min-width:0}
.street-fields input.street-num{flex:0 1 104px;min-width:0}
.street-fields input{flex:1 1 110px;min-width:90px}
.street-fields .street-sep{font-weight:900;color:var(--green);font-size:1.3rem;padding:0 2px;line-height:1}
.street-preview{margin-top:12px;padding:10px 14px;border-radius:10px;background:var(--soft)}
.street-preview small{display:block;color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;font-weight:800}
.street-preview strong{font-size:1rem;color:var(--ink)}

.address-picker{display:flex;flex-wrap:wrap;gap:10px;align-items:stretch}
.address-trigger{flex:0 0 auto;align-self:flex-start}
.address-display{flex:1 1 280px;min-width:0;cursor:pointer;text-align:left;font:inherit;color:var(--ink);-webkit-appearance:none;appearance:none;width:100%}
.address-display:hover{border-color:var(--green)}
.address-display .file-field-name{color:var(--muted);font-weight:600}
.address-display.is-filled .file-field-name{color:var(--ink)}
.address-display .file-field-hint{font-weight:800}
.address-display.is-filled .file-field-hint{color:var(--green)}
.address-display .address-edit-icon{color:var(--muted);font-size:.85rem;flex:none}
.address-display.is-filled{border-color:#9fd3ba;background:#f2faf6}

/* Móvil: header oculto (la navegación inferior vive en bottom-nav.css) */
@media (max-width: 760px) {
  .public-header {
    display: none;
  }
}

/* Móvil: hero del registro oculto para dejar espacio al formulario */
@media (max-width: 760px) {
  .public-hero {
    display: none;
  }
  .registration-wrap {
    padding-top: 1.25rem;
  }
}

/* Wizard en móvil: cabecera de paso y acciones */
@media (max-width: 760px) {
  .public-brand small {
    display: none;
  }

  .step-heading {
    gap: 12px;
    margin-bottom: 20px;
  }
  .step-heading > span {
    display: none;
  }
  .step-heading h2 {
    font-size: 1.28rem;
    line-height: 1.15;
  }
  .step-heading p {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .yesno-card label {
    padding: 12px 10px;
    border-radius: 12px;
  }
  .yesno-card > span {
    font-size: 0.84rem;
  }

  .file-field-display {
    min-height: 50px;
  }

  .form-actions {
    position: sticky;
    bottom: calc(var(--bottomnav-h, 66px) + env(safe-area-inset-bottom) + 8px);
    z-index: 35;
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin: 24px 0 0;
    padding: 0;
  }
  .form-actions > .btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: none;
    width: calc(50% - 5px);
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid rgba(15, 107, 79, 0.28);
    border-radius: 16px;
    background: #fff;
    color: var(--green);
    font-weight: 800;
    font-size: 0.95rem;
  }
  form[data-step-active="1"] .form-actions > .btn-light {
    display: none;
  }
  .form-actions .ms-auto {
    flex: none;
    width: calc(50% - 5px);
    min-width: 0;
    margin-left: 0 !important;
    display: flex;
  }
  form[data-step-active="1"] .form-actions .ms-auto {
    width: 100%;
  }
  .form-actions .ms-auto .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 54px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1rem;
  }
}

/* Modal de dirección a pantalla completa en teléfonos */
@media (max-width: 760px) {
  #addressModal {
    padding: 0 !important;
  }
  #addressModal .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    align-items: stretch;
  }
  #addressModal .modal-content {
    border: 0;
    border-radius: 0;
    max-height: none;
    height: 100%;
  }
  #addressModal .modal-body {
    min-height: 0;
    overflow-y: auto;
  }
}

/* Pantallas muy angostas */
@media (max-width: 380px) {
  .registration-card {
    padding: 18px 15px;
  }
  .step-heading h2 {
    font-size: 1.2rem;
  }
}

/* Paso 1 en móvil: sin cajas de archivo, solo el botón para abrir el visor */
@media (max-width: 760px) {
  #identityOcrCard .identity-upload-col {
    display: none;
  }
  .identity-scan-col {
    width: 100%;
  }
  .identity-scan-col .btn {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--green2));
  }
}
