/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS E FONTES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500&family=Montserrat:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500&family=Cormorant+SC:wght@500;600&family=DM+Sans:wght@400;500;600&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: radial-gradient(circle at 75% 50%, #112d24 0%, #06130e 60%, #030a07 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* ==========================================================================
   2. BARRA DE NAVEGAÇÃO (HEADER)
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 6%;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}
/* Logo Superior Esquerdo */
.logo-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-images-group {
    display: flex;
    align-items: center;
    gap: 8px; /* Espaçamento entre as duas imagens da logo */
}

.logo-img {
    height: 35px;
    width: auto;
    opacity: 0.85;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .title {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 500;
}

.logo-text .subtitle {
    font-size: 8px;
    letter-spacing: 1.5px;
    color: #8fa89e;
}
/* Menu Central */
.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-menu a,
.nav-right .nav-link {
    position: relative;
    display: inline-block;
    padding: 8px 0;
    font-size: 11px;
    letter-spacing: 2px;
    color: #a3b8b0;
    font-weight: 500;
}

.nav-menu a:hover, 
.nav-menu a.active-nav {
    color: #ffffff; /* Destaque para a aba da página atual */
}

/* Efeito sublinhado (igual ao da página inicial): aparece ao passar o mouse e fica na aba ativa */
.nav-menu a::after,
.nav-right .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active-nav::after,
.nav-right .nav-link:hover::after {
    transform: scaleX(1);
}
/* Lado Direito do Menu */
.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-size: 11px;
    letter-spacing: 2px;
    color: #a3b8b0;
}

.nav-link:hover {
    color: #ffffff;
}

.btn-entrar {
    font-size: 11px;
    letter-spacing: 2px;
    padding: 8px 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
}

.btn-entrar:hover {
    background: #ffffff;
    color: #06130e;
    border-color: #ffffff;
}

/* ==========================================================================
   3. CONTEÚDO PRINCIPAL DA HOME (HERO SECTION - INDEX)
   ========================================================================== */
.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
    padding: 100px 6% 40px 6%;
    gap: 40px;
}

.hero-content {
    flex: 1;
    max-width: 620px;
}

.tagline {
    font-size: 11px;
    letter-spacing: 3px;
    color: #708e82;
    margin-bottom: 25px;
    font-weight: 500;
}

.hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1.25;
    margin-bottom: 35px;
    color: #f5f7f6;
}

.description {
    font-size: 14px;
    color: #728a80;
    margin-bottom: 40px;
    max-width: 500px;
    font-weight: 400;
}
/* Botões de Ação */
.cta-buttons {
    display: flex;
    align-items: center;
    gap: 30px;
}

.btn-primary {
    background: #ffffff;
    color: #06130e;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    padding: 14px 28px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.btn-primary:hover {
    background: #e2e8e5;
    transform: translateY(-2px);
}

.btn-secondary {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #a3b8b0;
}

.btn-secondary:hover {
    color: #ffffff;
}
/* Ilustração da Direita (Emblema Grande) */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-showcase {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.emblem {
    max-width: 380px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 30px rgba(143, 168, 158, 0.15)); 
}

.brand-title {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    letter-spacing: 4px;
    font-weight: 400;
    margin-bottom: 5px;
    color: #edf2f0;
}

.brand-subtitle {
    font-size: 12px;
    letter-spacing: 4px;
    color: #8fa89e;
    font-weight: 400;
}
/* ==========================================================================
   4. ESTRUTURA PARA AS PÁGINAS INTERNAS (CATÁLOGO / GÊNEROS / BIBLIOTECA)
   ========================================================================= */
.page-padding {
    padding: 160px 6% 60px 6%;
    width: 100%;
    min-height: 100vh;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 400;
    margin-bottom: 8px;
    color: #edf2f0;
}

.section-subtitle {
    font-size: 14px;
    color: #728a80;
    margin-bottom: 40px;
}
/* Grid de Livros e Categorias */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
}

.book-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(143, 168, 158, 0.08);
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: block;
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: rgba(143, 168, 158, 0.25);
}

.book-cover-placeholder {
    width: 100%;
    height: 300px;
    background: #0d211a;
    border-radius: 4px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);

    /* CONFIGURAÇÃO DE ADAPTAÇÃO DA IMAGEM: */
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain; /* Faz a imagem se moldar perfeitamente sem esticar ou cortar */
}

.book-card h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #ffffff;
}

.book-card p {
    font-size: 11px;
    color: #728a80;
}
/* Estado de Página Vazia (Biblioteca) */
.empty-state {
    text-align: center;
    padding: 100px 0;
    color: #728a80;
}
/* ==========================================================================
   5. PAINEL DO ADMINISTRADOR / EDITOR (CRIAR OBRA & CAPÍTULOS)
   ========================================================================== */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.admin-header-title {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(143, 168, 158, 0.1);
    padding-bottom: 20px;
}

.admin-row {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

/* Upload de Capa */
.admin-col-cover {
    width: 220px;
    flex-shrink: 0;
}

.cover-upload-box {
    width: 100%;
    height: 310px;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(143, 168, 158, 0.2);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.cover-upload-box:hover {
    border-color: #708e82;
    background: rgba(255, 255, 255, 0.04);
}

/* Inputs e Formulários */
.admin-col-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 12px;
    letter-spacing: 1.5px;
    color: #8fa89e;
    text-transform: uppercase;
    font-weight: 500;
}

.form-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(143, 168, 158, 0.15);
    border-radius: 6px;
    padding: 12px 16px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: #708e82;
}

.form-textarea {
    height: 140px;
    resize: vertical;
    line-height: 1.5;
}
/* Gerenciador de Capítulos (Estilo Wattpad) */
.chapters-management-section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(143, 168, 158, 0.08);
    border-radius: 6px;
    padding: 24px;
}

.chapters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-section-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 400;
}

.btn-secondary-admin {
    background: transparent;
    border: 1px solid #708e82;
    color: #708e82;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary-admin:hover {
    background: #708e82;
    color: #06130e;
}

.chapters-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 5px;
}

.chapter-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(143, 168, 158, 0.1);
    border-radius: 4px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.chapter-item.active-chapter {
    border-color: #708e82;
    background: rgba(112, 142, 130, 0.08);
}

.chapter-item-details {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.delete-cap-btn {
    background: transparent;
    border: none;
    color: #728a80;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.delete-cap-btn:hover {
    color: #ff4d4d;
}
/* ==========================================================================
   EDITOR DE DIAGRAMAÇÃO CORRIGIDO (ESTILO WORD)
========================================================================== */
.editor-section {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.word-toolbar {
    background: #0d211a;
    border: 1px solid rgba(143, 168, 158, 0.15);
    border-bottom: none;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.word-toolbar button {
    background: transparent;
    border: none;
    color: #a3b8b0;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}
.word-toolbar button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}
/* Ícones internos da barra */
.word-toolbar button i {
    font-size: 14px;
pointer-events: none; /* Evita que cliques buguem no ícone interno */
}
.toolbar-separator {
    width: 1px;
    height: 20px;
    background: rgba(143, 168, 158, 0.15);
    margin: 0 4px;
}
/* Área de Folha Limpa de Leitura FÍSICA E VISÍVEL */
.word-editor-container {
    background: #fdfdfd !important; /* Cor branca forçada de papel */
    border: 1px solid rgba(143, 168, 158, 0.25);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    min-height: 450px;
    padding: 50px 60px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.05);
    display: block !important; /* Garante renderização */
}
#rich-editor {
    outline: none;
    min-height: 350px;
    font-family: 'Playfair Display', serif !important;
    font-size: 17px;
    line-height: 1.8;
    text-align: justify;
    color: #111111 !important; /* Texto escuro garantido para o fundo claro */
    width: 100%;
}
.admin-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(143, 168, 158, 0.1);
    padding-top: 30px;
}
/* ==========================================================================
6. RESPONSIVIDADE (MEDIA QUERIES)
========================================================================== */
@media (max-width: 992px) {
.navbar {
    padding: 20px 4%;
}
.nav-menu {
    display: none; /* Recolhe o menu padrão em telas menores */
}
.hero-container {
    flex-direction: column-reverse;
    justify-content: center;
    text-align: center;
    padding-top: 140px;
}
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.description {
    margin-left: auto;
    margin-right: auto;
}
.cta-buttons {
    flex-direction: column;
    gap: 20px;
}
.hero-content h1 {
    font-size: 32px;
}
.emblem {
    max-width: 280px;
}
.page-padding {
    padding-top: 130px;
    text-align: center;
}
}
@media (max-width: 768px) {
.admin-row {
    flex-direction: column;
    align-items: center;
}
.admin-col-cover {
    width: 100%;
    max-width: 260px;
}
.word-editor-container {
    padding: 30px 20px;
}
}

/* ==========================================================================
   7. CATÁLOGO: BUSCA, FILTROS E CARDS
   ========================================================================== */
.catalog-toolbar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 36px;
}

.catalog-search {
    max-width: 420px;
    width: 100%;
}

.genre-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-chip {
    background: transparent;
    border: 1px solid rgba(143, 168, 158, 0.3);
    color: #a3b8b0;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.genre-chip:hover {
    color: #ffffff;
    border-color: #ffffff;
}

.genre-chip.active {
    background: #ffffff;
    color: #06130e;
    border-color: #ffffff;
}

.book-card {
    cursor: pointer;
}

.book-card .book-cover-placeholder {
    height: auto;
    aspect-ratio: 2 / 3;
    background-size: cover;
}

.book-card .book-genre-tag {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #708e82;
    margin-top: 6px;
}

.book-progress {
    height: 3px;
    background: rgba(143, 168, 158, 0.15);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.book-progress span {
    display: block;
    height: 100%;
    background: #a9cdbc;
}

.book-card .btn-remove-book {
    margin-top: 12px;
    background: none;
    border: none;
    color: #728a80;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
}

.book-card .btn-remove-book:hover {
    color: #ff4d4d;
}

/* ==========================================================================
   8. INTERFACE DE LEITURA (MODAL TELA CHEIA)
   ========================================================================== */
.reader-modal {
    /* Temas da folha: papel (padrão), sépia e noite */
    --paper-bg: #fdfdfd;
    --paper-ink: #111111;
    --paper-cap: #112d24;
    --paper-line: rgba(0, 0, 0, 0.14);

    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #030a07;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.reader-modal[data-tema="sepia"] {
    --paper-bg: #f3ead6;
    --paper-ink: #41311f;
    --paper-cap: #6b4a22;
    --paper-line: rgba(65, 49, 31, 0.22);
}

.reader-modal[data-tema="noite"] {
    --paper-bg: #0c1914;
    --paper-ink: #cdd8d2;
    --paper-cap: #a9cdbc;
    --paper-line: rgba(205, 216, 210, 0.16);
}

.reader-modal.open-reader {
    display: block;
}

/* Botão flutuante de fechar */
.reader-close-btn {
    position: absolute;
    top: 18px;
    right: 4%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(143, 168, 158, 0.25);
    color: #ffffff;
    padding: 9px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
    z-index: 1100;
    transition: all 0.3s ease;
}

.reader-close-btn:hover {
    background: #ff4d4d;
    border-color: #ff4d4d;
}

/* Controle de telas */
.reader-screen-content {
    display: none;
    width: 100%;
    height: 100%;
}

.reader-screen-content.active-screen {
    display: flex;
}

/* ---- Tela 1: informações e sinopse ---- */
#reader-info-screen {
    align-items: center;
    justify-content: center;
    padding: 40px 6%;
    overflow-y: auto;
}

.reader-info-container {
    display: flex;
    gap: 50px;
    max-width: 900px;
    width: 100%;
    align-items: center;
    margin: auto;
}

.reader-info-cover {
    width: 260px;
    height: 380px;
    background-color: #0d211a;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.reader-info-details {
    flex: 1;
    min-width: 0;
}

.reader-info-details .section-title {
    font-size: 32px;
    color: #ffffff;
}

.reader-meta-genre {
    font-size: 11px;
    letter-spacing: 1px;
    color: #8fa89e;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.reader-meta-count {
    font-size: 11px;
    color: #728a80;
    margin-top: 14px;
}

.reader-synopsis-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(143, 168, 158, 0.15);
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.reader-synopsis-box p {
    font-size: 14px;
    color: #a3b8b0;
    line-height: 1.6;
}

.reader-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
    align-items: center;
}

.btn-reader-save {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(143, 168, 158, 0.3);
    padding: 13px 25px;
    border-radius: 25px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reader-save:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-reader-save.saved {
    border-color: #708e82;
}

.btn-reader-start {
    cursor: pointer;
    border: none;
    padding: 14px 36px;
    font-family: 'Montserrat', sans-serif;
}

/* ---- Tela 2: leitura do capítulo ---- */
#reader-text-screen {
    flex-direction: row;
}

.reader-navigation-bar {
    width: 280px;
    background: #06130e;
    border-right: 1px solid rgba(143, 168, 158, 0.15);
    padding: 36px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    flex-shrink: 0;
}

.reader-back-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: #a3b8b0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
    transition: color 0.3s ease;
}

.reader-back-btn:hover {
    color: #ffffff;
}

.reader-book-name {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: #f5f7f6;
    line-height: 1.3;
}

.reader-chapter-select-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    flex: 1;
}

.reader-chapter-select-box .form-label {
    font-size: 10px;
    color: #8fa89e;
    letter-spacing: 1px;
    font-weight: 500;
}

#reader-chapters-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 5px;
}

.reader-cap-btn-item {
    background: rgba(255, 255, 255, 0.03);
    color: #a3b8b0;
    border: 1px solid rgba(143, 168, 158, 0.15);
    padding: 12px;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-weight: 500;
}

.reader-cap-btn-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.reader-cap-btn-item.is-active {
    background: rgba(112, 142, 130, 0.14);
    color: #ffffff;
    border-color: #708e82;
    font-weight: 600;
}

.reader-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px calc(4% + 150px) 14px 32px;
    background: #06130e;
    border-bottom: 1px solid rgba(143, 168, 158, 0.12);
}

.reader-toolbar-title {
    font-size: 11px;
    letter-spacing: 2px;
    color: #8fa89e;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.reader-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.reader-tool-sep {
    width: 1px;
    height: 20px;
    background: rgba(143, 168, 158, 0.3);
    margin: 0 4px;
}

.reader-tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(143, 168, 158, 0.25);
    color: #e9efec;
    border-radius: 16px;
    padding: 6px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.reader-tool-btn:hover {
    border-color: #ffffff;
}

.reader-tool-btn.is-active {
    background: #ffffff;
    color: #06130e;
    border-color: #ffffff;
}

.reader-cap-select {
    display: none;
    background: #06130e;
    color: #ffffff;
    border: 1px solid rgba(143, 168, 158, 0.3);
    border-radius: 16px;
    padding: 6px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    max-width: 60%;
}

.reader-progress {
    height: 3px;
    background: rgba(143, 168, 158, 0.12);
}

.reader-progress > div {
    height: 100%;
    width: 0;
    background: #a9cdbc;
    transition: width 0.15s ease;
}

/* Janela de visualização do livro aberto */
.book-page-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 40px 40px 80px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #030a07;
}

/* A folha de papel diagramada */
.book-page-paper {
    background: var(--paper-bg);
    max-width: 750px;
    width: 100%;
    padding: 60px 80px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    height: fit-content;
    transition: background 0.25s ease;
}

.reader-chapter-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    color: var(--paper-ink);
    opacity: 0.55;
    margin-bottom: 14px;
}

.reader-chapter-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    margin-bottom: 40px;
    color: var(--paper-ink);
}

/* Texto do capítulo: preserva a diagramação feita no editor (recuos, capitulares, alinhamento) */
.reader-content {
    font-family: 'Playfair Display', serif;
    font-size: var(--leitor-fonte, 18px);
    line-height: 1.8;
    text-align: justify;
    color: var(--paper-ink);
    width: 100%;
    overflow-wrap: break-word;
}

.reader-content,
.reader-content * {
    color: var(--paper-ink) !important;
    background: transparent !important;
}

/* fonte única: nada colado de fora muda a fonte do texto */
.reader-content *:not(span[style*="float"]) { font-family: inherit !important; }
.reader-content :is(p, span, div, b, i, u, strong, em, li, blockquote):not(span[style*="float"]) {
    font-size: inherit !important;
    line-height: inherit !important;
}

.reader-content span[style*="float"] {
    color: var(--paper-cap) !important;
}

.reader-content img {
    max-width: 100%;
    height: auto;
}

.reader-footer-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--paper-line);
}

.reader-footer-btn {
    background: none;
    border: 1px solid var(--paper-line);
    color: var(--paper-ink);
    padding: 10px 18px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.reader-footer-btn:hover:not([disabled]) {
    background: var(--paper-ink);
    color: var(--paper-bg);
}

.reader-footer-btn[disabled] {
    opacity: 0.35;
    cursor: default;
}

/* Responsividade do leitor */
@media (max-width: 768px) {
    #reader-info-screen {
        padding-top: 90px;
        align-items: flex-start;
    }
    .reader-info-container {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    .reader-info-cover {
        width: 200px;
        height: 290px;
    }
    .reader-actions {
        justify-content: center;
    }
    #reader-text-screen {
        flex-direction: column;
    }
    .reader-navigation-bar {
        display: none;
    }
    .reader-cap-select {
        display: block;
    }
    .reader-toolbar {
        flex-wrap: wrap;
        padding: 64px 16px 12px 16px;
    }
    .reader-toolbar-title {
        display: none;
    }
    .reader-tools {
        flex-wrap: wrap;
    }
    .book-page-viewport {
        padding: 16px 10px 60px;
    }
    .book-page-paper {
        padding: 30px 20px;
    }
}

/* ==========================================================================
   9. PAINEL ADMIN: ANÁLISE DE LEITURA, GRÁFICOS E GERENCIAMENTO
   ========================================================================== */
.tab-panel[hidden] { display: none !important; }
.muted { font-size: 12px; color: #728a80; }
.muted.erro { color: #ff4d4d; }

.dash-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.range-group { display: flex; gap: 8px; }
.range-btn {
    background: transparent; border: 1px solid rgba(143, 168, 158, 0.3); color: #a3b8b0;
    font: 500 11px 'Montserrat', sans-serif; letter-spacing: 1.5px;
    padding: 8px 18px; border-radius: 20px; cursor: pointer; transition: all 0.3s ease;
}
.range-btn:hover { color: #ffffff; border-color: #ffffff; }
.range-btn.active { background: #ffffff; color: #06130e; border-color: #ffffff; }
.demo-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-box[hidden] { display: none; }
.demo-badge {
    font-size: 10px; letter-spacing: 2px; color: #e0b34a;
    border: 1px solid rgba(224, 179, 74, 0.45); border-radius: 20px; padding: 6px 14px;
}

.panel {
    background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(143, 168, 158, 0.15);
    border-radius: 6px; padding: 24px; min-width: 0;
}
.panel-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 400; color: #edf2f0; margin-bottom: 4px; }
.panel-sub { font-size: 12px; color: #728a80; margin-bottom: 20px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.kpi-label { font-size: 10px; letter-spacing: 2px; color: #728a80; text-transform: uppercase; margin-bottom: 10px; }
.kpi-value { font-family: 'Playfair Display', serif; font-size: 34px; line-height: 1.1; color: #f5f7f6; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }

/* Gráfico de linha/área */
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-box .grid-line { stroke: rgba(143, 168, 158, 0.12); stroke-width: 1; }
.chart-box .axis-text { fill: #728a80; font: 400 11px 'Montserrat', sans-serif; }
.chart-box .serie-line { fill: none; stroke: #9fc2b1; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .cross { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-box .dot { fill: #9fc2b1; stroke: #06130e; stroke-width: 2; }

/* Gráficos de barras horizontais */
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 12px; padding: 7px 0; cursor: default; }
.bar-label { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12px; color: #dfe8e4; }
.bar-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-label img { width: 22px; height: 30px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.bar-track { height: 10px; background: rgba(143, 168, 158, 0.1); border-radius: 0 4px 4px 0; }
.bar-fill { height: 100%; background: #708e82; border-radius: 0 4px 4px 0; transition: background 0.2s ease, width 0.4s ease; }
.bar-row:hover .bar-fill { background: #a9cdbc; }
.bar-value { font-size: 11px; color: #a3b8b0; min-width: 62px; text-align: right; }

.tip {
    position: fixed; z-index: 50; pointer-events: none; background: #0d211a;
    border: 1px solid rgba(143, 168, 158, 0.35); border-radius: 6px; padding: 8px 12px;
    font-size: 12px; color: #ffffff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.tip small { display: block; color: #8fa89e; font-size: 11px; }

/* Tabela alternativa (acessibilidade) */
.tabela-details { margin-bottom: 24px; }
.tabela-details summary { cursor: pointer; font-size: 11px; letter-spacing: 2px; color: #a3b8b0; text-transform: uppercase; }
.tabela-details table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 12px; }
.tabela-details th { text-align: left; font-weight: 500; font-size: 10px; letter-spacing: 1.5px; color: #728a80; text-transform: uppercase; }
.tabela-details th, .tabela-details td { padding: 8px 10px; border-bottom: 1px solid rgba(143, 168, 158, 0.1); }
.tabela-details td:nth-child(n+3), .tabela-details th:nth-child(n+3) { text-align: right; }

/* Gerenciar obras e capítulos */
.gerenciar-item { border: 1px solid rgba(143, 168, 158, 0.12); border-radius: 6px; margin-bottom: 12px; background: rgba(255, 255, 255, 0.015); }
.gerenciar-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
.gerenciar-head img { width: 36px; height: 50px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.gerenciar-info { flex: 1; min-width: 160px; }
.gerenciar-info strong { display: block; font-size: 14px; font-weight: 500; color: #ffffff; }
.gerenciar-info span { font-size: 11px; color: #728a80; }
.gerenciar-actions { display: flex; gap: 10px; }
.btn-danger-admin {
    background: transparent; border: 1px solid rgba(255, 77, 77, 0.6); color: #ff4d4d;
    padding: 8px 16px; border-radius: 4px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.3s ease;
}
.btn-danger-admin:hover { background: #ff4d4d; color: #06130e; }
.caps-box { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 16px 16px; }
.cap-row { cursor: default; }
.cap-row i.fa-file-lines { color: #708e82; margin-right: 10px; }

@media (max-width: 900px) {
    .charts-grid { grid-template-columns: 1fr; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100% !important; }
}

/* ==========================================================================
   0. PÁGINA INICIAL (index.html) — fontes Cormorant SC / Cormorant Garamond / DM Sans
   Todas as classes começam com "home-" para não interferir nas páginas internas.
   ========================================================================== */
body.home-page {
    --bg-top: #0a1c15;
    --bg-bottom: #06120d;
    --glow: rgba(36, 104, 77, 0.62);
    --text: #eceeea;
    --text-soft: #a3afa8;
    --text-muted: #8f9d95;
    --line: rgba(255, 255, 255, 0.07);
    --font-title: "Cormorant SC", "Cormorant Garamond", serif;
    --font-body: "Cormorant Garamond", Georgia, serif;
    --font-ui: "DM Sans", system-ui, sans-serif;
    --container: 1200px;
    --nav-height: 65px;
    --logo-icon-height: 40px;   /* leque de flechas da navbar */
    --logo-text-height: 36px;   /* texto "Oito Flechas" da navbar */
    --emblem-width: min(450px, 65vh);   /* emblema (acompanha a altura da tela) */

    font-family: var(--font-ui);
    color: var(--text);
    line-height: normal;
    background-color: var(--bg-bottom);
    background-image:
        radial-gradient(ellipse 360px 420px at 72.5% 48vh, var(--glow) 0%, rgba(36, 104, 77, 0.25) 45%, transparent 100%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 75%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
}

.home-page img { display: block; max-width: 100%; }

/* ---- Navbar ---- */
.home-navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--nav-height);
    background: rgba(6, 18, 13, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.home-navbar__inner {
    max-width: var(--container);
    height: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.home-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-self: start;
}

.home-brand__img {
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.home-brand__img--icon { height: var(--logo-icon-height); }
.home-brand__img--text { height: var(--logo-text-height); }

.home-nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.home-nav__link {
    position: relative;
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.home-nav__link:hover,
.home-nav__link.is-active { color: var(--text); }

.home-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--text), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.home-nav__link:hover::after,
.home-nav__link.is-active::after { transform: scaleX(1); }

.home-navbar__actions { justify-self: end; }

/* ---- Botões ---- */
.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.home-btn--outline {
    padding: 9px 24px;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.home-btn--outline:hover { background: rgba(255, 255, 255, 0.08); }

.home-btn--primary {
    height: 48px;
    padding: 0 32px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #0b1a14;
    background: linear-gradient(135deg, #f1f1ed 0%, #c9ccc6 100%);
    box-shadow: 0 6px 30px rgba(220, 230, 225, 0.16);
}

.home-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(220, 230, 225, 0.28);
}

.home-btn__icon { transition: transform 0.25s ease; }
.home-btn--primary:hover .home-btn__icon { transform: translateX(4px); }

/* ---- Tela principal ---- */
.home-hero {
    height: calc(100vh - var(--nav-height));   /* a tela inicial ocupa exatamente a janela */
    min-height: 480px;
    padding: 24px 0 32px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.home-hero__inner {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 520px minmax(0, 1fr);
    grid-template-areas:
        "content emblem"
        "cta     cta";
    column-gap: 40px;
    row-gap: 28px;
    align-items: center;
}

.home-hero__content { grid-area: content; }

.home-hero__eyebrow {
    margin: 0 0 16px;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.home-hero__title {
    margin: 0 0 20px;
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 3.2rem;
    text-align: center;       /* título justificado */
    line-height: 1.02;
    letter-spacing: 0.005em;
    color: var(--text);
}

.home-hero__text {
    margin: 0;
    max-width: 520px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.55;
    color: var(--text-soft);
}

.home-hero__emblem {
    grid-area: emblem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-emblem__img {
    width: min(var(--emblem-width), 100%);
    height: auto;
    object-fit: contain;
}

.home-hero__cta {
    grid-area: cta;
    display: flex;
    align-items: center;
}

@media (max-width: 1240px) {
    .home-navbar__inner,
    .home-hero__inner { padding-left: 24px; padding-right: 24px; }
    .home-hero__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
    .home-hero__title { font-size: clamp(2.3rem, 4.4vw, 3.2rem); }
}

@media (max-width: 900px) {
    .home-hero { height: auto; min-height: calc(100vh - var(--nav-height)); padding-top: 40px; }
    .home-hero__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "content"
            "emblem"
            "cta";
    }
    body.home-page {
        background-image:
            radial-gradient(ellipse 340px 380px at 50% 760px, var(--glow) 0%, transparent 100%),
            linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 75%);
    }
}

@media (max-width: 640px) {
    body.home-page {
        --logo-icon-height: 30px;
        --logo-text-height: 28px;
    }
    .home-navbar__inner,
    .home-hero__inner { padding-left: 16px; padding-right: 16px; }
    .home-brand { gap: 8px; }
    .home-nav { gap: 12px; }
    .home-nav__link { font-size: 0.64rem; letter-spacing: 0.08em; }
    .home-btn--outline { padding: 7px 14px; font-size: 0.7rem; }
    .home-navbar__inner { grid-template-columns: auto 1fr auto; column-gap: 10px; }
    .home-page .home-brand__img--text { display: none; }   /* só o leque de flechas cabe ao lado do menu */
    .home-nav { justify-content: center; }
    .home-hero__text { font-size: 1.02rem; }
    .home-hero__title { font-size: 2.3rem; }
    body.home-page { --emblem-width: min(260px, 60vw); }
}

@media (max-width: 420px) {
    .home-navbar__inner { column-gap: 6px; }
    .home-nav { gap: 8px; min-width: 0; }
    .home-nav__link { font-size: 0.58rem; letter-spacing: 0.04em; }
    .home-btn--outline { padding: 6px 10px; font-size: 0.64rem; }
}


/* janelas baixas (ex.: notebook com barra de favoritos): deixa a página rolar em vez de espremer */
@media (max-height: 520px) {
    .home-hero { height: auto; }
}

/* ==========================================================================
   10. LOGIN / CADASTRO / MINHA CONTA
   ========================================================================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-bottom: 80px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(143, 168, 158, 0.18);
    border-radius: 12px;
    padding: 36px 32px;
    text-align: left;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.auth-title {
    font-size: 30px;
    margin-bottom: 6px;
}

.auth-sub {
    font-size: 13px;
    color: #8fa89e;
    margin-bottom: 24px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(143, 168, 158, 0.15);
    border-radius: 24px;
    margin-bottom: 22px;
}

.auth-tab {
    background: transparent;
    border: none;
    color: #a3b8b0;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 10px 0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab:hover { color: #ffffff; }

.auth-tab.active {
    background: #ffffff;
    color: #06130e;
}

.auth-field { margin-bottom: 16px; }

.auth-field label {
    display: block;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #8fa89e;
    margin-bottom: 8px;
}

.auth-input { width: 100%; }
.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 84px; }

.auth-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8fa89e;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    letter-spacing: 1.5px;
    cursor: pointer;
    padding: 6px;
}

.auth-eye:hover { color: #ffffff; }

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, #f1f1ed 0%, #c9ccc6 100%);
    color: #0b1a14;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(220, 230, 225, 0.14);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.auth-submit:hover:not([disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(220, 230, 225, 0.26);
}

.auth-submit[disabled] { opacity: 0.6; cursor: default; }

.auth-submit--ghost {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(143, 168, 158, 0.3);
    box-shadow: none;
}

.auth-submit--link { text-decoration: none; }

.auth-msg {
    font-size: 12px;
    line-height: 1.5;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.auth-msg[hidden] { display: none; }

.auth-msg--erro {
    color: #ff8a8a;
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.35);
}

.auth-msg--ok {
    color: #b9dccb;
    background: rgba(112, 142, 130, 0.14);
    border: 1px solid rgba(112, 142, 130, 0.45);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: #728a80;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(143, 168, 158, 0.2);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    background: #ffffff;
    color: #1f1f1f;
    border: none;
    border-radius: 24px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(255, 255, 255, 0.18);
}

#google-btn-real { display: flex; justify-content: center; }
#google-btn-real[hidden] { display: none; }

.auth-google-test {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.auth-google-test[hidden] { display: none; }

/* Mensagem de autorização de e-mails */
.auth-consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    margin: 4px 0 18px;
    border: 1px solid rgba(143, 168, 158, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
    line-height: 1.6;
    color: #a3b8b0;
    cursor: pointer;
}

.auth-consent input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    accent-color: #a9cdbc;
    cursor: pointer;
}

.auth-consent strong { color: #e6eeea; font-weight: 600; }

.auth-note {
    font-size: 11px;
    line-height: 1.55;
    color: #728a80;
}

.auth-note code {
    font-size: 11px;
    color: #a9cdbc;
}

.auth-legal { margin-top: 22px; }

.auth-account-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
}

/* ==========================================================================
   11. PERFIL DO LEITOR, AVALIAÇÕES, ESTRELAS E SELOS DE STATUS
   ========================================================================== */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #12342a;
    border: 1px solid rgba(143, 168, 158, 0.35);
    color: #e6eeea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: 14px; }
.avatar--xl { width: 104px; height: 104px; font-size: 42px; }

/* Estrelas */
.stars {
    display: inline-flex;
    gap: 2px;
    font-size: 15px;
    line-height: 1;
    color: #3d5a4e;
}

.stars .on { color: #e0b34a; }

.rating-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #a3b8b0;
}

.rating-summary--card { justify-content: center; margin-top: 8px; font-size: 11px; }
.rating-summary--card .stars { font-size: 13px; }

.star-input { display: flex; gap: 4px; }

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
    color: #3d5a4e;
    padding: 0 2px;
    transition: transform 0.15s ease, color 0.15s ease;
}

.star-btn.on { color: #e0b34a; }
.star-btn:hover { transform: scale(1.15); }
.star-btn:focus-visible { outline: 2px solid #a9cdbc; border-radius: 4px; }

/* Selos de status */
.status-tag {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(143, 168, 158, 0.35);
    color: #8fa89e;
    margin: 8px 4px 0;
}

.status-tag--ok { color: #a9cdbc; border-color: rgba(169, 205, 188, 0.55); }
.status-tag--new { color: #e0b34a; border-color: rgba(224, 179, 74, 0.55); }

/* Perfil do leitor */
.profile-page { max-width: 1100px; margin: 0 auto; text-align: left; }

.profile-hero {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.profile-hero-info { min-width: 0; }

.profile-hero-info h1 {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 400;
    color: #edf2f0;
    overflow-wrap: anywhere;
}

.profile-email { font-size: 13px; color: #728a80; overflow-wrap: anywhere; }

.profile-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 14px; }

.profile-stat strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 400;
    color: #f5f7f6;
}

.profile-stat span {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #728a80;
}

.profile-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    margin-bottom: 24px;
    border: 1px solid rgba(224, 179, 74, 0.4);
    border-radius: 8px;
    background: rgba(224, 179, 74, 0.06);
    font-size: 13px;
    color: #e6d6a8;
}

.profile-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 34px;
    border-bottom: 1px solid rgba(143, 168, 158, 0.15);
}

.profile-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 12px 18px;
    color: #8fa89e;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.25s ease;
}

.profile-tab:hover { color: #ffffff; }
.profile-tab.active { color: #ffffff; border-bottom-color: #a9cdbc; }
.profile-panel[hidden] { display: none; }

.shelf { margin-bottom: 52px; }

.shelf-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 400;
    color: #edf2f0;
    margin-bottom: 4px;
}

.shelf-sub { font-size: 12px; color: #728a80; margin-bottom: 22px; }

.shelf-empty {
    padding: 28px;
    border: 1px dashed rgba(143, 168, 158, 0.25);
    border-radius: 8px;
    font-size: 13px;
    color: #728a80;
    text-align: center;
}

.shelf-empty a { color: #a9cdbc; text-decoration: underline; }

.book-card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

.mini-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(143, 168, 158, 0.3);
    color: #ffffff;
    border-radius: 16px;
    padding: 7px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mini-btn:hover { background: #ffffff; color: #06130e; }
.mini-btn--primary { background: #ffffff; color: #06130e; border-color: #ffffff; }
.mini-btn--primary:hover { background: #d8dcd6; }
.mini-btn--danger { color: #ff8a8a; border-color: rgba(255, 77, 77, 0.45); }
.mini-btn--danger:hover { background: #ff4d4d; border-color: #ff4d4d; color: #06130e; }

/* Formulário do perfil */
.profile-form { max-width: 520px; }
.profile-form .auth-field label { margin-bottom: 8px; }
.photo-row { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; flex-wrap: wrap; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-hint { font-size: 11px; color: #728a80; }
.profile-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 400;
    color: #edf2f0;
    margin: 36px 0 14px;
}

/* Avaliações */
.review-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(143, 168, 158, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.review-body { flex: 1; min-width: 0; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.review-name { font-size: 13px; font-weight: 600; color: #ffffff; }
.review-date { font-size: 11px; color: #728a80; }
.review-book { font-family: 'Playfair Display', serif; font-size: 18px; color: #edf2f0; margin-bottom: 6px; }
.review-text { font-size: 13px; line-height: 1.6; color: #b7c7c0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-thumb { width: 54px; height: 80px; border-radius: 3px; background-size: cover; background-position: center; background-color: #0d211a; flex-shrink: 0; }
.review-actions { display: flex; gap: 8px; margin-top: 12px; }

.review-form {
    padding: 20px;
    margin: 6px 0 26px;
    border: 1px solid rgba(143, 168, 158, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}

.review-form h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; color: #edf2f0; margin-bottom: 12px; }
.review-textarea { width: 100%; height: 100px; resize: vertical; margin-top: 14px; line-height: 1.5; }
.review-counter { font-size: 11px; color: #728a80; text-align: right; margin: 4px 0 12px; }
.review-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.review-form-actions .auth-submit { width: auto; padding: 0 28px; }

/* Tela de avaliações dentro do leitor */
#reader-reviews-screen {
    flex-direction: column;
    padding: 90px 6% 40px;
    overflow-y: auto;
}

.reader-reviews-container { max-width: 720px; width: 100%; margin: 0 auto; }
.reader-reviews-container .section-title { font-size: 28px; color: #ffffff; margin-top: 18px; }
.reader-reviews-summary { display: flex; align-items: center; gap: 12px; margin: 6px 0 24px; font-size: 13px; color: #a3b8b0; }
.reader-reviews-summary .stars { font-size: 20px; }

.reader-rating-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }

/* Botão de status da obra no admin */
.btn-toggle-status {
    background: transparent;
    border: 1px solid rgba(143, 168, 158, 0.35);
    color: #a3b8b0;
    border-radius: 20px;
    padding: 9px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-toggle-status:hover { color: #ffffff; border-color: #ffffff; }
.btn-toggle-status.is-on { background: #a9cdbc; border-color: #a9cdbc; color: #06130e; }

@media (max-width: 640px) {
    .profile-hero { flex-direction: column; text-align: center; }
    .profile-stats { justify-content: center; }
    .profile-tab { padding: 10px 12px; letter-spacing: 1px; }
    .review-card { flex-direction: column; }
}

/* Admin: o editor de capítulos usa sempre a mesma fonte do leitor */
#rich-editor *:not(span[style*="float"]) {
    font-family: inherit !important;
}
#rich-editor :is(p, span, div, b, i, u, strong, em, li, blockquote):not(span[style*="float"]) {
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    background: transparent !important;
}

/* ===== Menu visível só para quem fez login ===== */
[data-requer-login] { display: none !important; }
html.of-logado [data-requer-login] { display: list-item !important; }

/* ===== Alerta de gatilhos ===== */
.trigger-warning {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 18px;
    padding: 12px 16px;
    border: 1px solid rgba(224, 179, 74, 0.55);
    border-left-width: 4px;
    border-radius: 4px;
    background: rgba(224, 179, 74, 0.08);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}
.trigger-warning[hidden] { display: none; }
.trigger-warning strong { color: #e0b34a; letter-spacing: 1px; font-size: 11px; text-transform: uppercase; }
.reader-content .trigger-warning, .reader-content .trigger-warning * { color: var(--paper-ink) !important; }
.reader-content .trigger-warning strong { color: #9a6a00 !important; }

/* ===== Trecho gratuito + convite para criar conta ===== */
.reader-preview-fade {
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
    padding-bottom: 40px;
}
.reader-gate {
    margin: 10px auto 0;
    max-width: 520px;
    padding: 28px 24px;
    text-align: center;
    border: 1px solid var(--paper-line, rgba(0,0,0,.2));
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
}
.reader-content .reader-gate h3 { font-family: 'Playfair Display', serif !important; font-size: 22px !important; margin-bottom: 10px; text-indent: 0; }
.reader-content .reader-gate p { font-size: 14px !important; line-height: 1.6 !important; opacity: .8; text-indent: 0; text-align: center; margin-bottom: 18px; }
.reader-gate-btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 24px;
    background: #112d24;
    color: #ffffff !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
}
.reader-content .reader-gate .reader-gate-btn { color: #ffffff !important; background: #112d24 !important; font-size: 12px !important; }

/* ===== Classificação indicativa ===== */
.rating-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 26px; padding: 0 6px; margin: 4px 6px 0 0;
    border-radius: 4px; font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700;
    color: #ffffff; vertical-align: middle;
}
.rating-badge--l  { background: #1f9d55; }
.rating-badge--10 { background: #1d6fd1; }
.rating-badge--12 { background: #d9a600; color: #1a1400; }
.rating-badge--14 { background: #e67e22; }
.rating-badge--16 { background: #d62d2d; }
.rating-badge--18 { background: #111111; border: 1px solid #666666; }
#modal-classificacao { margin: 0 0 14px; font-family: 'Montserrat', sans-serif; font-size: 12px; opacity: .9; }
#modal-classificacao[hidden] { display: none; }

.profile-banner[hidden], .profile-hero [hidden] { display: none !important; }

/* ===== Itens visíveis só para o administrador ===== */
html:not(.of-admin) [data-requer-admin] { display: none !important; }

/* ===== Barra de diagramação: botões com ícone ===== */
.word-toolbar { flex-wrap: wrap; }
.word-toolbar button.tool-icon { width: 36px; height: 34px; padding: 0; color: #9fc3b3; border: 1px solid rgba(143,168,158,.25); }
.word-toolbar button.tool-icon svg { width: 20px; height: 20px; pointer-events: none; }
.word-toolbar button.tool-icon:hover { color: #ffffff; border-color: rgba(255,255,255,.5); }

/* ===== Revisão automática de texto ===== */
.word-toolbar button.tool-revisar {
    width: auto; padding: 0 12px; gap: 8px; height: 34px;
    border: 1px solid rgba(169,205,188,.55); color: #a9cdbc;
    font-family: 'Montserrat', sans-serif; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
}
.word-toolbar button.tool-revisar:hover { background: #a9cdbc; color: #06130e; }
.word-toolbar button.tool-revisar svg { pointer-events: none; }
.revisao-painel {
    margin-top: 16px; padding: 18px 20px; border: 1px solid rgba(169,205,188,.35); border-radius: 6px;
    background: #0d211a; color: #d9e6df; font-family: 'Montserrat', sans-serif; font-size: 13px; line-height: 1.6;
}
.revisao-painel[hidden] { display: none; }
.revisao-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.revisao-topo > div { display: flex; gap: 8px; }
.revisao-painel h4 { margin: 16px 0 6px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #a9cdbc; }
.revisao-painel ul { margin: 0; padding-left: 18px; }
.revisao-painel li { margin-bottom: 6px; }
.revisao-trecho { display: block; opacity: .65; font-size: 12px; }
.revisao-nota { margin: 10px 0 0; opacity: .7; font-size: 12px; }

/* ===== Contos (leitura única) e imagens de gênero ===== */
.reader-conto .reader-chapter-select-box,
.reader-conto #reader-cap-select,
.reader-conto #btn-cap-anterior,
.reader-conto #btn-cap-proximo { display: none !important; }
.genre-item { display: flex; flex-direction: column; gap: 10px; }
.genre-admin-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.catalog-toolbar #abas-tipo { margin-bottom: 4px; }
.genre-item { height: 100%; } .genre-item > .book-card { flex: 1; } .genre-item .genre-admin-controls { margin-top: auto; }

/* ==========================================================================
   12. RODAPÉ + BANNER DE COOKIES + PÁGINAS LEGAIS
   ========================================================================== */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(6, 18, 13, 0.9);
    font-family: 'Montserrat', 'DM Sans', sans-serif;
    font-size: 12px;
    color: #8f9d95;
}
.site-footer__inner {
    max-width: 1200px; margin: 0 auto; padding: 16px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.site-footer a, .site-footer__cookies {
    color: #a3afa8; text-decoration: none; background: none; border: 0; padding: 0;
    font: inherit; letter-spacing: 0.04em; cursor: pointer;
}
.site-footer a:hover, .site-footer__cookies:hover { color: #ffffff; text-decoration: underline; }
body.home-page { --footer-height: 53px; }
body.home-page .site-footer__inner { padding-top: 0; padding-bottom: 0; min-height: calc(var(--footer-height) - 1px); }
body.home-page .home-hero { height: calc(100vh - var(--nav-height) - var(--footer-height)); }
@media (max-width: 900px) { body.home-page .home-hero { height: auto; } }
@media (max-height: 520px) { body.home-page .home-hero { height: auto; } }

.cookie-banner {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    width: min(760px, calc(100% - 24px)); z-index: 100000;
    display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; justify-content: space-between;
    padding: 14px 18px; border-radius: 10px;
    background: #0b1f17; color: #eceeea; border: 1px solid rgba(143, 168, 158, 0.35);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
    font-family: 'Montserrat', 'DM Sans', sans-serif; font-size: 13px; line-height: 1.5;
}
.cookie-banner__text { margin: 0; flex: 1 1 320px; }
.cookie-banner__text a { color: #9fd3bd; }
.cookie-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-btn {
    padding: 9px 14px; border-radius: 20px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.35); background: transparent; color: #eceeea;
    font: inherit; font-size: 12px; letter-spacing: 0.03em;
}
.cookie-btn:hover { background: rgba(255, 255, 255, 0.1); }
.cookie-btn--primary { background: #eceeea; color: #0b1f17; border-color: #eceeea; font-weight: 600; }
.cookie-btn--primary:hover { background: #ffffff; }

.legal-page { max-width: 820px; margin: 0 auto; padding: 0 0 20px; font-family: 'Montserrat', 'DM Sans', sans-serif; color: #c9d3ce; line-height: 1.75; font-size: 15px; }
.legal-page h2 { font-family: 'Playfair Display', serif; color: #ffffff; font-size: 22px; margin: 36px 0 10px; }
.legal-page h3 { color: #e4ebe7; font-size: 16px; margin: 22px 0 6px; }
.legal-page p, .legal-page li { margin: 0 0 12px; }
.legal-page p, .legal-page li { text-align: justify; hyphens: auto; }
.legal-page .legal-meta { text-align: left; }
.about-grid p { text-align: justify; hyphens: auto; }
.legal-page ul { padding-left: 22px; }
.legal-page a { color: #9fd3bd; }
.legal-page .legal-meta { font-size: 13px; opacity: .75; margin-bottom: 26px; }
.legal-page .legal-aviso { border-left: 3px solid #e0b34a; background: rgba(224, 179, 74, .08); padding: 10px 14px; border-radius: 4px; font-size: 13px; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 13.5px; }
.legal-page th, .legal-page td { border: 1px solid rgba(143, 168, 158, .25); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-page th { background: rgba(255, 255, 255, .04); color: #fff; }
.about-grid { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: start; }
.about-photo { width: 100%; aspect-ratio: 3 / 4; border-radius: 6px; border: 1px solid rgba(143, 168, 158, .25); background: #0d231a center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #4f6a5f; font-size: 13px; text-align: center; padding: 12px; }
@media (max-width: 700px) { .about-grid { grid-template-columns: 1fr; } .about-photo { max-width: 240px; } }

.danger-zone { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(179, 38, 30, 0.45); }
.danger-zone h3 { color: #ff8a80; font-size: 16px; margin-bottom: 8px; }
.danger-zone form { margin-top: 16px; }

/* ===== Espaços de anúncios (catálogo, contos e gêneros) ===== */
.ad-slot { max-width: 970px; margin: 28px auto; text-align: center; font-family: 'Montserrat', sans-serif; }
.ad-slot[hidden] { display: none; }
.ad-slot__label { display: block; margin-bottom: 6px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #6f8279; }
.ad-slot__placeholder {
    display: flex; align-items: center; justify-content: center; min-height: 90px;
    border: 1px dashed rgba(143, 168, 158, 0.35); border-radius: 6px;
    color: #6f8279; font-size: 12px; background: rgba(255, 255, 255, 0.015);
}
.ad-slot .adsbygoogle { min-height: 90px; }

/* telas muito estreitas (320px): menu das páginas internas mais compacto */
@media (max-width: 360px) {
    .navbar { padding-left: 3%; padding-right: 3%; gap: 6px; }
    .navbar .logo-img { height: 26px; width: auto; }
    .btn-entrar { padding: 8px 12px; font-size: 11px; letter-spacing: 1px; }
}

/* ==========================================================================
   13. LEITOR EM FORMATO DE LIVRO (páginas) + ELEMENTOS DE DIAGRAMAÇÃO
   ========================================================================== */
/* ---- elementos de diagramação (valem no leitor e no editor) ---- */
.reader-content h3, #rich-editor h3 {
    font-size: 1.28em; font-weight: 600; line-height: 1.3; text-align: center;
    margin: 1.5em 0 0.7em; text-indent: 0; break-after: avoid;
}
.reader-content blockquote, #rich-editor blockquote {
    margin: 1.1em 1.6em; padding: 0 0 0 1em; font-style: italic; text-indent: 0;
    border-left: 2px solid var(--paper-line, rgba(0,0,0,.2)); break-inside: avoid;
}
.reader-content p.cena, #rich-editor p.cena {
    text-align: center; letter-spacing: 0.7em; text-indent: 0 !important; margin: 1.3em 0;
}
.reader-content figure, #rich-editor figure {
    margin: 1.1em auto; text-align: center; text-indent: 0; break-inside: avoid;
}
.reader-content figure img, #rich-editor figure img { display: block; margin: 0 auto; width: 100%; max-width: 100%; height: auto; object-fit: contain; border-radius: 2px; }
.reader-content figure.fig-p, #rich-editor figure.fig-p { width: 45%; }
.reader-content figure.fig-m, #rich-editor figure.fig-m { width: 72%; }
.reader-content figure.fig-g, #rich-editor figure.fig-g { width: 100%; }
.reader-content figure.fig-pagina, #rich-editor figure.fig-pagina { width: 100%; }
.reader-content figcaption, #rich-editor figcaption { display: none; }
/* posição da imagem: centro (padrão), esquerda ou direita; "texto ao lado" faz o texto contornar */
.reader-content figure.fig-esq, #rich-editor figure.fig-esq { margin-left: 0; margin-right: auto; }
.reader-content figure.fig-dir, #rich-editor figure.fig-dir { margin-left: auto; margin-right: 0; }
.reader-content figure.fig-esq.fig-txt, #rich-editor figure.fig-esq.fig-txt { float: left; margin: 0.3em 1.1em 0.6em 0; }
.reader-content figure.fig-dir.fig-txt, #rich-editor figure.fig-dir.fig-txt { float: right; margin: 0.3em 0 0.6em 1.1em; }
.reader-content figure.fig-pagina, #rich-editor figure.fig-pagina { float: none; }
.reader-content .pg-break { height: 0; margin: 2.2em auto; border-top: 1px solid var(--paper-line, rgba(0,0,0,.2)); width: 30%; }
.reader-content hr { border: 0; border-top: 1px solid var(--paper-line); margin: 1.4em auto; width: 30%; }

/* ---- editor (admin): marcadores visíveis ---- */
#rich-editor .pg-break {
    height: auto; width: auto; border: 0; margin: 18px 0; text-align: center; user-select: none;
    color: #708e82; font: 600 11px 'Montserrat', sans-serif; letter-spacing: 2px; text-transform: uppercase;
    border-top: 2px dashed #9db5ab; padding-top: 6px;
}
#rich-editor .pg-break::before { content: "— quebra de página —"; }
#rich-editor figure { cursor: pointer; outline: 2px solid transparent; padding: 4px; }
#rich-editor figure.fig-sel { outline-color: #2e7d62; background: rgba(46,125,98,.08); }
#rich-editor figure.fig-pagina::after { content: "(ocupa a página inteira)"; display: block; font: 11px 'Montserrat', sans-serif; color: #708e82; }
#rich-editor::after { content: ""; display: block; clear: both; }

/* ---- palco do livro ---- */
.bk-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; background: #030a07; overflow: hidden; }
.bk-stage[hidden] { display: none; }
.bk-spread { position: relative; perspective: 2400px; transition: width .25s ease; }
.bk-sheet {
    position: absolute; top: 0; left: 0; background: var(--paper-bg);
    box-shadow: 0 14px 40px rgba(0,0,0,.5); border-radius: 3px; transition: background .25s ease;
}
.bk-duplo .bk-sheet--l { border-radius: 3px 0 0 3px; box-shadow: -6px 14px 40px rgba(0,0,0,.45); }
.bk-duplo .bk-sheet--r { border-radius: 0 3px 3px 0; box-shadow: 6px 14px 40px rgba(0,0,0,.45); }
.bk-duplo::after {      /* sombra da lombada */
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 70px; transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(0,0,0,.2) 46%, rgba(0,0,0,.34) 50%, rgba(0,0,0,.2) 54%, transparent);
    pointer-events: none; z-index: 3; opacity: .55;
}
.bk-view { position: absolute; overflow: hidden; z-index: 1; }
.bk-strip {
    position: absolute; left: 0; top: 0; column-fill: auto; box-sizing: content-box;
    font-size: var(--leitor-fonte, 18px); line-height: 1.7; text-align: justify; hyphens: auto; -webkit-hyphens: auto;
    orphans: 2; widows: 2;
}
.bk-strip p { margin: 0 0 0.35em; }
.bk-strip > * { max-width: 100%; }
.bk-strip .reader-preview-fade { -webkit-mask-image: none; mask-image: none; padding-bottom: 0; }
.bk-strip .reader-gate { break-inside: avoid; margin-top: 1.5em; }
.bk-strip figure img { max-height: calc(var(--bk-h) - 3.2em); width: 100%; height: auto; object-fit: contain; }
.bk-strip figure.fig-pagina {
    width: 100%; height: var(--bk-h); margin: 0; display: flex; flex-direction: column; justify-content: center;
    break-before: column; break-after: column;
}
.bk-strip figure.fig-pagina img { max-height: calc(var(--bk-h) - 3em); margin: 0 auto; object-fit: contain; }
.bk-strip .pg-break { height: 0; margin: 0; border: 0; width: 100%; break-after: column; }
.bk-strip .bk-chead { text-align: center; margin: 0 0 1.4em; break-inside: avoid; }
.bk-chead .bk-clabel { font: 500 0.6em 'Montserrat', sans-serif !important; letter-spacing: 0.3em; text-transform: uppercase; opacity: .55; margin: 0.6em 0 0.7em; text-indent: 0; text-align: center; }
.bk-chead .bk-ctitulo { font-size: 1.7em !important; font-weight: 600; line-height: 1.2 !important; margin: 0 0 0.35em; text-indent: 0; text-align: center; }
.bk-chead .bk-orn { letter-spacing: 0.6em; opacity: .5; font-size: .9em; text-indent: 0; text-align: center; margin: 0; }
.bk-num {
    position: absolute; bottom: 14px; text-align: center; z-index: 2;
    font: 500 11px 'Montserrat', sans-serif; letter-spacing: 1px; color: var(--paper-ink); opacity: .5; pointer-events: none;
}
.bk-fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; transform-style: preserve-3d; }
.bk-leaf { position: absolute; top: 0; transform-style: preserve-3d; will-change: transform; }
.bk-face {
    position: absolute; top: 0; left: 0; overflow: hidden; background: var(--paper-bg);
    -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 2px;
}
.bk-face--back { transform: rotateY(180deg); }
.bk-face--front::after, .bk-face--back::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(0,0,0,0) 35%);
}
.bk-face--back::after { background: linear-gradient(270deg, rgba(0,0,0,.18), rgba(0,0,0,0) 35%); }
.bk-leaf { box-shadow: 0 0 30px rgba(0,0,0,.35); }
.bk-clip { position: absolute; overflow: hidden; }
.bk-cover { position: absolute; top: 0; }
.bk-hit { position: absolute; top: 0; bottom: 0; background: none; border: 0; cursor: pointer; z-index: 5; padding: 0; }
.bk-hit--prev { left: 0; }
.bk-hit--next { right: 0; }
.bk-hit:hover { background: linear-gradient(90deg, rgba(0,0,0,.05), transparent); }
.bk-hit--next:hover { background: linear-gradient(270deg, rgba(0,0,0,.05), transparent); }

/* barra inferior do modo livro */
.bk-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 24px; background: #06130e; border-top: 1px solid rgba(143, 168, 158, 0.12);
    font: 500 12px 'Montserrat', sans-serif; color: #a3b8b0;
}
.bk-bar[hidden] { display: none; }
.bk-bar button {
    background: transparent; border: 1px solid rgba(143, 168, 158, 0.3); color: #e9efec; border-radius: 18px;
    padding: 7px 14px; font: inherit; cursor: pointer;
}
.bk-bar button:hover:not([disabled]) { border-color: #fff; }
.bk-bar button[disabled] { opacity: .35; cursor: default; }
.bk-bar .bk-pag { text-align: center; flex: 1; letter-spacing: 1px; }
@media (max-width: 768px) { .bk-bar { padding: 8px 12px; } .bk-bar button { padding: 6px 10px; font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .bk-leaf { transition: none !important; } }

.reader-conto #bk-cap-ant, .reader-conto #bk-cap-prox { visibility: hidden; }
.bk-hit { outline: none; -webkit-tap-highlight-color: transparent; }
.bk-hit--prev, .bk-hit--next { max-width: 22%; }
@media (max-width: 768px) {
    .reader-tool-sep { display: none; }
    .reader-tool-btn { padding: 5px 10px; font-size: 11px; }
}

/* ---- leitor em tela cheia ---- */
#reader-overlay:fullscreen { width: 100vw; height: 100vh; }
#reader-overlay:fullscreen .reader-navigation-bar { display: none; }
#reader-overlay:fullscreen #reader-text-screen { grid-template-columns: 1fr; }

/* ---- controles de imagem no editor ---- */
.img-ctl { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font: 12px 'Montserrat', sans-serif; color: #c7d6cf; }
.img-ctl label { display: inline-flex; align-items: center; gap: 6px; }
.img-ctl input[type=range] { width: 90px; accent-color: #2e7d62; }
.img-ctl output { min-width: 34px; }
.img-ctl__grp { display: inline-flex; gap: 2px; }
.img-ctl .tool-icon.is-on { background: #2e7d62; color: #fff; }
.img-ctl [disabled] { opacity: .4; }
#img-alca { position: fixed; width: 18px; height: 18px; border-radius: 3px; background: #2e7d62; border: 2px solid #fff; cursor: nwse-resize; z-index: 50; touch-action: none; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
#img-alca[hidden] { display: none; }

/* ---- redes sociais (rodapé, sobre o autor, admin) ---- */
ul.redes.redes { padding-left: 0; }
.redes { display: inline-flex; align-items: center; gap: 12px; margin: 0; padding: 0; list-style: none; }
.redes a { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid rgba(143, 168, 158, .35); color: #a3afa8; text-decoration: none; transition: color .15s, border-color .15s, background .15s; }
.redes a:hover, .redes a:focus-visible { color: #fff; border-color: #8fa89e; background: rgba(143, 168, 158, .15); text-decoration: none; }
.redes svg { width: 17px; height: 17px; fill: currentColor; }
.site-footer .redes a { width: 30px; height: 30px; }
.site-footer .redes svg { width: 15px; height: 15px; }
.site-footer__redes { display: inline-flex; align-items: center; gap: 12px; }
.redes-form { display: grid; gap: 12px; max-width: 520px; margin-top: 14px; }
.redes-form label { display: grid; gap: 4px; font-size: 12px; letter-spacing: .06em; color: #a3afa8; }
.redes-form input { padding: 10px 12px; border-radius: 6px; border: 1px solid rgba(143, 168, 158, .3); background: #06130e; color: #fff; font-size: 14px; }
.redes-bloco { margin-top: 28px; padding: 20px; border: 1px solid rgba(143, 168, 158, .2); border-radius: 8px; }
.redes-bloco h2 { margin: 0 0 4px; font-size: 16px; }


/* ============================================================
   14. LOGIN / CRIAR CONTA — painel dividido (marca | formulário)
   ============================================================ */
body.login-page { background: #06120d; }
body.login-page .site-footer { display: none; }
.login-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-split .login-brand { position: sticky; top: 0; height: 100vh; }

.login-brand {
    position: relative; display: flex; flex-direction: column; justify-content: space-between;
    padding: 48px; overflow: hidden;
    background:
        radial-gradient(ellipse 55% 45% at 50% 42%, rgba(46, 125, 98, 0.32) 0%, rgba(14, 60, 46, 0.18) 45%, transparent 75%),
        linear-gradient(180deg, #0a1f18 0%, #06130e 100%);
}
.login-back {
    align-self: flex-start; font-family: 'DM Sans', 'Montserrat', sans-serif; font-size: 12px;
    letter-spacing: 0.14em; color: #a3b5ad; text-decoration: none; z-index: 1;
}
.login-back:hover { color: #fff; }
.login-logo {
    position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%);
    width: min(430px, 70%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none;
}
.login-logo__img { display: block; width: 100%; height: auto; }
.login-logo__img:first-child { width: 80%; filter: drop-shadow(0 0 28px rgba(160, 220, 190, 0.18)); }
.login-quote { margin: 0; z-index: 1; max-width: 360px; }
.login-quote blockquote {
    margin: 0 0 12px; font-family: 'Cormorant SC', 'Cinzel', serif; font-weight: 500;
    font-size: 28px; line-height: 1.25; color: #e8efe9; letter-spacing: 0.02em;
}
.login-quote figcaption {
    font-family: 'DM Sans', 'Montserrat', sans-serif; font-size: 11px; letter-spacing: 0.18em;
    text-transform: uppercase; color: #7f948b;
}

.login-panel {
    display: flex; align-items: center; justify-content: center; padding: 48px 32px;
    border-left: 1px solid rgba(143, 168, 158, 0.14);
    background: linear-gradient(180deg, #071811 0%, #05100b 100%);
}
.login-panel .auth-card {
    background: none; border: none; box-shadow: none; padding: 0; max-width: 384px; width: 100%;
    font-family: 'DM Sans', 'Montserrat', sans-serif;
}
.login-panel .auth-title {
    font-family: 'Cormorant SC', 'Cinzel', serif; font-weight: 500; font-size: 42px;
    letter-spacing: 0.03em; color: #f3f6f4; margin: 0 0 8px; line-height: 1.1;
}
.login-panel .auth-sub {
    font-family: 'Lora', 'Playfair Display', serif; font-size: 16px; color: #93a69d; margin-bottom: 32px; line-height: 1.4;
}
.login-panel .btn-google {
    background: #121f1a; color: #f1f5f3; border: 1px solid rgba(143, 168, 158, 0.22);
    border-radius: 24px; height: 44px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500;
}
.login-panel .btn-google:hover { background: #172a23; box-shadow: none; transform: none; }
.login-panel .btn-google svg { width: 15px; height: 15px; }
.login-panel .auth-divider { margin: 22px 0 18px; font-size: 12px; letter-spacing: 0; text-transform: none; color: #93a69d; }
.login-panel .auth-divider::before, .login-panel .auth-divider::after { background: rgba(143, 168, 158, 0.18); }
.login-panel .auth-field { margin-bottom: 14px; }
.login-panel .auth-field label { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #eef3f0; margin-bottom: 7px; }
.login-panel .auth-input, .login-panel .form-input {
    height: 44px; border-radius: 8px; background: #121f1a; border: 1px solid rgba(143, 168, 158, 0.2);
    color: #fff; font-family: 'DM Sans', sans-serif; font-size: 15px; padding: 0 14px;
}
.login-panel .auth-input:focus { outline: none; border-color: #6fa48f; box-shadow: 0 0 0 3px rgba(111, 164, 143, 0.18); }
.login-panel .auth-eye { font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 0.08em; }
.login-panel .auth-submit {
    height: 42px; border-radius: 8px; border: none; background: #e6e6e6; color: #14201b;
    font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none; margin-top: 6px; box-shadow: none;
}
.login-panel .auth-submit:hover:not([disabled]) { background: #fff; transform: none; box-shadow: none; }
.login-panel .auth-submit--ghost { background: transparent; color: #e6eeea; border: 1px solid rgba(143, 168, 158, 0.35); }
.login-panel .auth-submit--ghost:hover:not([disabled]) { background: rgba(255, 255, 255, 0.06); }
.login-panel .auth-switch { text-align: center; margin: 22px 0 0; font-size: 14px; color: #93a69d; }
.login-panel .auth-switch__btn { background: none; border: none; padding: 0 0 0 4px; font: inherit; font-weight: 600; color: #f3f6f4; cursor: pointer; }
.login-panel .auth-switch__btn:hover { text-decoration: underline; }
.login-panel .auth-legal { text-align: center; font-size: 11.5px; color: #7f948b; }
.login-panel .auth-legal a { color: #a9c0b5; }
.login-panel .auth-account-actions { display: grid; gap: 10px; margin-top: 18px; }

@media (max-width: 860px) {
    .login-split { grid-template-columns: 1fr; }
    .login-split .login-brand { position: relative; height: auto; padding: 24px 24px 8px; }
    .login-logo { position: static; transform: none; width: min(240px, 60%); margin: 18px auto 0; }
    .login-quote { display: none; }
    .login-panel { border-left: none; align-items: flex-start; padding: 24px 24px 56px; }
    .login-panel .auth-title { font-size: 34px; }
}

.login-panel .auth-switch a.auth-switch__btn { text-decoration: none; font-weight: 500; color: #a9c0b5; }
.login-panel .auth-switch a.auth-switch__btn:hover { text-decoration: underline; }

.login-panel [hidden] { display: none !important; }
.login-panel .auth-title--sm { font-size: 34px; }

/* ============================================================
   IDADE, RESPONSÁVEL, SENHA E INDICAÇÃO DE LEITURA
   ============================================================ */
.auth-forgot { margin: -6px 0 16px; text-align: right; font-size: 12px; }
.login-panel .auth-forgot .auth-switch__btn { padding: 0; font-weight: 500; color: #a9c0b5; }

.auth-box {
    margin: 0 0 18px; padding: 14px 16px;
    border: 1px solid rgba(143, 168, 158, 0.25); border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 12px; line-height: 1.6; color: #b9cdc4;
}
.auth-box--alerta { border-color: rgba(255, 138, 138, 0.45); color: #ffb3b3; }
.auth-box__titulo { font-size: 14px; letter-spacing: 1px; margin: 0 0 8px; color: #e6eeea; font-weight: 600; }
.auth-box .auth-note { margin: 0 0 12px; }

.resp-box {
    margin: 0 0 18px; padding: 14px 16px 4px;
    border: 1px solid rgba(224, 179, 74, 0.45); border-radius: 8px;
    background: rgba(224, 179, 74, 0.05);
}
.resp-box legend { padding: 0 8px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #e0b34a; }
.resp-box .auth-note { margin-bottom: 14px; }
.resp-box .auth-note a { color: #e6eeea; }
.login-panel .resp-box[hidden] { display: none !important; }
.auth-file { padding: 10px 12px; font-size: 12px; cursor: pointer; }
.resp-box select.auth-input { background-color: #06130e; color: #fff; }

/* faixa pedindo a data de nascimento */
.aviso-idade {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900;
    max-width: 640px; margin: 0 auto;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 12px 16px; border-radius: 10px;
    background: #0d2118; border: 1px solid rgba(169, 205, 188, 0.45);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    font-size: 13px; line-height: 1.5; color: #dce9e3;
}
.aviso-idade span { flex: 1 1 260px; }
.aviso-idade a { color: #0b1a14; background: #a9cdbc; padding: 8px 14px; border-radius: 6px; font-size: 11px; letter-spacing: 1.5px; font-weight: 600; text-decoration: none; }
.aviso-idade button { background: none; border: none; color: #a3b8b0; font-size: 16px; cursor: pointer; padding: 4px 6px; }

/* catálogo e leitor */
.book-card--idade .book-cover-placeholder { filter: grayscale(0.85) brightness(0.6); }
.status-tag--idade { color: #ffb3b3; border-color: rgba(255, 138, 138, 0.55); }
.reader-idade { font-size: 13px; line-height: 1.6; margin: 10px 0 14px; padding: 10px 14px; border-radius: 6px; max-width: 520px; }
.reader-idade[hidden] { display: none; }
.reader-idade--ok { color: #b9dccb; border: 1px solid rgba(112, 142, 130, 0.45); background: rgba(112, 142, 130, 0.12); }
.reader-idade--bloqueio { color: #ffd0d0; border: 1px solid rgba(255, 138, 138, 0.45); background: rgba(255, 77, 77, 0.08); }
.reader-idade a { color: #fff; font-weight: 600; letter-spacing: 1px; font-size: 11px; white-space: nowrap; }
.btn-reader-start:disabled { opacity: 0.45; cursor: not-allowed; }
#abas-idade { margin: 0 0 12px; }

/* admin: autorizações */
.resp-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.resp-card { padding: 18px; border: 1px solid rgba(143, 168, 158, 0.25); border-radius: 8px; background: rgba(255, 255, 255, 0.03); }
.resp-card h3 { font-size: 16px; margin: 0 0 8px; }
.resp-linha { font-size: 13px; line-height: 1.6; color: #b9cdc4; margin: 6px 0 0; word-break: break-word; }
.resp-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* aviso em tela cheia (confirmar e-mail, link de recuperação) */
.aviso-tela {
    position: fixed; inset: 0; z-index: 2000; overflow-y: auto;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    background: radial-gradient(ellipse at 50% 30%, #0f2b21 0%, #04100b 70%);
}
.aviso-tela[hidden] { display: none; }
.aviso-tela__caixa { width: 100%; max-width: 560px; text-align: center; padding: 8px 0; }
.aviso-tela__icone { width: 96px; height: 96px; margin: 0 auto 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 44px; color: #a9cdbc; background: rgba(169, 205, 188, 0.12); border: 1px solid rgba(169, 205, 188, 0.45); }
.aviso-tela__titulo { font-family: 'Lora', Georgia, serif; font-weight: 400; font-size: clamp(30px, 6vw, 44px); margin: 0 0 14px; color: #f3f6f4; }
.aviso-tela__email { font-size: 18px; font-weight: 600; color: #a9cdbc; word-break: break-all; margin: 0 0 14px; }
.aviso-tela__texto { font-size: 16px; line-height: 1.7; color: #c3d3cb; margin: 0 0 22px; }
.aviso-tela__passos { text-align: left; max-width: 400px; margin: 0 auto 28px; padding-left: 22px; font-size: 15px; line-height: 1.9; color: #dce9e3; }
.aviso-tela__acoes { display: flex; flex-direction: column; gap: 12px; max-width: 360px; margin: 0 auto 18px; }
.aviso-tela .auth-msg { max-width: 400px; margin: 0 auto 18px; }
