:root {
    --bg: #F5F7FA;
    --bg-2: #ECF1F7;
    --paper: #FFFFFF;
    --line: #DCE4EE;
    --line-2: #C5D1E0;
    --ink: #0F2F5C;
    --ink-deep: #061833;
    --muted: #5C6B82;
    --soft: #8392A8;
    --azure: #3DA9FC;
    --azure-2: #1E8AE0;
    --red: #E63946;
    --green: #2E7D5C;
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }

body {
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    font-family: var(--font-sans);
    color: var(--ink);
    background:
        radial-gradient(800px 480px at 50% -10%, rgba(61, 169, 252, 0.08), transparent 60%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.document {
    width: min(1080px, calc(100vw - 40px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    height: min(720px, calc(100svh - 40px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    margin: max(20px, env(safe-area-inset-top, 20px)) auto max(20px, env(safe-area-inset-bottom, 20px)) auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 16px;
    padding: clamp(20px, 2.4vw, 32px);
    background: var(--paper);
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 30px 70px rgba(15, 47, 92, 0.1), 0 8px 24px rgba(15, 47, 92, 0.05);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.55s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.document::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--azure), var(--ink));
}

.doc-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--line-2);
}
.brand {
    display: flex; align-items: center; gap: 12px;
}
.brand-mark {
    width: 44px; height: 44px;
    border-radius: 10px;
    color: var(--paper);
    background: linear-gradient(180deg, var(--ink), var(--ink-deep));
    display: grid; place-items: center;
    box-shadow: 0 8px 18px rgba(15, 47, 92, 0.25);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.005em;
}
.brand-text span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.doc-no {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
    padding: 6px 10px;
    background: var(--bg-2);
    border-radius: 6px;
    border: 1px solid var(--line);
    white-space: nowrap;
}

.doc-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(20px, 2.6vw, 36px);
    min-height: 0;
    align-items: stretch;
}

.doc-photo {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    position: relative;
}
.doc-photo > .slider {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--ink-deep);
    border: 1px solid var(--line);
    position: relative;
    align-self: center;
    justify-self: center;
}
.slider, .slide { width: 100%; height: 100%; }
.slide {
    position: absolute; inset: 0;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.slide.active { opacity: 1; }

.dots {
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
}
.dot {
    width: 8px; height: 8px;
    padding: 0; border: 0;
    border-radius: 999px;
    background: var(--line-2);
    cursor: pointer;
    transition: width 0.3s ease, background 0.2s ease;
}
.dot:hover { background: var(--azure); }
.dot.active {
    width: 26px;
    background: var(--azure);
    box-shadow: 0 0 0 3px rgba(61, 169, 252, 0.18);
}
.dot:focus-visible { outline: 2px solid var(--azure); outline-offset: 3px; }

.doc-info {
    min-width: 0;
    min-height: 0;
    display: flex; flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}
.badge-stamp {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px 6px 10px;
    border: 1.5px solid var(--green);
    border-radius: 6px;
    color: var(--green);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(46, 125, 92, 0.06);
    width: fit-content;
    transform: rotate(-1.5deg);
}
.badge-stamp svg { width: 14px; height: 14px; }

h1 {
    margin: 14px 0 0;
    font-size: clamp(26px, min(3.4vw, 4.4vh), 40px);
    line-height: 1.06;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--ink);
}
h1 em {
    font-style: normal;
    color: var(--azure);
    position: relative;
}
h1 em::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0.04em;
    height: 0.18em;
    background: rgba(61, 169, 252, 0.22);
    z-index: -1;
}

.doc-info p {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
    max-width: 38ch;
}

.key-facts {
    margin-top: clamp(12px, 1.8vh, 18px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.fact {
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(15, 47, 92, 0.06), transparent 70%);
    border: 1px solid var(--line-2);
    border-left: 3px solid var(--azure);
    border-radius: 4px;
}
.fact strong {
    display: block;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.02em;
}
.fact span {
    display: block;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.steps {
    list-style: none;
    margin: clamp(14px, 2vh, 20px) 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.steps li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
}
.steps li span {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--paper);
    background: var(--ink);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.doc-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: auto;
    padding-top: clamp(12px, 1.8vh, 18px);
}

.trust-line {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--soft);
    font-size: 11px;
    font-weight: 500;
}
.trust-line li { display: inline-flex; align-items: center; gap: 5px; }
.tl-mark { color: var(--green); font-weight: 800; font-size: 12px; }
.btn {
    position: relative;
    min-height: 56px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 0 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.btn .ic-arr { width: 18px; height: 18px; opacity: 0.9; transition: transform 0.2s; }
.btn-primary:hover .ic-arr { transform: translateX(3px); }

.btn-primary {
    color: white;
    min-height: 64px;
    font-size: 16.5px;
    background: linear-gradient(180deg, var(--azure), var(--azure-2) 60%, var(--ink) 100%);
    box-shadow: 0 18px 36px rgba(30, 138, 224, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}
.btn-primary .ic-max-bg { fill: rgba(255, 255, 255, 0.22); }
.btn-primary::after {
    content: "";
    position: absolute; top: 0; left: -120%;
    width: 35%; height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: skewX(-20deg);
    animation: shimmer 5s 1.6s ease-in-out infinite;
}
@keyframes shimmer {
    0% { left: -120%; }
    100% { left: 220%; }
}
.btn-primary:hover {
    box-shadow: 0 22px 44px rgba(30, 138, 224, 0.65);
}
.btn-secondary {
    color: var(--ink);
    background: var(--paper);
    border: 1.5px solid var(--line-2);
    font-size: 14px;
    font-weight: 600;
    min-height: 50px;
}
.btn-secondary svg { width: 18px; height: 18px; opacity: 0.8; }
.btn-secondary:hover {
    background: var(--bg-2);
    border-color: var(--ink);
    color: var(--ink-deep);
}
.btn:focus-visible { outline: 2px solid var(--azure); outline-offset: 3px; }

.doc-footer {
    padding-top: 12px;
    border-top: 1px dashed var(--line-2);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    color: var(--soft);
    font-size: 10px;
    letter-spacing: 0.02em;
}
.doc-footer span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.doc-footer a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: rgba(15, 47, 92, 0.4);
    text-underline-offset: 2px;
    flex-shrink: 0;
}
.doc-footer a:hover { color: var(--azure); }

/* === TABLET / NARROW DESKTOP === */
@media (min-width: 861px) and (max-width: 1080px) {
    .document {
        width: calc(100vw - 24px);
        padding: 22px;
        gap: 12px;
    }
    .doc-body { gap: 18px; }
    h1 { font-size: clamp(22px, 3vw, 28px); }
    .doc-info p { font-size: 13px; }
    .fact { padding: 10px 12px; }
    .fact strong { font-size: 18px; }
    .steps li { padding: 8px 12px; font-size: 11.5px; }
}

/* === MOBILE === */
@media (max-width: 860px) {
    .document {
        width: min(440px, calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
        height: calc(100svh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        margin: max(8px, env(safe-area-inset-top, 8px)) auto max(8px, env(safe-area-inset-bottom, 8px)) auto;
        gap: 10px;
        padding: 14px;
        grid-template-rows: auto minmax(0, 1fr) auto auto;
    }
    .doc-header { padding-bottom: 8px; }
    .brand-mark { width: 36px; height: 36px; }
    .brand-mark svg { width: 20px; height: 20px; }
    .brand-text strong { font-size: 15px; }
    .brand-text span { font-size: 9px; }
    .doc-no { font-size: 9px; padding: 4px 8px; }

    .doc-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 10px;
    }
    .doc-photo {
        min-height: 0;
        gap: 8px;
    }
    .doc-photo > .slider {
        aspect-ratio: 16 / 9;
        max-height: 32vh;
    }
    .badge-stamp { font-size: 9px; padding: 4px 10px 4px 8px; }
    .badge-stamp svg { width: 12px; height: 12px; }
    h1 { font-size: clamp(22px, 5.6vw, 28px); margin-top: 8px; }
    .doc-info p { font-size: 12px; margin-top: 8px; }
    .steps {
        margin-top: 10px;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .steps li { padding: 8px 10px; font-size: 10px; gap: 6px; }
    .steps li span { font-size: 9px; padding: 1px 5px; }

    .key-facts { margin-top: 8px; gap: 6px; }
    .fact { padding: 8px 10px; border-left-width: 2px; }
    .fact strong { font-size: 15px; }
    .fact span { font-size: 9px; }

    .doc-actions { gap: 6px; grid-template-columns: 1fr; }
    .btn-primary { min-height: 56px; font-size: 14.5px; padding: 0 14px; }
    .btn-secondary { min-height: 44px; font-size: 12.5px; padding: 0 12px; }
    .btn svg { width: 18px; height: 18px; }
    .btn-primary .ic-arr { width: 14px; height: 14px; }
    .trust-line { gap: 10px; font-size: 9.5px; margin-top: 6px; }
    .trust-line li { gap: 4px; }
    .tl-mark { font-size: 11px; }
    .doc-footer { font-size: 9px; flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 8px; }
}

@media (max-width: 380px) {
    .document { padding: 12px; gap: 8px; }
    .brand-mark { width: 32px; height: 32px; }
    .brand-text strong { font-size: 14px; }
    .brand-text span { font-size: 8.5px; }
    .doc-no { font-size: 8.5px; padding: 3px 6px; }
    h1 { font-size: 20px; }
    .doc-info p { font-size: 11.5px; }
    .key-facts { gap: 5px; }
    .fact { padding: 6px 8px; }
    .fact strong { font-size: 14px; }
    .steps li { padding: 6px 8px; font-size: 9.5px; }
    .steps li span { font-size: 8.5px; padding: 1px 4px; }
    .btn-primary { min-height: 50px; font-size: 13.5px; }
    .btn-secondary { min-height: 40px; font-size: 11.5px; }
}

@media (max-height: 620px) and (max-width: 860px) {
    .doc-info p { display: none; }
    .badge-stamp { display: none; }
    .steps { grid-template-columns: 1fr 1fr 1fr 1fr; }
    .steps li span { display: none; }
}

@media (min-width: 861px) and (max-height: 720px) {
    .document {
        height: calc(100dvh - 24px);
        margin: 12px auto;
        padding: 22px;
    }
    h1 { font-size: 30px; }
    .btn { min-height: 50px; }
    .doc-info p { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .slide { transform: none !important; }
}

/* === COOKIE BANNER (light theme) === */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border-radius: 999px;
    background: rgba(15, 47, 92, 0.96);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 32px rgba(15, 47, 92, 0.35);
    color: rgba(255, 255, 255, 0.86);
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.3;
    max-width: calc(100vw - 16px);
    white-space: nowrap;
    animation: cookieSlide 0.4s ease both;
}
@keyframes cookieSlide {
    from { opacity: 0; transform: translate(-50%, 14px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.cookie-banner[hidden] { display: none; }
.cookie-text-full { display: inline; }
.cookie-text-short { display: none; }
.cookie-text a { color: var(--azure); text-decoration: underline; text-underline-offset: 2px; }
.cookie-accept, .cookie-close {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: filter 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.cookie-accept {
    padding: 7px 13px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--azure), var(--azure-2));
    color: #fff;
    font-size: 11.5px;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 10px rgba(30, 138, 224, 0.45);
}
.cookie-accept:hover { filter: brightness(1.08); }
.cookie-close {
    width: 26px; height: 26px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1;
    display: grid; place-items: center;
}
.cookie-close:hover { background: rgba(255, 255, 255, 0.20); color: #fff; }
@media (max-width: 480px) {
    .cookie-banner { font-size: 10.5px; padding: 5px 5px 5px 12px; gap: 6px; }
    .cookie-text-full { display: none; }
    .cookie-text-short { display: inline; }
    .cookie-accept { padding: 6px 11px; font-size: 10.5px; }
    .cookie-close { width: 22px; height: 22px; font-size: 14px; }
}
