/*
 * JI Public UI System — v19.68.3
 * Canonical presentation layer for public-facing controls and surfaces.
 * Loaded last so legacy modules inherit one visual language without
 * changing their business logic or semantic colour variants.
 */
:root{
  --ji-ui-font:var(--ji-font-family,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);
  --ji-ui-navy:#0f2b63;
  --ji-ui-blue:#2457e6;
  --ji-ui-blue-dark:#1d49c4;
  --ji-ui-red:#cf142b;
  --ji-ui-red-dark:#ad1025;
  --ji-ui-ink:#0d214a;
  --ji-ui-copy:#51627f;
  --ji-ui-muted:#6b7890;
  --ji-ui-border:#d8e2fb;
  --ji-ui-border-strong:#bfd0ff;
  --ji-ui-surface:#fff;
  --ji-ui-surface-soft:#f8fbff;
  --ji-ui-surface-muted:#f4f7ff;
  --ji-ui-success:#17663e;
  --ji-ui-success-soft:#effaf3;
  --ji-ui-warning:#8a5a00;
  --ji-ui-warning-soft:#fff8e5;
  --ji-ui-danger:#a61b2b;
  --ji-ui-danger-soft:#fff1f1;
  --ji-ui-radius-xs:8px;
  --ji-ui-radius-sm:10px;
  --ji-ui-radius-md:14px;
  --ji-ui-radius-lg:18px;
  --ji-ui-radius-xl:22px;
  --ji-ui-radius-pill:999px;
  --ji-ui-control-height:50px;
  --ji-ui-button-height:46px;
  --ji-ui-shadow-sm:0 6px 18px rgba(15,43,99,.045);
  --ji-ui-shadow-md:0 14px 34px rgba(15,43,99,.08);
  --ji-ui-focus:0 0 0 3px rgba(36,87,230,.18);
  --ji-ui-title-xl:clamp(2rem,4.5vw,3.35rem);
  --ji-ui-title-lg:clamp(1.5rem,3vw,2.05rem);
  --ji-ui-title-md:1.25rem;
  --ji-ui-copy-size:1rem;
  --ji-ui-help-size:.84rem;
}

/* Typography hierarchy */
body.ji-theme{font-family:var(--ji-ui-font);color:var(--ji-ui-ink)}
body.ji-theme :is(.ji-jjvv-form-head h1,.ji-doc-page__header h1,.ji-platform-hero h1,.ji-transparency-hero h1){
  color:var(--ji-ui-blue);font-size:var(--ji-ui-title-xl);font-weight:700!important;line-height:1.06!important;letter-spacing:-.035em!important;
}
body.ji-theme :is(.ji-cert-step>h2,.ji-atencion__results-head h2,.ji-global-lightbox__dialog h2,.ji-patrimonio-modal__content h2){
  color:var(--ji-ui-navy);font-size:var(--ji-ui-title-lg);font-weight:700!important;line-height:1.15;letter-spacing:-.02em;
}
body.ji-theme :is(.ji-card h3,.ji-service-card h3,.ji-event-item h3,.ji-form-review-card h3,.ji-status-timeline h3,.ji-jjvv-form h3){
  color:var(--ji-ui-navy);font-size:var(--ji-ui-title-md);font-weight:700!important;line-height:1.25;letter-spacing:-.012em;
}
body.ji-theme :is(.ji-kicker,.ji-doc-page__eyebrow){font-weight:700!important;letter-spacing:.11em!important}

/* Canonical labels and helper text */
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form) label{
  color:var(--ji-ui-ink);font-weight:700!important;line-height:1.3;
}
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form) label small,
body.ji-theme .ji-jjvv-form__field>small{
  display:block;margin:.34rem 0 .46rem;color:var(--ji-ui-copy)!important;font-size:var(--ji-ui-help-size)!important;font-weight:500!important;line-height:1.45;
}

/* Canonical public form controls. Native checkbox/radio/file keep their specialised UI. */
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form,.ji-cert-query-form,.ji-address-checker--embedded,.ji-gis__address-lookup)
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),select,textarea){
  width:100%;min-width:0;min-height:var(--ji-ui-control-height);margin-top:.35rem;padding:.78rem .95rem;
  border:1px solid var(--ji-ui-border-strong)!important;border-radius:var(--ji-ui-radius-md)!important;
  background:var(--ji-ui-surface-soft)!important;color:var(--ji-ui-ink)!important;
  box-shadow:none!important;font-family:var(--ji-ui-font);font-size:1rem;line-height:1.45;font-weight:400;
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form,.ji-cert-query-form,.ji-address-checker--embedded,.ji-gis__address-lookup) textarea{
  min-height:132px;resize:vertical;
}
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form,.ji-cert-query-form,.ji-address-checker--embedded,.ji-gis__address-lookup)
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),select,textarea):focus{
  outline:0!important;border-color:var(--ji-ui-blue)!important;background:var(--ji-ui-surface)!important;box-shadow:var(--ji-ui-focus)!important;
}
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form) :is(input,select,textarea)::placeholder{color:#8190aa;opacity:1}
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form) :is(input,select,textarea):disabled{
  background:#f1f4f8!important;color:#8490a3!important;cursor:not-allowed;opacity:1;
}
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form) :is(input[type="checkbox"],input[type="radio"]){
  accent-color:var(--ji-ui-blue);width:20px;height:20px;min-width:20px;vertical-align:middle;
}

/* Validation states */
body.ji-theme .ji-jjvv-form__field.is-valid :is(input:not([type=file]),select,textarea){border-color:#86c9a2!important;box-shadow:0 0 0 2px rgba(23,102,62,.05)!important}
body.ji-theme .ji-jjvv-form__field :is(input,select,textarea)[aria-invalid="true"]{border-color:#d94b5c!important;box-shadow:0 0 0 2px rgba(207,20,43,.08)!important}

/* File input shell and rich preview */
body.ji-theme .ji-jjvv-form input[type="file"]{
  min-height:var(--ji-ui-control-height);padding:1rem!important;border:2px dashed var(--ji-ui-border-strong)!important;border-radius:var(--ji-ui-radius-md)!important;
  background:var(--ji-ui-surface-soft)!important;color:var(--ji-ui-ink)!important;
}
body.ji-theme .ji-jjvv-form input[type="file"]::file-selector-button{
  min-height:42px;margin-right:.85rem;padding:.65rem 1rem;border:1px solid var(--ji-ui-blue)!important;border-radius:var(--ji-ui-radius-pill)!important;
  background:var(--ji-ui-blue)!important;color:#fff!important;font-weight:700!important;cursor:pointer;
}
body.ji-theme :is(.ji-file-card,.ji-file-preview,.ji-file-preview--certificate){
  border:1px solid var(--ji-ui-border)!important;border-radius:var(--ji-ui-radius-md)!important;background:var(--ji-ui-surface)!important;box-shadow:none!important;
}
body.ji-theme :is(.ji-file-card img,.ji-file-preview img){border-radius:var(--ji-ui-radius-sm)!important}

/* Unified action geometry. Colour continues to communicate semantic role. */
body.ji-theme :is(.ji-btn,.ji-button,.ji-citizen-btn,.ji-p5-btn,.ji-p53__btn,.ji-cert-action,.ji-clean-call,.ji-card__action,.ji-archive-card__action,.ji-person-card__action,.ji-short-card__action,.ji-report-map__geo-button,.ji-gis__address-cta,.ji-file-preview__change,.ji-file-preview__remove,.ji-clean-hero__button,.ji-404-button,.ji-events-showcase__all){
  display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:var(--ji-ui-button-height);
  padding:.68rem 1.05rem;border-radius:var(--ji-ui-radius-pill)!important;font-family:var(--ji-ui-font);font-weight:700!important;line-height:1.15;text-decoration:none;cursor:pointer;
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}
body.ji-theme :is(.ji-btn,.ji-button,.ji-citizen-btn,.ji-p5-btn,.ji-p53__btn,.ji-cert-action,.ji-clean-call,.ji-card__action,.ji-archive-card__action,.ji-person-card__action,.ji-short-card__action,.ji-report-map__geo-button,.ji-gis__address-cta,.ji-file-preview__change,.ji-file-preview__remove,.ji-clean-hero__button,.ji-404-button,.ji-events-showcase__all):focus-visible{
  outline:3px solid rgba(36,87,230,.28)!important;outline-offset:2px!important;
}
body.ji-theme :is(.ji-btn,.ji-button,.ji-citizen-btn,.ji-p5-btn,.ji-p53__btn,.ji-cert-action,.ji-clean-call,.ji-card__action,.ji-archive-card__action,.ji-person-card__action,.ji-short-card__action,.ji-report-map__geo-button,.ji-gis__address-cta,.ji-clean-hero__button,.ji-404-button,.ji-events-showcase__all)[disabled],
body.ji-theme :is(.ji-btn,.ji-button,.ji-citizen-btn,.ji-p5-btn,.ji-p53__btn,.ji-cert-action,.ji-clean-call,.ji-card__action,.ji-archive-card__action,.ji-person-card__action,.ji-short-card__action,.ji-report-map__geo-button,.ji-gis__address-cta,.ji-clean-hero__button,.ji-404-button,.ji-events-showcase__all)[aria-disabled="true"]{
  opacity:.5;cursor:not-allowed;transform:none!important;box-shadow:none!important;
}
/* Primary utility actions */
body.ji-theme :is(.ji-button--primary,.ji-citizen-btn:not(.secondary),.ji-p5-btn,.ji-p53__btn,.ji-report-map__geo-button,.ji-gis__address-cta){
  border:1px solid var(--ji-ui-blue)!important;background:var(--ji-ui-blue)!important;color:#fff!important;
}
body.ji-theme :is(.ji-button--primary,.ji-citizen-btn:not(.secondary),.ji-p5-btn,.ji-p53__btn,.ji-report-map__geo-button,.ji-gis__address-cta):hover{
  border-color:var(--ji-ui-blue-dark)!important;background:var(--ji-ui-blue-dark)!important;color:#fff!important;
}
/* Secondary / outline actions */
body.ji-theme :is(.ji-btn--outline,.ji-button--outline,.ji-button--secondary,.ji-citizen-btn.secondary,.ji-cert-action--secondary){
  border:1px solid #adc0e8!important;background:#fff!important;color:var(--ji-ui-navy)!important;box-shadow:none!important;
}
body.ji-theme :is(.ji-btn--outline,.ji-button--outline,.ji-button--secondary,.ji-citizen-btn.secondary,.ji-cert-action--secondary):hover{
  border-color:var(--ji-ui-blue)!important;background:#f2f6ff!important;color:var(--ji-ui-blue)!important;
}
/* Final submissions retain the institutional red emphasis. */
body.ji-theme .ji-jjvv-form button[type="submit"],
body.ji-theme .ji-cert-action--primary{
  min-height:var(--ji-ui-button-height);padding:.72rem 1.2rem;border:1px solid var(--ji-ui-red)!important;border-radius:var(--ji-ui-radius-pill)!important;
  background:var(--ji-ui-red)!important;color:#fff!important;font-weight:700!important;text-transform:none!important;
}
body.ji-theme .ji-jjvv-form button[type="submit"]:hover,
body.ji-theme .ji-cert-action--primary:hover{background:var(--ji-ui-red-dark)!important;border-color:var(--ji-ui-red-dark)!important}
/* File actions */
body.ji-theme .ji-file-preview__change{border:1px solid #b9c9e5!important;background:#fff!important;color:var(--ji-ui-navy)!important}
body.ji-theme .ji-file-preview__remove{border:1px solid #efc3c9!important;background:#fff5f6!important;color:var(--ji-ui-danger)!important}

/* Surfaces and cards */
body.ji-theme :is(.ji-jjvv-form-wrap,.ji-form-review-card,.ji-status-timeline,.ji-reference-household-card,.ji-doc-category-card,.ji-detail-box,.ji-global-lightbox__dialog){
  border-color:var(--ji-ui-border)!important;border-radius:var(--ji-ui-radius-lg)!important;
}
body.ji-theme .ji-jjvv-form-wrap{box-shadow:var(--ji-ui-shadow-md)!important}
body.ji-theme :is(.ji-form-notice,.ji-jjvv-form__security,.ji-jjvv-form__privacy,.ji-jjvv-form__review,.ji-reference-modal-note){
  border-radius:var(--ji-ui-radius-md)!important;
}
body.ji-theme .ji-jjvv-form__privacy{border-left:4px solid var(--ji-ui-blue)!important}

/* Modal language */
body.ji-theme .ji-global-lightbox__dialog{background:var(--ji-ui-surface)!important;box-shadow:0 28px 80px rgba(7,28,58,.26)!important}
body.ji-theme .ji-global-lightbox__dialog>header{padding:18px 20px;border-bottom:1px solid #e7edf7;background:rgba(255,255,255,.98)}
body.ji-theme .ji-global-lightbox__close{
  width:42px;height:42px;border:1px solid #cdd8e9!important;border-radius:50%!important;background:#fff!important;color:var(--ji-ui-navy)!important;
}
body.ji-theme .ji-global-lightbox__body{padding:20px}
body.ji-theme .ji-disclosure-modal-trigger{
  border:1px solid var(--ji-ui-border)!important;border-radius:var(--ji-ui-radius-md)!important;background:#fff!important;color:var(--ji-ui-navy)!important;box-shadow:var(--ji-ui-shadow-sm)!important;
}

/* Chips / badges / status labels */
body.ji-theme :is(.ji-status-chip,.ji-badge,.ji-form-head__meta span,.ji-atencion-card__type){
  display:inline-flex;align-items:center;min-height:26px;padding:.25rem .62rem;border-radius:var(--ji-ui-radius-pill)!important;
  font-size:.74rem;font-weight:700!important;line-height:1.15;
}

/* Step navigation and segmented controls */
body.ji-theme :is(.ji-cert-steps__nav li,.ji-general-steps__nav li){border-radius:var(--ji-ui-radius-md)!important}
body.ji-theme :is(.ji-gis__view-switch,.ji-report-location-method__choices){border-radius:var(--ji-ui-radius-md)!important}
body.ji-theme .ji-gis__view-switch button{border-radius:var(--ji-ui-radius-sm)!important;font-weight:700!important}

/* Ensure intentionally card-like clickable elements do not inherit pill button geometry. */
body.ji-theme :is(.ji-patrimonio-item-card__button,.ji-atencion__categories button,.ji-disclosure-modal-trigger){min-height:unset}

@media(max-width:720px){
  :root{--ji-ui-control-height:48px;--ji-ui-button-height:46px}
  body.ji-theme .ji-jjvv-form-wrap{border-radius:var(--ji-ui-radius-lg)!important}
  body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form)
  :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),select,textarea){font-size:16px}
}

@media(prefers-reduced-motion:reduce){
  body.ji-theme :is(.ji-btn,.ji-button,.ji-citizen-btn,.ji-p5-btn,.ji-p53__btn,.ji-cert-action,.ji-report-map__geo-button,.ji-gis__address-cta){transition:none!important}
}

/* ==========================================================
 * 19.69.0 — Consolidación UX: contrato visual de formularios
 * ========================================================== */
:root{
  --ji-ui-control-height-mobile:54px;
  --ji-ui-field-gap:.48rem;
  --ji-ui-select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.25 7 7.25l6-6' fill='none' stroke='%230d214a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Identity widgets are reused outside .ji-jjvv-form; include them in the same visual contract. */
body.ji-theme :is(.ji-lookup-identity,.ji-neighbor-portal,.ji-citizen-folder,.ji-monthly-public__filters)
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),select,textarea){
  width:100%;min-width:0;min-height:var(--ji-ui-control-height);box-sizing:border-box;
  padding:.78rem .95rem;border:1px solid var(--ji-ui-border-strong)!important;border-radius:var(--ji-ui-radius-md)!important;
  background-color:var(--ji-ui-surface-soft)!important;color:var(--ji-ui-ink)!important;
  box-shadow:none!important;font-family:var(--ji-ui-font);font-size:1rem;line-height:1.45;
  transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease;
}
body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form,.ji-cert-query-form,.ji-address-checker--embedded,.ji-gis__address-lookup,.ji-lookup-identity,.ji-neighbor-portal,.ji-citizen-folder,.ji-monthly-public__filters) select{
  -webkit-appearance:none!important;appearance:none!important;
  padding-right:2.8rem!important;background-image:var(--ji-ui-select-chevron)!important;
  background-repeat:no-repeat!important;background-position:right .95rem center!important;background-size:14px 9px!important;
}
body.ji-theme :is(.ji-lookup-identity,.ji-neighbor-portal,.ji-citizen-folder,.ji-monthly-public__filters)
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),select,textarea):focus{
  outline:0!important;border-color:var(--ji-ui-blue)!important;background-color:#fff!important;box-shadow:var(--ji-ui-focus)!important;
}
body.ji-theme .ji-jjvv-form__field{min-width:0}
body.ji-theme .ji-jjvv-form__field>label{display:block;min-width:0}
body.ji-theme :is(.ji-jjvv-form__field,.ji-lookup-identity) small{color:var(--ji-ui-copy);line-height:1.45}

/* Shared semantic notices: geometry and hierarchy, without replacing each module's semantic colour. */
body.ji-theme :is(.ji-form-notice,.ji-notice,.ji-alert,.ji-jjvv-form__notice,[role="alert"]){
  border-radius:var(--ji-ui-radius-md);line-height:1.5;
}
body.ji-theme :is(.ji-form-notice,.ji-notice,.ji-alert,[role="alert"]) strong:first-child{font-weight:800}

/* Stable modal behaviour and keyboard focus. */
body.ji-theme :is(.ji-global-lightbox__dialog,.ji-transparency-modal__dialog,[role="dialog"]){max-width:calc(100vw - 24px)}
body.ji-theme :is(button,a,input,select,textarea,[tabindex]):focus-visible{
  outline:3px solid rgba(36,87,230,.30);outline-offset:2px;
}

@media(max-width:720px){
  body.ji-theme :is(.ji-jjvv-form,.ji-reference-household-form,.ji-tracking-form,.ji-reviews-form,.ji-cert-query-form,.ji-address-checker--embedded,.ji-gis__address-lookup,.ji-lookup-identity,.ji-neighbor-portal,.ji-citizen-folder,.ji-monthly-public__filters)
  :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),select,textarea){
    min-height:var(--ji-ui-control-height-mobile);font-size:16px!important;
  }
  body.ji-theme :is(.ji-jjvv-form,.ji-lookup-identity,.ji-neighbor-portal) select{background-position:right 1rem center!important}
}


/* 19.69.1 — modal accessibility and mobile containment */
html.ji-modal-open,html.ji-pdf-modal-open{overscroll-behavior:none}
body.ji-theme :is(.ji-global-lightbox__dialog,.ji-pdf-modal__dialog,[role="dialog"]){outline:0}
body.ji-theme :is(.ji-global-lightbox__dialog,.ji-pdf-modal__dialog) iframe{max-width:100%;border:0}
@media(max-width:720px){
  body.ji-theme .ji-pdf-modal__dialog{max-height:calc(100dvh - 16px)!important}
  body.ji-theme .ji-global-lightbox__dialog{max-height:calc(100dvh - 16px)!important;overflow:auto}
}
