/*
 * Instituto ACR — Validación pública de documentos
 * UI/UX premium HVAC/R · responsive · claro/oscuro
 * Paleta base: #0F4672 · blanco · negro · dorado
 */

:root {
    --acr-blue: #0f4672;
    --acr-blue-800: #0a3557;
    --acr-blue-900: #06253e;
    --acr-cyan: #00b8d9;
    --acr-cyan-soft: #66d9ec;
    --acr-gold: #d4af37;
    --acr-gold-bright: #ffd75a;
    --acr-white: #ffffff;
    --acr-black: #0c141b;
    --acr-green: #16845a;
    --acr-red: #b42318;
    --acr-violet: #7559b8;

    --page-bg: #ffffff;
    --page-bg-alt: #edf6fb;
    --surface: rgba(255, 255, 255, .96);
    --surface-strong: #ffffff;
    --surface-soft: rgba(15, 70, 114, .055);
    --surface-hover: rgba(15, 70, 114, .085);
    --text: #111820;
    --text-strong: #0f4672;
    --text-soft: #526879;
    --border: rgba(15, 70, 114, .15);
    --border-strong: rgba(15, 70, 114, .28);
    --header-bg: rgba(255, 255, 255, .91);
    --shadow-card: 0 28px 78px rgba(15, 70, 114, .16);
    --shadow-soft: 0 14px 34px rgba(15, 70, 114, .10);
    --focus: rgba(0, 184, 217, .32);
    --success: #16845a;
    --danger: #b42318;
}

html[data-theme="dark"] {
    --page-bg: #0f4672;
    --page-bg-alt: #02070b;
    --surface: rgba(6, 22, 35, .93);
    --surface-strong: #091f31;
    --surface-soft: rgba(255, 255, 255, .055);
    --surface-hover: rgba(255, 215, 90, .075);
    --text: #ffffff;
    --text-strong: #ffd75a;
    --text-soft: #c4d2dc;
    --border: rgba(255, 255, 255, .12);
    --border-strong: rgba(255, 215, 90, .30);
    --header-bg: rgba(3, 14, 23, .91);
    --shadow-card: 0 34px 90px rgba(0, 0, 0, .46);
    --shadow-soft: 0 16px 38px rgba(0, 0, 0, .28);
    --focus: rgba(255, 215, 90, .30);
    --success: #67e1a4;
    --danger: #ff968e;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --page-bg: #0f4672;
        --page-bg-alt: #02070b;
        --surface: rgba(6, 22, 35, .93);
        --surface-strong: #091f31;
        --surface-soft: rgba(255, 255, 255, .055);
        --surface-hover: rgba(255, 215, 90, .075);
        --text: #ffffff;
        --text-strong: #ffd75a;
        --text-soft: #c4d2dc;
        --border: rgba(255, 255, 255, .12);
        --border-strong: rgba(255, 215, 90, .30);
        --header-bg: rgba(3, 14, 23, .91);
        --shadow-card: 0 34px 90px rgba(0, 0, 0, .46);
        --shadow-soft: 0 16px 38px rgba(0, 0, 0, .28);
        --focus: rgba(255, 215, 90, .30);
        --success: #67e1a4;
        --danger: #ff968e;
    }
}

* { box-sizing: border-box; }

html {
    min-width: 280px;
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.acr-validation-page {
    min-height: 100dvh;
    margin: 0;
    overflow-x: clip;
    color: var(--text);
    font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 6% 0%, rgba(15, 70, 114, .18), transparent min(36rem, 48vw)),
        radial-gradient(circle at 92% 22%, rgba(0, 184, 217, .10), transparent min(28rem, 40vw)),
        linear-gradient(145deg, #ffffff 0%, #ffffff 54%, #eef7fc 78%, #dcecf6 100%);
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

html[data-theme="dark"] body.acr-validation-page {
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 215, 90, .10), transparent min(32rem, 44vw)),
        radial-gradient(circle at 90% 18%, rgba(0, 184, 217, .10), transparent min(30rem, 40vw)),
        linear-gradient(145deg, #0f4672 0%, #0a3557 38%, #061b2c 64%, #02070b 100%);
}

body.acr-validation-page::before,
body.acr-validation-page::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -1;
}

body.acr-validation-page::before {
    inset: 0;
    opacity: .46;
    background-image:
        linear-gradient(rgba(15, 70, 114, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 70, 114, .04) 1px, transparent 1px);
    background-size: clamp(30px, 4vw, 48px) clamp(30px, 4vw, 48px);
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.55) 48%, transparent 92%);
}

html[data-theme="dark"] body.acr-validation-page::before {
    opacity: .22;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
}

body.acr-validation-page::after {
    width: min(44vw, 620px);
    aspect-ratio: 1;
    right: -18vw;
    bottom: -28vw;
    border: clamp(50px, 7vw, 100px) solid rgba(15, 70, 114, .045);
    border-radius: 50%;
}

html[data-theme="dark"] body.acr-validation-page::after {
    border-color: rgba(255, 215, 90, .035);
}

a, button, input, summary { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }

/* Header */
.acr-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    border-top: 4px solid rgba(255, 255, 255, .28);
    border-bottom: 1px solid rgba(255, 255, 255, .11);
    background: rgba(5, 18, 36, .97);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}

.acr-topbar__inner {
    width: min(1240px, calc(100% - clamp(24px, 5vw, 64px)));
    min-height: clamp(72px, 7vw, 82px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(285px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(16px, 3vw, 34px);
}

.acr-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
}

.acr-brand__mark {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.acr-brand__mark img,
.brand-fallback {
    width: 54px;
    height: 54px;
    border-radius: 50%;
}

.acr-brand__mark img {
    display: block;
    max-width: none;
    padding: 0;
    object-fit: contain;
    background: transparent;
    box-shadow: none;
}

.brand-fallback {
    color: #ffffff;
    background: linear-gradient(145deg, var(--acr-blue), var(--acr-blue-900));
    border: 2px solid var(--acr-gold);
    place-items: center;
    font: 800 .76rem/1 "Work Sans", sans-serif;
}

.brand-fallback:not([hidden]) { display: grid; }

.acr-brand__copy {
    min-width: 0;
    display: grid;
    justify-items: start;
    gap: 1px;
    line-height: 1;
}

.acr-brand__title {
    margin: 0;
    color: #ffffff;
    font: 800 1.08rem/1.05 "Work Sans", sans-serif;
    letter-spacing: -.015em;
    white-space: nowrap;
}

.acr-brand__subtitle {
    margin-top: 1px;
    color: var(--acr-gold-bright);
    font-size: .71rem;
    font-weight: 750;
    line-height: 1.12;
    white-space: nowrap;
}

.acr-brand__badge {
    min-height: 18px;
    margin-top: 3px;
    padding: 2px 8px 1px;
    border: 1px solid var(--acr-gold-bright);
    border-radius: 7px;
    color: var(--acr-gold-bright);
    background: rgba(255, 215, 90, .04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 800 .58rem/1 "Work Sans", sans-serif;
    letter-spacing: .03em;
}

.acr-nav {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.acr-nav a {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 750;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.acr-nav a:hover {
    color: var(--text);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.acr-nav a[aria-current="page"] {
    color: var(--text-strong);
    border-color: var(--border);
    background: var(--surface-soft);
    box-shadow: inset 0 -2px var(--acr-gold-bright);
}

.acr-nav__icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}


/* El encabezado institucional permanece oscuro en ambos temas. */
.acr-topbar .acr-nav a { color: #c7d5e0; }
.acr-topbar .acr-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .07);
}
.acr-topbar .acr-nav a[aria-current="page"] {
    color: var(--acr-gold-bright);
    border-color: rgba(255, 215, 90, .24);
    background: rgba(255, 215, 90, .07);
    box-shadow: inset 0 -2px var(--acr-gold-bright);
}
.acr-topbar .language-menu summary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .055);
    box-shadow: none;
}
.acr-topbar .language-menu summary:hover {
    border-color: rgba(255, 215, 90, .26);
    background: rgba(255, 255, 255, .085);
}
.acr-topbar .language-menu__icon { color: var(--acr-gold-bright); }

.acr-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.language-menu { position: relative; }

.language-menu summary {
    min-width: 166px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    cursor: pointer;
    font-size: .86rem;
    font-weight: 750;
    user-select: none;
}

.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary span { flex: 1; text-align: left; }
.language-menu__icon { width: 20px; height: 20px; color: var(--acr-cyan); }
.language-menu .chevron { width: 16px; height: 16px; transition: transform .18s ease; }
.language-menu[open] .chevron { transform: rotate(180deg); }

.language-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    width: max(100%, 192px);
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface-strong);
    box-shadow: 0 20px 52px rgba(4, 26, 43, .24);
}

.language-panel a {
    min-height: 42px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    font-size: .84rem;
    font-weight: 700;
}

.language-panel a:hover,
.language-panel a[aria-current="true"] {
    color: var(--text);
    background: var(--surface-hover);
}

.language-panel b {
    width: 28px;
    color: var(--text-strong);
    font-size: .7rem;
    letter-spacing: .06em;
}

/* Main card */
.acr-main {
    width: min(1120px, calc(100% - clamp(24px, 6vw, 72px)));
    flex: 1;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 72px) 0 clamp(38px, 6vw, 84px);
    display: grid;
    align-items: center;
}

.acr-card {
    width: 100%;
    overflow: clip;
    border: 1px solid var(--border);
    border-radius: clamp(22px, 3vw, 32px);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

@supports (backdrop-filter: blur(10px)) {
    .acr-card {
        -webkit-backdrop-filter: blur(20px) saturate(120%);
        backdrop-filter: blur(20px) saturate(120%);
    }
}

.acr-card__accent {
    height: 5px;
    background: linear-gradient(90deg, var(--acr-blue) 0%, var(--acr-cyan) 48%, var(--acr-gold-bright) 100%);
}

html[data-theme="dark"] .acr-card__accent {
    background: linear-gradient(90deg, var(--acr-gold) 0%, var(--acr-cyan) 50%, #fff 100%);
}

.acr-card__body { padding: clamp(22px, 4.5vw, 54px); }

.acr-status {
    margin: 0 auto clamp(28px, 4vw, 42px);
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 13px;
}

.acr-status__seal {
    width: clamp(78px, 9vw, 102px);
    height: clamp(78px, 9vw, 102px);
    position: relative;
    border: 1px solid currentColor;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.acr-status__seal::after {
    content: "";
    position: absolute;
    inset: -10px;
    border: 1px solid currentColor;
    border-radius: inherit;
    opacity: .12;
}

.acr-status__seal.is-valid {
    color: var(--success);
    background: rgba(22, 132, 90, .10);
    box-shadow: 0 16px 44px rgba(22, 132, 90, .16);
}

.acr-status__seal.is-invalid {
    color: var(--danger);
    background: rgba(180, 35, 24, .09);
    box-shadow: 0 16px 44px rgba(180, 35, 24, .12);
}

.acr-status__seal.is-neutral {
    color: var(--acr-blue);
    background: rgba(15, 70, 114, .08);
    box-shadow: 0 16px 44px rgba(15, 70, 114, .12);
}

html[data-theme="dark"] .acr-status__seal.is-neutral {
    color: var(--acr-gold-bright);
    background: rgba(255, 215, 90, .08);
}

.acr-status__seal-icon {
    width: 46%;
    height: 46%;
    stroke-width: 2.25;
}

.acr-status__copy { display: grid; justify-items: center; gap: 7px; }

.acr-eyebrow {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(.66rem, 1vw, .76rem);
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.acr-status h1 {
    max-width: 880px;
    margin: 0;
    color: var(--text-strong);
    font: 800 clamp(2rem, 5vw, 3.7rem)/1.02 "Work Sans", sans-serif;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.acr-status__secure {
    margin: 2px 0 0;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: .78rem;
    font-weight: 700;
}

.acr-status__mini-icon { width: 15px; height: 15px; color: var(--acr-cyan); }
.acr-search-copy { max-width: 620px; margin: 2px 0 0; color: var(--text-soft); font-size: clamp(.9rem, 1.5vw, 1rem); line-height: 1.7; }

/* Search form */
.acr-validation-form {
    width: min(720px, 100%);
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.acr-field { min-width: 0; text-align: left; }
.acr-field label { display: block; margin: 0 0 8px; color: var(--text-soft); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.acr-field__control { position: relative; min-width: 0; }
.acr-field__icon { position: absolute; left: 15px; top: 50%; width: 20px; height: 20px; color: var(--acr-cyan); transform: translateY(-50%); pointer-events: none; }

.acr-field input {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 0 16px 0 46px;
    color: var(--text);
    background: var(--surface-strong);
    font-size: clamp(.9rem, 2vw, 1rem);
    font-weight: 750;
    letter-spacing: .02em;
    text-transform: uppercase;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.acr-field input::placeholder { color: color-mix(in srgb, var(--text-soft) 72%, transparent); text-transform: none; font-weight: 600; }
.acr-field input:focus { border-color: var(--acr-cyan); box-shadow: 0 0 0 4px var(--focus); }

/* Buttons */
.acr-primary-button,
.acr-secondary-button {
    min-height: 54px;
    max-width: 100%;
    border-radius: 15px;
    padding: 0 clamp(18px, 2.4vw, 26px);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none;
    white-space: normal;
    text-align: center;
    font-size: .9rem;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.acr-primary-button {
    color: #fff;
    background: linear-gradient(135deg, #0f4672 0%, #0a3557 100%);
    box-shadow: 0 14px 30px rgba(15, 70, 114, .23);
}

html[data-theme="dark"] .acr-primary-button {
    color: #09131b;
    background: linear-gradient(135deg, #ffe070 0%, #d4af37 100%);
    box-shadow: 0 14px 30px rgba(212, 175, 55, .16);
}

.acr-secondary-button { color: var(--text); border-color: var(--border); background: var(--surface-soft); }
.acr-primary-button:hover, .acr-secondary-button:hover { transform: translateY(-2px); }
.acr-secondary-button:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.acr-primary-button svg, .acr-secondary-button svg { width: 20px; height: 20px; flex: 0 0 auto; }


/* Interactive document / validation flip card */
.acr-status__folio {
    margin: 2px 0 0;
    color: var(--text-soft);
    font-size: .76rem;
    font-weight: 650;
}

.acr-status__folio strong {
    margin-left: 5px;
    color: var(--text-strong);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .02em;
}

.acr-flip-shell {
    width: min(100%, 1020px);
    margin: 0 auto;
    perspective: 1800px;
    perspective-origin: 50% 42%;
}

.acr-flip-card {
    width: 100%;
    position: relative;
}

.acr-flip-card__inner {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform, height;
    transition: transform .72s cubic-bezier(.2,.72,.18,1), height .28s ease;
}

.acr-flip-card.is-flipped .acr-flip-card__inner {
    transform: rotateY(180deg);
}

.acr-flip-face {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: clamp(20px, 2.7vw, 28px);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 94%, transparent), var(--surface));
    box-shadow: var(--shadow-soft);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    overflow: hidden;
}

.acr-flip-face--front {
    position: relative;
}

.acr-flip-face--back {
    position: absolute;
    inset: 0 0 auto 0;
    transform: rotateY(180deg);
    padding: clamp(20px, 3.6vw, 38px);
}

html[data-theme="dark"] .acr-flip-face {
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 184, 217, .055), transparent 34%),
        linear-gradient(145deg, rgba(7, 29, 46, .98), rgba(3, 16, 27, .97));
}

.acr-document-front {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr);
}

.acr-document-preview {
    min-width: 0;
    padding: clamp(16px, 2.6vw, 28px);
    border-right: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(15, 70, 114, .045), transparent 42%),
        var(--surface-soft);
}

html[data-theme="dark"] .acr-document-preview {
    background:
        linear-gradient(135deg, rgba(0, 184, 217, .055), transparent 42%),
        rgba(255,255,255,.025);
}

.acr-document-preview__topline {
    margin-bottom: 14px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.acr-document-preview__topline > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.acr-document-preview__topline h2 {
    margin: 0;
    color: var(--text);
    font: 800 clamp(1.08rem, 2vw, 1.45rem)/1.1 "Work Sans", sans-serif;
    letter-spacing: -.02em;
}

.acr-preview-open {
    min-height: 40px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-soft);
    background: var(--surface-strong);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    font-size: .74rem;
    font-weight: 800;
}

.acr-preview-open:hover { color: var(--text-strong); border-color: var(--border-strong); }
.acr-preview-open svg { width: 16px; height: 16px; }

.acr-document-preview__stage {
    width: min(100%, 570px);
    margin: 0 auto;
    aspect-ratio: 8.5 / 11;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 70, 114, .18);
    border-radius: clamp(12px, 1.8vw, 18px);
    background: #fff;
    box-shadow: 0 24px 54px rgba(7, 42, 70, .18);
}

html[data-theme="dark"] .acr-document-preview__stage {
    border-color: rgba(255, 215, 90, .22);
    box-shadow: 0 26px 60px rgba(0,0,0,.38);
}

.acr-document-preview__stage::before,
.acr-document-preview__stage::after {
    content: "";
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.acr-document-preview__stage::before {
    width: 26%;
    aspect-ratio: 1;
    top: -14%;
    right: -10%;
    border-radius: 0 0 0 42%;
    background: linear-gradient(145deg, rgba(0,184,217,.92), rgba(15,70,114,.92));
    opacity: .11;
}

.acr-document-preview__stage::after {
    width: 28%;
    aspect-ratio: 1;
    left: -12%;
    bottom: -16%;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(145deg, rgba(15,70,114,.9), rgba(0,184,217,.9));
    opacity: .08;
}

.acr-document-preview__frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
    pointer-events: none;
}

.acr-document-preview__stage.is-empty {
    display: grid;
    place-items: center;
    background:
        linear-gradient(145deg, #ffffff, #eef6fb);
}

html[data-theme="dark"] .acr-document-preview__stage.is-empty {
    background: linear-gradient(145deg, #0b2438, #06131f);
}

.acr-document-preview__placeholder {
    max-width: 440px;
    padding: 30px;
    position: relative;
    z-index: 3;
    color: var(--text-soft);
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 10px;
}

.acr-document-preview__placeholder-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    color: var(--text-strong);
    background: var(--surface-soft);
    display: grid;
    place-items: center;
}

.acr-document-preview__placeholder-icon svg { width: 34px; height: 34px; }
.acr-document-preview__placeholder strong { color: var(--text); font: 800 1.2rem/1.2 "Work Sans", sans-serif; }
.acr-document-preview__placeholder p { margin: 0; font-size: .86rem; line-height: 1.6; }

.acr-document-summary {
    min-width: 0;
    padding: clamp(22px, 3.6vw, 38px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(18px, 2.6vw, 28px);
    position: relative;
    overflow: hidden;
}

.acr-document-summary::after {
    content: "";
    position: absolute;
    width: 220px;
    aspect-ratio: 1;
    right: -120px;
    bottom: -120px;
    border: 34px solid rgba(15, 70, 114, .045);
    border-radius: 50%;
    pointer-events: none;
}

html[data-theme="dark"] .acr-document-summary::after { border-color: rgba(255, 215, 90, .035); }

.acr-summary-status {
    width: fit-content;
    max-width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid currentColor;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .74rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.acr-summary-status svg { width: 17px; height: 17px; }
.acr-summary-status.is-valid { color: var(--success); background: color-mix(in srgb, var(--success) 9%, transparent); }
.acr-summary-status.is-invalid { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }

.acr-summary-copy { min-width: 0; display: grid; gap: 9px; }
.acr-summary-copy h3 {
    margin: 0;
    color: var(--text);
    font: 800 clamp(1.45rem, 2.8vw, 2.2rem)/1.08 "Work Sans", sans-serif;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}
.acr-summary-copy > p:last-child { margin: 0; color: var(--text-soft); font-size: .9rem; line-height: 1.58; }

.acr-summary-folio {
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface-soft);
    display: grid;
    gap: 5px;
}
.acr-summary-folio span { color: var(--text-soft); font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.acr-summary-folio strong { color: var(--text-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(.84rem, 1.4vw, .98rem); overflow-wrap: anywhere; }

.acr-summary-hint { margin: 0; color: var(--text-soft); font-size: .8rem; line-height: 1.6; }

.acr-flip-button {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--acr-blue), var(--acr-blue-800));
    box-shadow: 0 15px 34px rgba(15,70,114,.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: 800 .88rem/1.2 "Manrope", sans-serif;
    cursor: pointer;
}

html[data-theme="dark"] .acr-flip-button {
    color: #0a1720;
    background: linear-gradient(135deg, var(--acr-gold-bright), var(--acr-gold));
    box-shadow: 0 15px 34px rgba(212,175,55,.16);
}

.acr-flip-button:hover { transform: translateY(-2px); }
.acr-flip-button svg { width: 21px; height: 21px; }
.acr-flip-button.is-secondary { width: auto; min-width: min(100%, 230px); color: var(--text); border-color: var(--border); background: var(--surface-soft); box-shadow: none; }
html[data-theme="dark"] .acr-flip-button.is-secondary { color: var(--text); background: var(--surface-soft); }

.acr-flip-hint { margin: -14px 0 0; color: var(--text-soft); text-align: center; font-size: .69rem; line-height: 1.45; }

.acr-back-header {
    margin: 0 0 18px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}
.acr-back-header > div { display: grid; gap: 5px; }
.acr-back-header h2 { margin: 0; color: var(--text); font: 800 clamp(1.4rem, 2.8vw, 2rem)/1.1 "Work Sans", sans-serif; letter-spacing: -.025em; }
.acr-back-header > p { max-width: 430px; margin: 0; color: var(--text-soft); text-align: right; font-size: .82rem; line-height: 1.55; }

.acr-back-flip-action {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}


/* Details heading */
.acr-details-heading {
    margin: 0 0 18px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.acr-details-heading > div { display: grid; gap: 5px; }
.acr-details-heading h2 { margin: 0; color: var(--text); font: 800 clamp(1.35rem, 2.8vw, 2rem)/1.1 "Work Sans", sans-serif; letter-spacing: -.025em; }
.acr-details-heading > p { max-width: 430px; margin: 0; color: var(--text-soft); text-align: right; font-size: .82rem; line-height: 1.55; }

/* Document data */
.acr-data-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(10px, 1.5vw, 15px);
}

.acr-data-item {
    min-width: 0;
    grid-column: span 4;
    min-height: 118px;
    padding: clamp(16px, 2vw, 20px);
    border: 1px solid var(--border);
    border-radius: 19px;
    background: var(--surface-soft);
    position: relative;
    overflow: hidden;
}

.acr-data-item::after {
    content: "";
    position: absolute;
    inset: auto -28px -28px auto;
    width: 74px;
    height: 74px;
    border: 14px solid currentColor;
    border-radius: 50%;
    opacity: .035;
    pointer-events: none;
}

.acr-data-item.is-wide { grid-column: span 8; }
.acr-data-item[data-tone="blue"] { --tone: #0f4672; }
.acr-data-item[data-tone="cyan"] { --tone: #009dbc; }
.acr-data-item[data-tone="gold"] { --tone: #a88412; }
.acr-data-item[data-tone="green"] { --tone: #16845a; }
.acr-data-item[data-tone="red"] { --tone: #b42318; }
.acr-data-item[data-tone="violet"] { --tone: #7559b8; }

html[data-theme="dark"] .acr-data-item[data-tone="blue"] { --tone: #8dcfff; }
html[data-theme="dark"] .acr-data-item[data-tone="cyan"] { --tone: #63e1f4; }
html[data-theme="dark"] .acr-data-item[data-tone="gold"] { --tone: #ffd75a; }
html[data-theme="dark"] .acr-data-item[data-tone="green"] { --tone: #67e1a4; }
html[data-theme="dark"] .acr-data-item[data-tone="red"] { --tone: #ff968e; }
html[data-theme="dark"] .acr-data-item[data-tone="violet"] { --tone: #d3bdff; }

.acr-data-item dt {
    margin: 0 0 11px;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.acr-data-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 9px;
    color: var(--tone);
    background: color-mix(in srgb, var(--tone) 10%, transparent);
    display: grid;
    place-items: center;
}

.acr-data-icon svg { width: 16px; height: 16px; }

.acr-data-item dd {
    margin: 0;
    color: var(--text);
    font-size: clamp(.94rem, 1.6vw, 1.12rem);
    line-height: 1.48;
    font-weight: 730;
    overflow-wrap: anywhere;
    word-break: normal;
}

.acr-data-item.is-folio dd { color: var(--text-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(.88rem, 1.4vw, 1.02rem); }

.acr-state {
    color: var(--success);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: .82rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.acr-state.is-invalid { color: var(--danger); }
.acr-state::before { content: ""; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 13%, transparent); }

.acr-verified-note {
    margin: 20px 0 0;
    padding: 13px 15px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    color: var(--text-soft);
    background: var(--surface-soft);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .79rem;
    line-height: 1.55;
}

.acr-verified-note__icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--acr-cyan); margin-top: 1px; }

.acr-actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.acr-note { width: 100%; margin: 7px 0 0; color: var(--text-soft); text-align: center; font-size: .82rem; }

/* Footer */
.acr-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    background: color-mix(in srgb, var(--page-bg) 86%, transparent);
}

.acr-footer__inner {
    width: min(1240px, calc(100% - clamp(24px, 5vw, 64px)));
    min-height: 88px;
    margin: 0 auto;
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.acr-footer p { margin: 0; max-width: 720px; font-size: .78rem; line-height: 1.55; }
.acr-footer__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; }
.acr-footer a { min-height: 38px; color: var(--text-soft); display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-size: .78rem; font-weight: 750; }
.acr-footer a:hover { color: var(--text-strong); }
.acr-footer__icon { width: 16px; height: 16px; color: var(--acr-cyan); }

/* Toast */
.acr-toast {
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 100;
    max-width: min(92vw, 420px);
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: 0 18px 54px rgba(0,0,0,.22);
    font-size: .82rem;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 14px);
    transition: opacity .18s ease, transform .18s ease;
}

.acr-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Laptop / small desktop */
@media (max-width: 1100px) {
    .acr-topbar__inner { width: min(100% - 34px, 1240px); }
    .acr-main { width: min(100% - 34px, 1120px); }
    .acr-footer__inner { width: min(100% - 34px, 1240px); }
}

/* Tablet landscape / compact laptops */
@media (max-width: 900px) {
    .acr-topbar__inner {
        grid-template-columns: minmax(270px, auto) minmax(0, 1fr) auto;
        gap: 12px;
    }
    .acr-nav a { padding-inline: 10px; }
    .language-menu summary { min-width: 52px; width: 52px; padding: 0 14px; }
    .language-menu summary > span, .language-menu .chevron { display: none; }
    .language-panel { min-width: 190px; }
    .acr-data-item, .acr-data-item.is-wide { grid-column: span 6; }
    .acr-details-heading { align-items: flex-start; }
}

/* Tablet portrait and large phones */
@media (max-width: 720px) {
    .acr-topbar__inner {
        width: min(100% - 24px, 1240px);
        min-height: auto;
        padding: 10px 0 8px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
    }
    .acr-nav {
        grid-column: 1 / -1;
        width: 100%;
        padding-top: 7px;
        border-top: 1px solid var(--border);
    }
    .acr-nav a { flex: 1 1 0; min-width: 0; }
    .acr-controls { grid-column: 2; grid-row: 1; }
    .acr-brand { min-width: 0; }
    .acr-brand__copy { overflow: visible; }
    .acr-main { width: min(100% - 24px, 1120px); padding: 24px 0 42px; }
    .acr-card__body { padding-inline: clamp(18px, 5vw, 32px); }
    .acr-validation-form { grid-template-columns: 1fr; align-items: stretch; }
    .acr-validation-form .acr-primary-button { width: 100%; }
    .acr-details-heading { display: grid; gap: 8px; }
    .acr-details-heading > p { max-width: none; text-align: left; }
    .acr-footer__inner { width: min(100% - 24px, 1240px); flex-direction: column; text-align: center; gap: 12px; }
    .acr-footer__links { justify-content: center; }
}

/* Phones */
@media (max-width: 560px) {
    .acr-brand__mark, .acr-brand__mark img, .brand-fallback { width: 48px; height: 48px; }
    .acr-brand__mark { flex-basis: 48px; }
    .acr-brand { gap: 9px; }
    .acr-brand__title { font-size: .98rem; }
    .acr-brand__subtitle { font-size: .64rem; }
    .acr-brand__badge { min-height: 16px; margin-top: 2px; padding: 1px 7px; font-size: .54rem; }
    .acr-nav a { min-height: 40px; font-size: .8rem; }
    .acr-nav__icon { width: 17px; height: 17px; }
    .acr-main { width: min(100% - 18px, 1120px); padding-top: 16px; }
    .acr-card { border-radius: 20px; }
    .acr-card__body { padding: 22px 14px 24px; }
    .acr-status { margin-bottom: 26px; }
    .acr-status h1 { font-size: clamp(1.78rem, 9vw, 2.45rem); }
    .acr-status__secure { font-size: .72rem; }
    .acr-data-grid { grid-template-columns: 1fr; gap: 9px; }
    .acr-data-item, .acr-data-item.is-wide { grid-column: auto; min-height: 0; padding: 15px; border-radius: 16px; }
    .acr-data-item dt { margin-bottom: 8px; }
    .acr-actions { display: grid; grid-template-columns: 1fr; }
    .acr-actions .acr-primary-button, .acr-actions .acr-secondary-button { width: 100%; }
    .acr-footer__inner { width: min(100% - 20px, 1240px); }
}

/* Narrow phones / 320px class */
@media (max-width: 380px) {
    .acr-topbar__inner { width: min(100% - 16px, 1240px); }
    .acr-brand__title { font-size: .92rem; }
    .acr-brand__subtitle { font-size: .59rem; }
    .acr-brand__badge { font-size: .51rem; padding-inline: 6px; }
    .acr-nav a { padding-inline: 7px; gap: 5px; font-size: .74rem; }
    .acr-main { width: min(100% - 12px, 1120px); }
    .acr-card__body { padding-inline: 12px; }
    .acr-eyebrow { letter-spacing: .15em; }
    .acr-field input { padding-left: 42px; font-size: .86rem; }
    .acr-primary-button, .acr-secondary-button { padding-inline: 14px; font-size: .84rem; }
}

/* Very wide screens */
@media (min-width: 1500px) {
    .acr-main { width: min(1180px, calc(100% - 96px)); }
    .acr-card__body { padding: 58px 64px; }
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
    .acr-field input::placeholder { color: #7b8b97; }
    .acr-data-icon { background: rgba(15, 70, 114, .08); }
    html[data-theme="dark"] .acr-data-icon { background: rgba(255, 255, 255, .06); }
    .acr-state::before { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* Flip-card responsive tuning */
@media (max-width: 980px) {
    .acr-document-front { grid-template-columns: 1fr; }
    .acr-document-preview { border-right: 0; border-bottom: 1px solid var(--border); }
    .acr-document-preview__stage { width: min(100%, 540px); }
    .acr-document-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .acr-summary-status, .acr-summary-copy, .acr-summary-hint, .acr-flip-hint { grid-column: 1 / -1; }
    .acr-summary-folio { grid-column: 1 / 2; }
    .acr-flip-button { grid-column: 2 / 3; align-self: stretch; }
}

@media (max-width: 720px) {
    .acr-flip-card__inner { transition-duration: .58s, .22s; }
    .acr-document-summary { grid-template-columns: 1fr; }
    .acr-summary-folio, .acr-flip-button { grid-column: 1 / -1; }
    .acr-back-header { display: grid; gap: 7px; }
    .acr-back-header > p { max-width: none; text-align: left; }
    .acr-flip-face--back { padding: 20px 16px; }
}

@media (max-width: 560px) {
    .acr-document-preview { padding: 12px; }
    .acr-document-preview__topline { align-items: flex-start; }
    .acr-preview-open span { display: none; }
    .acr-preview-open { width: 40px; padding: 0; justify-content: center; }
    .acr-document-preview__stage { border-radius: 10px; box-shadow: 0 16px 38px rgba(7,42,70,.16); }
    .acr-document-summary { padding: 20px 16px 22px; gap: 17px; }
    .acr-summary-copy h3 { font-size: clamp(1.25rem, 7vw, 1.72rem); }
    .acr-flip-face { border-radius: 18px; }
    .acr-actions { margin-top: 18px; }
}

@media (max-width: 380px) {
    .acr-document-preview { padding: 9px; }
    .acr-document-summary { padding-inline: 13px; }
    .acr-flip-face--back { padding-inline: 12px; }
}

@media (hover: none) and (pointer: coarse) {
    .acr-flip-button:hover,
    .acr-preview-open:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .acr-flip-card__inner { transition: none !important; }
}


/* Secure PDF proxy preview */
.acr-document-preview__stage:not(.is-empty) {
    background:
        linear-gradient(90deg, transparent, rgba(15,70,114,.035), transparent),
        #fff;
}
html[data-theme="dark"] .acr-document-preview__stage:not(.is-empty) {
    background: #f7fafc;
}
.acr-document-preview__frame {
    background: #fff;
}


/* =========================================================
   ACR — El documento gira; la barra lateral permanece fija
   ========================================================= */
.acr-validation-layout {
    width: min(100%, 1020px);
    margin: 0 auto;
}

/* Se neutraliza el flip de la tarjeta completa de versiones previas. */
.acr-validation-layout .acr-document-front {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr);
    border: 1px solid var(--border);
    border-radius: clamp(20px, 2.7vw, 28px);
    overflow: hidden;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 94%, transparent), var(--surface));
    box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .acr-validation-layout .acr-document-front {
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 184, 217, .055), transparent 34%),
        linear-gradient(145deg, rgba(7, 29, 46, .98), rgba(3, 16, 27, .97));
}

.acr-validation-layout .acr-document-preview {
    min-width: 0;
}

.acr-document-rotator {
    width: min(100%, 570px);
    margin: 0 auto;
    aspect-ratio: 8.5 / 11;
    position: relative;
    perspective: 1800px;
    perspective-origin: 50% 50%;
}

.acr-document-rotator__inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform .72s cubic-bezier(.2,.72,.18,1);
    will-change: transform;
}

.acr-document-rotator.is-flipped .acr-document-rotator__inner {
    transform: rotateY(180deg);
}

.acr-document-rotator__face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    border-radius: clamp(12px, 1.8vw, 18px);
    overflow: hidden;
}

.acr-document-rotator__face--front {
    transform: rotateY(0deg);
}

.acr-document-rotator__face--back {
    transform: rotateY(180deg);
    border: 1px solid rgba(15,70,114,.18);
    background:
        radial-gradient(circle at 100% 0%, rgba(0,184,217,.08), transparent 30%),
        linear-gradient(145deg, #ffffff 0%, #eef6fb 100%);
    box-shadow: 0 24px 54px rgba(7,42,70,.18);
}

html[data-theme="dark"] .acr-document-rotator__face--back {
    border-color: rgba(255,215,90,.22);
    background:
        radial-gradient(circle at 100% 0%, rgba(255,215,0,.07), transparent 32%),
        linear-gradient(145deg, #0b263b 0%, #06131f 58%, #02090f 100%);
    box-shadow: 0 26px 60px rgba(0,0,0,.38);
}

/* El iframe sigue ocupando exactamente la cara frontal. */
.acr-document-rotator .acr-document-preview__stage {
    width: 100%;
    height: 100%;
    margin: 0;
    aspect-ratio: auto;
}

.acr-document-details-sheet {
    width: 100%;
    height: 100%;
    padding: clamp(15px, 2.4vw, 24px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.acr-document-details-sheet::-webkit-scrollbar { width: 8px; }
.acr-document-details-sheet::-webkit-scrollbar-track { background: transparent; }
.acr-document-details-sheet::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--border-strong);
}

.acr-document-details-sheet__header {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.acr-document-details-sheet__header > div { min-width: 0; }
.acr-document-details-sheet__header h2 {
    margin: 3px 0 0;
    color: var(--text);
    font: 800 clamp(1.12rem, 2.2vw, 1.55rem)/1.1 "Work Sans", sans-serif;
    letter-spacing: -.03em;
}

.acr-document-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.acr-document-data-item {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-muted);
}

.acr-document-data-item.is-wide { grid-column: span 2; }

.acr-document-data-item dt {
    margin: 0 0 7px;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .58rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.acr-document-data-item .acr-data-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--text-strong);
    background: color-mix(in srgb, var(--text-strong) 10%, transparent);
}

.acr-document-data-item .acr-data-icon svg { width: 14px; height: 14px; }

.acr-document-data-item dd {
    margin: 0;
    color: var(--text);
    font: 750 clamp(.77rem, 1.45vw, .93rem)/1.38 "Manrope", sans-serif;
    overflow-wrap: anywhere;
}

.acr-document-data-item.is-folio dd {
    color: var(--text-strong);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.acr-document-verified-note {
    margin: 12px 0 0;
    padding: 10px 11px;
    border: 1px dashed color-mix(in srgb, var(--text-strong) 38%, var(--border));
    border-radius: 12px;
    color: var(--text-soft);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .68rem;
    line-height: 1.48;
}

.acr-document-verified-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--text-strong);
}

/* La barra lateral nunca participa en la rotación. */
.acr-validation-layout .acr-document-summary {
    min-height: 100%;
    position: relative;
    transform: none !important;
    backface-visibility: visible !important;
}

@media (max-width: 900px) {
    .acr-validation-layout .acr-document-front {
        grid-template-columns: 1fr;
    }

    .acr-validation-layout .acr-document-preview {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .acr-document-rotator {
        width: min(100%, 540px);
    }

    .acr-validation-layout .acr-document-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .acr-validation-layout .acr-document-summary .acr-flip-button,
    .acr-validation-layout .acr-document-summary .acr-flip-hint {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .acr-validation-layout .acr-document-summary {
        grid-template-columns: 1fr;
    }

    .acr-document-details-sheet {
        padding: 13px;
    }

    .acr-document-details-sheet__header {
        display: grid;
        gap: 8px;
    }

    .acr-document-data-grid {
        grid-template-columns: 1fr;
    }

    .acr-document-data-item.is-wide {
        grid-column: auto;
    }

    .acr-document-data-item {
        padding: 10px;
    }
}

@media (max-width: 380px) {
    .acr-document-details-sheet { padding: 10px; }
    .acr-document-data-grid { gap: 8px; }
    .acr-document-data-item { padding: 9px; border-radius: 11px; }
    .acr-document-data-item dt { font-size: .53rem; }
    .acr-document-data-item dd { font-size: .73rem; }
}

@media (prefers-reduced-motion: reduce) {
    .acr-document-rotator__inner { transition: none !important; }
}


/* Vista previa PDF renderizada por la interfaz: sin márgenes del visor nativo. */
.acr-document-rotator .acr-document-preview__stage {
    background: #fff;
}

.acr-pdf-render {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
    display: grid;
    place-items: start center;
}

.acr-pdf-render__canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #fff;
}

.acr-pdf-render__loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    padding: 24px;
    color: #0f4672;
    background: linear-gradient(145deg, #ffffff, #eef6fb);
    text-align: center;
    font: 800 .86rem/1.4 "Manrope", sans-serif;
    transition: opacity .18s ease, visibility .18s ease;
}

.acr-pdf-render__loading svg {
    width: 38px;
    height: 38px;
}

.acr-pdf-render__loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.acr-pdf-render.has-error .acr-pdf-render__loading {
    color: var(--danger);
}

/* El canvas reemplaza visualmente al visor PDF del navegador. */
.acr-document-rotator .acr-document-preview__frame {
    display: none !important;
}


/* PDF HD: el canvas mantiene su resolución interna alta y se reduce sólo por CSS. */
.acr-pdf-render__canvas {
    max-width: 100%;
    image-rendering: auto;
    -webkit-font-smoothing: antialiased;
    transform: translateZ(0);
}

@media (min-resolution: 2dppx) {
    .acr-pdf-render__canvas {
        transform: translateZ(0) scale(1);
    }
}


/* Mejora de legibilidad del documento */
.acr-document-preview__stage {
    width: min(100%, 460px);
}

.acr-pdf-render {
    padding: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)), #252525;
}

.acr-pdf-render__canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
    image-rendering: auto;
    filter: contrast(1.05) saturate(1.02);
}

@media (min-width: 900px) {
    .acr-document-preview__stage {
        width: min(100%, 500px);
    }
}

@media (min-width: 1200px) {
    .acr-document-preview__stage {
        width: min(100%, 540px);
    }
}

@media (max-width: 640px) {
    .acr-document-preview__stage {
        width: 100%;
    }

    .acr-pdf-render {
        padding: 4px;
    }
}


/* =========================================================
   Zoom HD para texto pequeño del diploma
   ========================================================= */
.acr-pdf-zoom-trigger {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 5;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 11px;
    color: #fff;
    background: rgba(4,18,29,.82);
    box-shadow: 0 10px 28px rgba(0,0,0,.24);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 800 .72rem/1 "Manrope", sans-serif;
    cursor: zoom-in;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.acr-pdf-zoom-trigger svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
}

.acr-pdf-zoom-trigger:hover,
.acr-pdf-zoom-trigger:focus-visible {
    color: #071522;
    border-color: #ffd700;
    background: #ffd700;
}

.acr-zoom-modal[hidden] { display: none !important; }

.acr-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

.acr-zoom-modal.is-open { opacity: 1; visibility: visible; }

.acr-zoom-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1,7,12,.9);
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
}

.acr-zoom-modal__panel {
    width: min(96vw, 1280px);
    height: min(94vh, 1050px);
    position: relative;
    z-index: 1;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 20px;
    background: #071522;
    box-shadow: 0 34px 110px rgba(0,0,0,.58);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.acr-zoom-modal__toolbar {
    min-height: 68px;
    padding: 10px 14px 10px 18px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    color: #fff;
    background: linear-gradient(90deg, #0f4672, #071522);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.acr-zoom-modal__title { min-width: 0; display: grid; gap: 3px; }
.acr-zoom-modal__title strong { font: 800 .96rem/1.2 "Work Sans", sans-serif; }
.acr-zoom-modal__title span { color: rgba(255,255,255,.72); font-size: .72rem; line-height: 1.35; }

.acr-zoom-modal__controls { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.acr-zoom-modal__controls button {
    min-width: 42px;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 11px;
    color: #fff;
    background: rgba(255,255,255,.08);
    font: 800 .86rem/1 "Manrope", sans-serif;
    cursor: pointer;
}
.acr-zoom-modal__controls button:hover,
.acr-zoom-modal__controls button:focus-visible { border-color: #ffd700; background: rgba(255,215,0,.12); }
.acr-zoom-modal__controls .is-close { color: #071522; border-color: #ffd700; background: #ffd700; font-size: 1.25rem; }

.acr-zoom-modal__viewport {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    background: radial-gradient(circle at 50% 0%, rgba(15,70,114,.3), transparent 45%), #171b1e;
    -webkit-overflow-scrolling: touch;
}

.acr-zoom-modal__viewport img {
    display: block;
    height: auto;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 20px 56px rgba(0,0,0,.34);
    transition: width .16s ease;
}

/* Un poco más de tamaño útil en PC sin tocar la barra derecha. */
@media (min-width: 1100px) {
    .acr-validation-layout { width: min(100%, 1120px); }
    .acr-validation-layout .acr-document-front { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .55fr); }
    .acr-document-rotator { width: min(100%, 620px); }
}

@media (max-width: 640px) {
    .acr-pdf-zoom-trigger span { display: none; }
    .acr-pdf-zoom-trigger { width: 40px; padding: 0; justify-content: center; }
    .acr-zoom-modal { padding: 0; }
    .acr-zoom-modal__panel { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
    .acr-zoom-modal__toolbar { min-height: 62px; padding-inline: 10px; }
    .acr-zoom-modal__title span { display: none; }
    .acr-zoom-modal__controls { gap: 4px; }
    .acr-zoom-modal__controls button { min-width: 38px; min-height: 38px; padding-inline: 8px; }
}