/* ==========================================================================
   JVA Editora — sistema de design
   Editorial e sóbrio: azul-marinho, serifa nos títulos, muito respiro.
   Sem framework: tudo aqui é escrito à mão e usado pelas páginas Razor.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fundamentos
   -------------------------------------------------------------------------- */
:root {
    /* Marca */
    --navy: #15345a;
    --navy-700: #0f2743;
    --navy-900: #0a1a2e;
    --navy-100: #e8eef6;
    --navy-050: #f4f7fb;

    /* Apoio */
    --gold: #9a7b32;
    --gold-050: #fdf8ec;
    --red: #922828;
    --red-050: #fdf3f3;
    --green: #1f6b45;
    --green-050: #eff8f3;

    /* Neutros */
    --ink: #16202b;
    --ink-soft: #3d4b5a;
    --muted: #64748b;
    --line: #d7dee7;
    --line-soft: #e8edf3;
    --surface: #ffffff;
    --bg: #f5f7fa;

    /* Tipografia */
    --font-serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
    --font-sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

    /* Métrica */
    --max: 1200px;
    --radius: 4px;
    --radius-lg: 8px;

    /* Elevação — discreta: o visual é impresso, não app */
    --shadow-sm: 0 1px 2px rgba(15, 39, 67, .06);
    --shadow: 0 2px 8px rgba(15, 39, 67, .08);
    --shadow-lg: 0 12px 32px rgba(15, 39, 67, .12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 1rem/1.65 var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--navy-700); }

h1, h2, h3, .h3 { font-family: var(--font-serif); color: var(--navy-900); line-height: 1.22; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.85rem, 1.3rem + 1.9vw, 2.75rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.4rem, 1.15rem + .9vw, 1.9rem); letter-spacing: -.01em; }
h3, .h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }

::selection { background: var(--navy-100); color: var(--navy-900); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.container.narrow, .narrow { max-width: 780px; }

.section { padding: 64px 0; }
.section.muted, .muted { background: var(--navy-050); border-block: 1px solid var(--line-soft); }
.section.tight { padding: 40px 0; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
    left: 12px; top: 12px; z-index: 100; position: fixed;
    background: var(--navy); color: #fff; padding: 12px 18px; border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   2. Cabeçalho e navegação
   -------------------------------------------------------------------------- */
.top-strip {
    background: var(--navy-900); color: #c9d6e6;
    font-size: .8rem; letter-spacing: .03em; padding: 7px 0;
}
.top-strip .container { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.top-strip strong { color: #fff; font-weight: 600; }
.top-strip span { color: #9fb3cc; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-main {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; min-height: 96px;
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand-mark {
    width: 56px; height: 56px; flex: 0 0 auto;
    display: grid; place-items: center;
    background: var(--navy); color: #fff;
    font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem; letter-spacing: .04em;
    border-radius: var(--radius);
}
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.brand strong { font-family: var(--font-serif); font-size: 1.45rem; color: var(--navy-900); }
.brand small { color: var(--muted); font-size: .82rem; }

.menu-toggle {
    display: none; background: var(--surface); border: 1px solid var(--line);
    color: var(--navy); font: 600 .95rem var(--font-sans);
    padding: 10px 16px; border-radius: var(--radius); cursor: pointer; min-height: 44px;
}
.menu-toggle:hover { background: var(--navy-050); }

.main-nav { background: var(--navy); }
.nav-inner { display: flex; align-items: stretch; gap: 2px; flex-wrap: wrap; }
.nav-inner a {
    display: flex; align-items: center;
    color: #dce6f2; text-decoration: none;
    padding: 14px 18px; font-size: .95rem; font-weight: 500;
    border-bottom: 3px solid transparent; transition: background .15s, color .15s;
}
.nav-inner a:hover { background: var(--navy-700); color: #fff; border-bottom-color: var(--gold); }
.nav-inner .nav-admin { margin-left: auto; background: var(--navy-900); color: #fff; }

/* --------------------------------------------------------------------------
   3. Botões
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; min-height: 46px;
    border: 1px solid transparent; border-radius: var(--radius);
    font: 600 .95rem var(--font-sans); text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn.secondary { background: var(--surface); border-color: var(--navy); color: var(--navy); }
.btn.secondary:hover { background: var(--navy-050); color: var(--navy-700); }
.btn.plain { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn.plain:hover { background: var(--navy-050); border-color: var(--navy); color: var(--navy); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #761f1f; border-color: #761f1f; color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: #83682a; border-color: #83682a; color: #fff; }
.btn.block, .block { width: 100%; }
.btn.small { padding: 8px 14px; min-height: 38px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 0; }
.buttons form { margin: 0; }

.link-btn {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px;
}
.danger-link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--red); font: inherit; text-decoration: underline; }

.move-btn {
    display: inline-grid; place-items: center; min-width: 30px; height: 30px;
    border: 1px solid var(--line); background: var(--surface); color: var(--navy);
    font-size: .95rem; cursor: pointer; border-radius: var(--radius);
}
.move-btn:hover:not([disabled]) { background: var(--navy); color: #fff; border-color: var(--navy); }
.move-btn[disabled] { opacity: .3; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   4. Rótulos, etiquetas e avisos
   -------------------------------------------------------------------------- */
.eyebrow {
    font-size: .74rem; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--gold); margin: 0 0 .6em;
}
.lead { font-size: 1.12rem; color: var(--ink-soft); line-height: 1.7; max-width: 68ch; }
.subtitle { font-size: 1.1rem; color: var(--muted); font-family: var(--font-serif); font-style: italic; }

.tag, .badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 999px;
    font-size: .76rem; font-weight: 600; letter-spacing: .02em;
    background: var(--navy-100); color: var(--navy-700); border: 1px solid transparent;
}
.badge.published, .badge.pago { background: var(--green-050); color: var(--green); border-color: #cfe6d9; }
.badge.draft, .badge.pendente { background: var(--gold-050); color: var(--gold); border-color: #eddcb4; }
.badge.cancelado, .badge.reembolsado { background: var(--red-050); color: var(--red); border-color: #eecccc; }
.published { background: var(--green-050); color: var(--green); }
.draft { background: var(--gold-050); color: var(--gold); }
.tag.price { background: var(--gold-050); color: var(--gold); border-color: #eddcb4; }
.tag.free { background: var(--green-050); color: var(--green); border-color: #cfe6d9; }
.tag.owned { background: var(--navy); color: #fff; }

.alert {
    display: block; margin: 20px auto; padding: 14px 18px;
    border-radius: var(--radius); border-left: 4px solid; font-size: .96rem;
}
.alert.success { background: var(--green-050); border-color: var(--green); color: #145033; }
.alert.error { background: var(--red-050); border-color: var(--red); color: #6d1e1e; }

.aviso {
    margin: 16px 0; padding: 13px 16px;
    border-left: 4px solid var(--gold); background: var(--gold-050);
    color: #6b551f; font-size: .93rem; border-radius: 0 var(--radius) var(--radius) 0;
}

.validation:not(:empty) {
    margin: 0 0 18px; padding: 13px 16px;
    background: var(--red-050); border-left: 4px solid var(--red);
    color: #6d1e1e; font-size: .93rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.validation ul { margin: 0; padding-left: 18px; }

.empty {
    padding: 40px 24px; text-align: center;
    background: var(--surface); border: 1px dashed var(--line);
    border-radius: var(--radius-lg); color: var(--muted);
}

/* --------------------------------------------------------------------------
   5. Cabeçalhos de página e blocos institucionais
   -------------------------------------------------------------------------- */
.page-header {
    background: linear-gradient(180deg, var(--navy-050), var(--surface));
    border-bottom: 1px solid var(--line);
    padding: 52px 0 44px;
}
.page-header h1 { margin-bottom: .35em; }
.page-header p:last-child { margin: 0; color: var(--ink-soft); max-width: 68ch; font-size: 1.05rem; }

.admin-header { background: var(--navy-900); color: #fff; padding: 40px 0 0; }
.admin-header h1 { color: #fff; margin-bottom: .25em; }
.admin-header .eyebrow { color: #d3b56a; }
.admin-header p { color: #9fb3cc; margin-bottom: 24px; }
.admin-header p strong { color: #fff; }

.breadcrumbs {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding-block: 20px; font-size: .88rem; color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--navy); }

.section-heading {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; margin-bottom: 32px;
    padding-bottom: 16px; border-bottom: 2px solid var(--line-soft);
}
.section-heading h2 { margin: 0; }

/* --------------------------------------------------------------------------
   6. Capa
   -------------------------------------------------------------------------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 72px 0; }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: start; }
.hero h1 { margin-bottom: .5em; }

.notice {
    background: var(--navy-050); border: 1px solid var(--line);
    border-top: 4px solid var(--navy); border-radius: var(--radius-lg);
    padding: 28px; box-shadow: var(--shadow-sm);
}
.notice h2 { font-size: 1.25rem; margin-bottom: .5em; }
.notice dl { margin: 20px 0 0; display: grid; gap: 14px; }
.notice dl div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.notice dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.notice dt { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.notice dd { margin: 0; font-weight: 600; color: var(--navy-900); text-align: right; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }

.principles { display: grid; gap: 16px; }
.principles div {
    display: flex; gap: 16px; align-items: baseline;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 20px;
}
.principles strong { font-family: var(--font-serif); font-size: 1.5rem; color: var(--gold); flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   7. Livros — grade, cartão e capa
   -------------------------------------------------------------------------- */
.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.book-card {
    display: grid; grid-template-columns: 130px 1fr; gap: 20px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 20px;
    box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.book-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--navy-100); }
.book-card > .cover { display: block; text-decoration: none; }
.book-card > .cover img {
    width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.book-card > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.book-card h2, .book-card h3 { font-size: 1.12rem; margin: 0; }
.book-card h2 a, .book-card h3 a { text-decoration: none; color: var(--navy-900); }
.book-card h2 a:hover, .book-card h3 a:hover { color: var(--navy); text-decoration: underline; }
.book-card p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }

.book-meta {
    font-size: .74rem !important; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted) !important;
}

.cover-placeholder {
    display: grid; place-content: center; gap: 2px; text-align: center;
    width: 100%; aspect-ratio: 2 / 3;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%);
    color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.cover-placeholder strong { font-family: var(--font-serif); font-size: 1.35rem; letter-spacing: .06em; }
.cover-placeholder small { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: #a9bfd8; }
.cover-placeholder.large strong { font-size: 2.6rem; }
.cover-placeholder.large small { font-size: .78rem; }

.detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 52px; align-items: start; }
.detail-cover img, .detail-cover .cover-placeholder { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.detail-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }

.description { white-space: pre-line; font-size: 1.04rem; line-height: 1.75; color: var(--ink-soft); margin: 20px 0; }

.metadata { display: grid; gap: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.metadata div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.metadata dt { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.metadata dd { margin: 0; font-weight: 500; text-align: right; color: var(--ink); }

/* --------------------------------------------------------------------------
   8. Comércio — preço, planos e pedido
   -------------------------------------------------------------------------- */
.price-block {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px;
    background: var(--navy-050); border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 18px 22px; margin: 24px 0;
}
.price-block .amount { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; color: var(--navy-900); line-height: 1; }
.price-block .note { font-size: .9rem; color: var(--muted); }

.access-note {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 18px; border-radius: var(--radius); font-size: .94rem;
    background: var(--green-050); border: 1px solid #cfe6d9; color: #145033;
    margin: 20px 0;
}
.access-note.locked { background: var(--gold-050); border-color: #eddcb4; color: #6b551f; }
.access-note p { margin: 0; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; align-items: stretch; }

.plan-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 32px 28px;
    box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s;
}
.plan-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.plan-card.featured { border-color: var(--navy); border-top: 5px solid var(--gold); box-shadow: var(--shadow); }
.plan-card h3 { font-size: 1.4rem; margin-bottom: .3em; }
.plan-price {
    display: flex; align-items: baseline; gap: 6px; margin: 18px 0 8px;
    font-family: var(--font-serif); color: var(--navy-900);
}
.plan-price .amount { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.plan-price .per { font-size: .95rem; color: var(--muted); font-family: var(--font-sans); }
.plan-card ul { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 11px; }
.plan-card li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: var(--ink-soft); }
.plan-card li::before { content: "\2713"; color: var(--green); font-weight: 700; flex: 0 0 auto; }
.plan-card li.off { color: var(--muted); }
.plan-card li.off::before { content: "\2014"; color: var(--muted); }
.plan-foot { margin-top: auto; padding-top: 20px; }

.compare { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 32px; }
.compare > div {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 26px;
}
.compare h3 { display: flex; align-items: center; gap: 10px; }

.order-card {
    background: var(--surface); border: 1px solid var(--line);
    border-top: 4px solid var(--navy); border-radius: var(--radius-lg);
    padding: 32px; box-shadow: var(--shadow-sm); max-width: 640px; margin: 0 auto;
}
.order-total {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 18px 0; margin: 20px 0; border-block: 1px solid var(--line);
}
.order-total .amount { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 700; color: var(--navy-900); }
.pay-key {
    display: block; word-break: break-all; margin: 10px 0 0;
    background: var(--navy-050); border: 1px dashed var(--line);
    padding: 14px 16px; border-radius: var(--radius);
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .95rem;
}

/* --------------------------------------------------------------------------
   9. Catálogo — filtros e paginação
   -------------------------------------------------------------------------- */
.filters {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 22px; margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}
.filters .field { margin: 0; }
.filters .grow, .grow { flex: 1 1 260px; }
.filter-actions { display: flex; gap: 10px; }

.result-count { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }
.result-count strong { color: var(--navy-900); }

.pagination {
    display: flex; align-items: center; justify-content: center; gap: 20px;
    margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
    font-size: .95rem; color: var(--muted);
}
.pagination a {
    padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--radius);
    text-decoration: none; background: var(--surface);
}
.pagination a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* --------------------------------------------------------------------------
   10. Leitura
   -------------------------------------------------------------------------- */
.reading-list { display: grid; gap: 20px; }
.reading-list article {
    display: grid; grid-template-columns: 110px 1fr; gap: 24px; align-items: start;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm);
    transition: box-shadow .18s;
}
.reading-list article:hover { box-shadow: var(--shadow); }
.reading-list h2, .reading-list h3 { font-size: 1.2rem; margin: 0 0 .3em; }
.mini-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius); }
.mini-cover .cover-placeholder { border-radius: var(--radius); }

.reader-shell { display: grid; grid-template-columns: 300px 1fr; min-height: 70vh; background: var(--surface); }

.reader-sidebar {
    border-right: 1px solid var(--line); padding: 32px 26px;
    background: var(--navy-050);
}
.reader-sidebar h1 { font-size: 1.3rem; margin: 16px 0 .2em; }
.reader-sidebar > p { color: var(--muted); font-size: .92rem; }
.reader-sidebar nav { display: grid; gap: 2px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.reader-sidebar nav a {
    display: block; padding: 11px 14px; border-radius: var(--radius);
    text-decoration: none; color: var(--ink-soft); font-size: .93rem;
    border-left: 3px solid transparent;
}
.reader-sidebar nav a:hover { background: var(--navy-100); color: var(--navy-900); }
.reader-sidebar nav a.active { background: var(--surface); color: var(--navy-900); font-weight: 600; border-left-color: var(--gold); box-shadow: var(--shadow-sm); }
.reader-sidebar nav a span { color: var(--muted); font-variant-numeric: tabular-nums; }

.reader-content { padding: 0; min-width: 0; }
.reader-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 48px; border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.reader-toolbar span { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-right: auto; }
.reader-toolbar button {
    border: 1px solid var(--line); background: var(--surface); color: var(--navy);
    padding: 8px 14px; border-radius: var(--radius); cursor: pointer;
    font: 600 .88rem var(--font-sans); min-height: 38px;
}
.reader-toolbar button:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.reader-article { max-width: 68ch; margin: 0 auto; padding: 52px 48px 72px; }
.reader-article h2 { font-size: 1.9rem; margin-bottom: 1.2em; padding-bottom: .5em; border-bottom: 2px solid var(--line-soft); }
.reader-text { white-space: pre-line; font: 1.18rem/1.9 var(--font-serif); color: #1e2933; }

.reader-pager {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
    max-width: 68ch; margin: 0 auto; padding: 28px 48px 64px;
    border-top: 1px solid var(--line);
}
.reader-pager div:last-child { text-align: right; }
.reader-pager a {
    display: inline-block; padding: 14px 18px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--surface); text-decoration: none;
    font-size: .95rem; max-width: 100%;
}
.reader-pager a:hover { border-color: var(--navy); background: var(--navy-050); }

.pdf-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 16px 24px; background: var(--navy-900); color: #fff;
}
.pdf-bar h1 { color: #fff; font-size: 1.15rem; margin: 0; margin-right: auto; }
.pdf-bar a { color: #cfe0f2; font-size: .92rem; }
.pdf-frame { width: 100%; height: min(82vh, 1100px); border: 0; display: block; background: #52565c; }

/* --------------------------------------------------------------------------
   11. Formulários
   -------------------------------------------------------------------------- */
.form-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 32px;
    box-shadow: var(--shadow-sm); margin-bottom: 28px;
}
.form-card h2 { font-size: 1.3rem; }
.form-card > .buttons { margin-top: 24px; }
.form-card .stats { margin-bottom: 0; }

.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

.field { margin-bottom: 20px; display: flex; flex-direction: column; }
.field.short, .short { max-width: 180px; }
.field label { font-weight: 600; font-size: .9rem; margin-bottom: 7px; color: var(--ink); }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px 14px; min-height: 46px;
    border: 1px solid var(--line); border-radius: var(--radius);
    font: 1rem var(--font-sans); color: var(--ink); background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b9c4d1; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-100); outline: none;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field span { font-size: .88rem; }

input, select, textarea, button { font-family: inherit; }

.chapter-editor { min-height: 480px !important; font: 1rem/1.75 var(--font-serif) !important; }

.hint { display: block; margin-top: 6px; color: var(--muted); font-size: .86rem; }
.field-error, .field-validation-error { display: block; margin-top: 6px; color: var(--red); font-size: .88rem; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.field.invalid input:focus, .field.invalid textarea:focus { box-shadow: 0 0 0 3px var(--red-050); }

.check, .checks label { display: flex; align-items: flex-start; gap: 10px; font-size: .95rem; line-height: 1.5; }
.check { margin: 16px 0; }
.check input, .checks input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--navy); }
.checks {
    display: grid; gap: 12px; margin: 18px 0; padding: 18px 20px;
    background: var(--navy-050); border: 1px solid var(--line); border-radius: var(--radius);
}

.form-foot { margin: 16px 0 0; font-size: .94rem; text-align: center; color: var(--muted); }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.auth { padding: 72px 0; }
.auth-box { max-width: 480px; margin: 0 auto; }
.auth .form-card { padding: 40px 36px; box-shadow: var(--shadow); border-top: 4px solid var(--navy); }

.current-cover { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.current-cover img { width: 90px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------------------
   12. Painel — tabelas e estatísticas
   -------------------------------------------------------------------------- */
.admin-nav { display: flex; flex-wrap: wrap; gap: 2px; }
.admin-nav a {
    padding: 13px 18px; color: #cfe0f2; text-decoration: none; font-size: .93rem;
    border-bottom: 3px solid transparent;
}
.admin-nav a:hover { color: #fff; border-bottom-color: var(--gold); background: rgba(255, 255, 255, .06); }

.admin-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: start; }
.messages-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stats div {
    background: var(--surface); border: 1px solid var(--line);
    border-top: 4px solid var(--navy); border-radius: var(--radius-lg);
    padding: 24px 22px; box-shadow: var(--shadow-sm);
}
.stats strong { display: block; font-family: var(--font-serif); font-size: 2.3rem; line-height: 1; color: var(--navy-900); }
.stats span { display: block; margin-top: 8px; font-size: .84rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }

.table-wrap {
    overflow-x: auto; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 640px; }
th {
    text-align: left; padding: 14px 16px; background: var(--navy-050);
    border-bottom: 2px solid var(--line); color: var(--navy-900);
    font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
    white-space: nowrap;
}
td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--navy-050); }
.unread td { background: var(--gold-050); font-weight: 500; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { display: inline; margin: 0; }
.actions a, .actions button { font-size: .88rem; }

.message-card {
    background: var(--surface); border: 1px solid var(--line);
    border-top: 4px solid var(--navy); border-radius: var(--radius-lg); padding: 28px;
    box-shadow: var(--shadow-sm);
}
.message-body { white-space: pre-line; margin: 20px 0; line-height: 1.7; color: var(--ink-soft); }

.prose { font: 1.06rem/1.8 var(--font-serif); color: var(--ink-soft); }
.prose h2 { margin-top: 2em; font-size: 1.45rem; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: .5em; }
.prose strong { color: var(--ink); }

.danger-card { border-top: 4px solid var(--red); }
.danger-card ul { margin: 14px 0; padding-left: 20px; }
.danger-card li { margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   13. Rodapé
   -------------------------------------------------------------------------- */
.site-footer { background: var(--navy-900); color: #b8c9dc; margin-top: 72px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 56px 0 40px; }
.footer-grid > div { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-grid strong { color: #fff; font-family: var(--font-serif); font-size: 1.2rem; }
.footer-grid p { color: #93a8c0; font-size: .93rem; margin: 0; }
.footer-grid a { color: #cfe0f2; text-decoration: none; font-size: .93rem; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.footer-grid form { margin: 0; }
.footer-grid .link-btn { color: #cfe0f2; font-size: .93rem; }

.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 20px 0; font-size: .86rem; color: #8299b4; }

/* --------------------------------------------------------------------------
   14. Responsivo
   -------------------------------------------------------------------------- */
@media (max-width: 1050px) {
    .book-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-grid, .admin-grid, .messages-grid, .two-col { grid-template-columns: 1fr; gap: 36px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 260px 1fr; gap: 36px; }
    .reader-shell { grid-template-columns: 250px 1fr; }
    .reader-article, .reader-pager, .reader-toolbar { padding-inline: 32px; }
}

@media (max-width: 800px) {
    .menu-toggle { display: block; }
    .nav-inner { display: none; flex-direction: column; padding: 8px 0; }
    .nav-inner.open { display: flex; }
    .nav-inner a { min-height: 46px; border-bottom: 1px solid rgba(255, 255, 255, .12); border-left: 3px solid transparent; }
    .nav-inner a:hover { border-bottom-color: rgba(255, 255, 255, .12); border-left-color: var(--gold); }
    .nav-inner .nav-admin { margin-left: 0; }
    .book-grid, .detail-grid, .compare { grid-template-columns: 1fr; }
    .detail-cover { width: min(300px, 100%); }
    .filters { flex-direction: column; align-items: stretch; }
    .filter-actions { margin-bottom: 0; }
    .reader-shell { grid-template-columns: 1fr; }
    .reader-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .section { padding: 48px 0; }
    .hero { padding: 48px 0; }
    .reader-article, .reader-pager, .reader-toolbar { padding-inline: 24px; }
    .reader-article { padding-top: 36px; }
}

@media (max-width: 600px) {
    .container { padding: 0 18px; }
    .top-strip span { display: none; }
    .header-main { min-height: 78px; }
    .brand-mark { width: 46px; height: 46px; font-size: 1rem; }
    .brand strong { font-size: 1.2rem; }
    .brand small { display: none; }
    .book-card { grid-template-columns: 92px 1fr; gap: 16px; padding: 16px; }
    .form-two, .stats, .book-grid { grid-template-columns: 1fr; }
    .reading-list article { grid-template-columns: 80px 1fr; gap: 16px; padding: 16px; }
    .reader-pager { grid-template-columns: 1fr; }
    .reader-pager div:last-child { text-align: left; }
    .form-card, .auth .form-card, .order-card, .plan-card { padding: 22px; }
    .section-heading { flex-direction: column; align-items: flex-start; gap: 10px; }
    .price-block { padding: 16px; }
    .pdf-frame { height: 74vh; }
}

/* --------------------------------------------------------------------------
   15. Impressão — o leitor vira página limpa
   -------------------------------------------------------------------------- */
@media print {
    .top-strip, .site-header, .site-footer, .reader-sidebar,
    .reader-toolbar, .reader-pager, .alert, .pdf-bar, .breadcrumbs { display: none !important; }
    body { background: #fff; }
    .reader-shell { display: block; }
    .reader-article { max-width: 100%; padding: 0; }
    .reader-text { font-size: 12pt !important; line-height: 1.6; }
    a { text-decoration: none; color: #000; }
}

/* --------------------------------------------------------------------------
   16. Preferências do sistema
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
