:root {
    --pdf-bg: #08111f;
    --pdf-surface: rgba(17, 31, 50, .86);
    --pdf-surface-strong: #13243a;
    --pdf-border: rgba(148, 163, 184, .22);
    --pdf-text: #edf6ff;
    --pdf-muted: #9eb1c8;
    --pdf-cyan: #55d6ff;
    --pdf-cyan-soft: rgba(85, 214, 255, .13);
    --pdf-violet: #a98bff;
    --pdf-danger: #fb7185;
}

.pdf-app-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--pdf-bg);
    color: var(--pdf-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pdf-app-body #mainNav { background: rgba(8, 17, 31, .94); }
.pdf-app-body [hidden] { display: none !important; }
.pdf-app-main { min-height: 100vh; padding: 104px 0 70px; background: radial-gradient(circle at 14% 3%, rgba(85, 214, 255, .12), transparent 28rem), radial-gradient(circle at 93% 33%, rgba(169, 139, 255, .1), transparent 28rem), linear-gradient(150deg, #08111f, #0a1424 52%, #07101c); }
.pdf-app-main::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .16; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 92px 92px; mask-image: linear-gradient(to bottom, #000, transparent 70%); }
.pdf-shell { position: relative; z-index: 1; width: min(100% - 32px, 920px); margin: auto; }
.pdf-hero { display: flex; align-items: flex-start; gap: 18px; margin: 0 0 32px; }
.pdf-app-mark, .pdf-next-icon { display: grid; flex: 0 0 62px; width: 62px; height: 62px; place-items: center; border: 1px solid rgba(85, 214, 255, .42); border-radius: 18px; background: var(--pdf-cyan-soft); color: var(--pdf-cyan); font-size: 1.7rem; box-shadow: 0 0 34px rgba(85, 214, 255, .1); }
.pdf-book-mark { border-color: rgba(169, 139, 255, .45); background: rgba(169, 139, 255, .13); color: var(--pdf-violet); }
.pdf-eyebrow { margin: 0 0 7px; color: var(--pdf-cyan); font-size: .71rem; font-weight: 850; letter-spacing: .16em; }
.pdf-book-mark + div .pdf-eyebrow { color: #c0adff; }
.pdf-hero h1 { margin: 0; color: #fff; font-size: clamp(2.1rem, 7vw, 3.8rem); font-weight: 900; letter-spacing: -.065em; line-height: 1; }
.pdf-lead { max-width: 650px; margin: 12px 0 0; color: var(--pdf-muted); font-size: 1rem; line-height: 1.6; }
.pdf-reader-card, .pdf-next-card, .pdf-how-card { border: 1px solid var(--pdf-border); border-radius: 20px; background: var(--pdf-surface); box-shadow: 0 24px 70px rgba(0, 0, 0, .2); }
.pdf-reader-card { padding: clamp(20px, 5vw, 34px); }
.pdf-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.pdf-section-heading h2, .pdf-next-card h2, .pdf-how-card h2 { margin: 0; color: #fff; font-size: clamp(1.35rem, 4vw, 1.9rem); letter-spacing: -.045em; }
.pdf-privacy, .pdf-page-count { margin: 0; color: var(--pdf-muted); font-size: .8rem; }
.pdf-privacy i { margin-right: 4px; color: var(--pdf-cyan); }
.pdf-dropzone { display: grid; min-height: 230px; place-items: center; align-content: center; gap: 8px; padding: 28px; border: 1px dashed rgba(85, 214, 255, .48); border-radius: 16px; background: linear-gradient(145deg, rgba(85, 214, 255, .08), rgba(255, 255, 255, .025)); color: var(--pdf-muted); cursor: pointer; text-align: center; transition: border-color .2s, background .2s, transform .2s; }
.pdf-dropzone:hover, .pdf-dropzone.is-dragging { border-color: var(--pdf-cyan); background: rgba(85, 214, 255, .14); transform: translateY(-2px); }
.pdf-dropzone strong { color: #fff; font-size: 1.05rem; }
.pdf-dropzone span { font-size: .9rem; }
.pdf-dropzone small { max-width: 430px; margin-top: 5px; color: #7189a2; font-size: .75rem; line-height: 1.45; }
.pdf-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pdf-drop-icon { display: grid; width: 54px; height: 54px; margin-bottom: 4px; place-items: center; border-radius: 15px; background: var(--pdf-cyan-soft); color: var(--pdf-cyan); font-size: 1.45rem; }
.pdf-status { min-height: 1.3em; margin: 13px 0 0; color: var(--pdf-muted); font-size: .8rem; }
.pdf-viewer { margin-top: 18px; overflow: hidden; border: 1px solid var(--pdf-border); border-radius: 14px; background: #02060b; }
.pdf-viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--pdf-border); background: var(--pdf-surface-strong); }
.pdf-current-file { display: flex; min-width: 0; align-items: center; gap: 8px; color: #e8f2ff; font-size: .82rem; font-weight: 750; }
.pdf-current-file i { color: #ff7186; }
.pdf-current-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.pdf-small-button, .pdf-primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(85, 214, 255, .42); border-radius: 9px; background: var(--pdf-cyan-soft); color: var(--pdf-cyan); cursor: pointer; font: inherit; font-size: .78rem; font-weight: 800; text-decoration: none; transition: background .2s, transform .2s, color .2s; }
.pdf-small-button { min-height: 34px; padding: 7px 10px; }
.pdf-primary-button { min-height: 42px; padding: 10px 15px; background: linear-gradient(110deg, #0ea5e9, #7c6cf2); border-color: transparent; color: #fff; box-shadow: 0 10px 26px rgba(48, 137, 222, .2); }
.pdf-small-button:hover, .pdf-small-button:focus-visible, .pdf-primary-button:hover, .pdf-primary-button:focus-visible { color: #fff; background-color: rgba(85, 214, 255, .23); transform: translateY(-1px); }
.pdf-primary-button:hover, .pdf-primary-button:focus-visible { background: linear-gradient(110deg, #28baf5, #9583ff); }
.pdf-small-button:disabled, .pdf-primary-button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.pdf-quiet-button { border-color: rgba(251, 113, 133, .35); background: rgba(251, 113, 133, .08); color: #fda4af; }
.pdf-viewer iframe { display: block; width: 100%; height: min(72vh, 800px); border: 0; background: #fff; }
/* Fullscreen keeps the toolbar, so "Ieși din tot ecranul" stays in reach; the document takes
   the rest. The .is-maximized class is the same picture for browsers without the API. */
.pdf-viewer:fullscreen, .pdf-viewer.is-maximized { display: flex; flex-direction: column; margin: 0; border: 0; border-radius: 0; }
.pdf-viewer.is-maximized { position: fixed; inset: 0; z-index: 2000; }
.pdf-viewer:fullscreen iframe, .pdf-viewer.is-maximized iframe { flex: 1; height: auto; min-height: 0; }
.pdf-viewer:fullscreen .pdf-fallback, .pdf-viewer.is-maximized .pdf-fallback { display: none; }
/* The fixed navbar has its own stacking context above the viewer's, so it would still catch
   the clicks meant for the toolbar; while pinned, it goes away, as in real fullscreen. */
body.pdf-maximized { overflow: hidden; }
body.pdf-maximized #mainNav { display: none; }
.pdf-fallback { padding: 10px 13px; color: #849ab1; font-size: .74rem; line-height: 1.5; }
.pdf-fallback a, .pdf-download-result { color: var(--pdf-cyan); }
.pdf-next-card { display: flex; align-items: flex-start; gap: 18px; margin-top: 18px; padding: 24px; }
.pdf-next-card p:not(.pdf-eyebrow) { margin: 8px 0 16px; color: var(--pdf-muted); line-height: 1.55; }
.pdf-note { margin: 18px 0 0; color: #7e93aa; font-size: .75rem; line-height: 1.55; text-align: center; }
.pdf-note i { margin-right: 4px; color: var(--pdf-cyan); }

.pdf-book-card { padding-bottom: 24px; }
.pdf-book-dropzone { min-height: 200px; border-color: rgba(169, 139, 255, .5); background: linear-gradient(145deg, rgba(169, 139, 255, .09), rgba(255, 255, 255, .025)); }
.pdf-book-dropzone:hover, .pdf-book-dropzone.is-dragging { border-color: var(--pdf-violet); background: rgba(169, 139, 255, .15); }
.pdf-book-dropzone .pdf-drop-icon { background: rgba(169, 139, 255, .14); color: #c0adff; }
.pdf-book-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.pdf-button-label { cursor: pointer; }
.pdf-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; margin-top: 18px; }
.pdf-page-item { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--pdf-border); border-radius: 12px; background: #0d1929; }
.pdf-page-preview { display: grid; height: 185px; place-items: center; overflow: hidden; background: #d9e0e8; }
.pdf-page-preview img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .2s; }
.pdf-page-number { padding: 8px 9px 5px; color: #e9f3ff; font-size: .76rem; font-weight: 800; }
.pdf-page-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 7px 8px; }
.pdf-page-actions button { min-width: 0; padding: 6px 2px; border: 1px solid rgba(148, 163, 184, .18); border-radius: 6px; background: rgba(255, 255, 255, .05); color: #a9bbcf; cursor: pointer; font-size: .7rem; }
.pdf-page-actions button:hover, .pdf-page-actions button:focus-visible { border-color: var(--pdf-cyan); color: #fff; }
.pdf-page-actions button[data-action="remove"] { color: #fda4af; }
.pdf-create-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding: 16px; border: 1px solid rgba(85, 214, 255, .2); border-radius: 12px; background: rgba(85, 214, 255, .055); }
.pdf-create-panel strong, .pdf-create-panel span { display: block; }
.pdf-create-panel strong { color: #fff; font-size: .9rem; }
.pdf-create-panel span { margin-top: 4px; color: var(--pdf-muted); font-size: .75rem; }
.pdf-download-result { display: block; margin-top: 15px; text-align: center; font-size: .87rem; font-weight: 800; text-decoration: none; }
.pdf-how-card { margin-top: 18px; padding: 24px; }
.pdf-how-card ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0 0; padding: 0; list-style: none; }
.pdf-how-card li { display: flex; gap: 10px; }
.pdf-how-card li > span { display: grid; flex: 0 0 26px; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: rgba(169, 139, 255, .18); color: #c0adff; font-size: .75rem; font-weight: 900; }
.pdf-how-card strong, .pdf-how-card small { display: block; }
.pdf-how-card strong { color: #fff; font-size: .83rem; }
.pdf-how-card small { margin-top: 4px; color: var(--pdf-muted); font-size: .72rem; line-height: 1.45; }

@media (max-width: 700px) {
    .pdf-app-main { padding-top: 88px; }
    .pdf-shell { width: min(100% - 24px, 920px); }
    .pdf-section-heading { align-items: flex-start; flex-direction: column; }
    .pdf-privacy, .pdf-page-count { align-self: flex-start; }
    .pdf-viewer-toolbar { align-items: stretch; flex-direction: column; }
    .pdf-viewer-actions { justify-content: stretch; }
    .pdf-viewer-actions > * { flex: 1; }
    .pdf-next-card { padding: 20px; }
}

@media (max-width: 520px) {
    .pdf-hero { gap: 13px; }
    .pdf-app-mark { flex-basis: 50px; width: 50px; height: 50px; border-radius: 14px; font-size: 1.3rem; }
    .pdf-hero h1 { font-size: 2.1rem; }
    .pdf-dropzone { min-height: 200px; padding-inline: 18px; }
    .pdf-create-panel { align-items: stretch; flex-direction: column; }
    .pdf-create-panel .pdf-primary-button { width: 100%; }
    .pdf-how-card ol { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .pdf-dropzone, .pdf-small-button, .pdf-primary-button { transition: none; }
}
