:root {
    --primary: #1a5f3f;
    --primary-hover: #134a30;
    --primary-light: #e8f5e9;
    --bg-main: #faf9f6;
    --bg-cream: #fdfbf7;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(26, 95, 63, 0.15);
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent-dark: #0d1f12;
    --radius-xl: 24px;
    --radius-lg: 16px;
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
  background: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, hsla(145,50%,15%,0.15) 0, transparent 50%), 
    radial-gradient(at 50% 0%, hsla(145,40%,25%,0.1) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(145,30%,35%,0.08) 0, transparent 50%);
  background-attachment: fixed;
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  color: var(--text-primary);
}

.text-purple { color: var(--primary); }

.book-card {
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.18);
}

.book-cover {
  height: 260px;
  background: linear-gradient(135deg, #1a5f3f 0%, #0d1f12 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4.2rem;
  font-weight: bold;
  text-shadow: 0 3px 12px rgba(0,0,0,0.5);
}

.book-title {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 1rem 1.1rem 0.5rem;
  line-height: 1.4;
  height: 3.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.book-size {
  font-size: 0.82rem;
  color: #6c757d;
}

.pagination .page-link {
  border-radius: 8px !important;
  margin: 0 5px;
}

.pagination .page-item.active .page-link {
  background-color: #6f42c1;
  border-color: #6f42c1;
}

#books-grid:empty::before {
  content: "A carregar livros...";
  display: block;
  text-align: center;
  padding: 100px 0;
  color: #6c757d;
  font-size: 1.3rem;
}

.modal-fullscreen .modal-dialog {
  margin: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
}

.modal-fullscreen .modal-content {
  border: 0;
  border-radius: 0;
  height: 100vh;
}

#pdfCanvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
}

#pdfLoading {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/* ═══════════════════════════════════════
    CAPA DO LIVRO
═══════════════════════════════════════ */
.book-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,.08);
    cursor: pointer;
    background: #fff;
    transition: transform .25s ease, box-shadow .25s ease;
}
.book-card:hover {
    transform: translateY(-7px) scale(1.015);
    box-shadow: 0 14px 32px rgba(0,0,0,.16);
}
.book-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 1.2rem;
    transition: filter .2s;
}
.book-card:hover .book-cover { filter: brightness(1.07); }

/* Lombada */
.cover-spine {
    position: absolute;
    inset: 0 auto 0 0;
    width: 13px;
    background: rgba(0,0,0,.22);
    z-index: 1;
}
/* Barra decorativa no topo */
.cover-topbar {
    position: absolute;
    top: 0; left: 13px; right: 0;
    height: 7px;
    background: rgba(255,255,255,.28);
}
/* Padrão diagonal subtil */
.cover-pattern {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,.055) 0px, rgba(255,255,255,.055) 1px,
        transparent 1px, transparent 10px
    );
    pointer-events: none;
}
/* Título sobre a capa */
.cover-title {
    position: relative;
    z-index: 2;
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    text-shadow: 0 1px 5px rgba(0,0,0,.32);
    padding: 0 .35rem;
    max-width: 100%;
}
/* Badge PDF */
.cover-badge {
    position: absolute;
    bottom: .7rem;
    right: .7rem;
    z-index: 2;
    background: rgba(0,0,0,.38);
    color: #fff !important;
    border-radius: 20px;
    padding: .18rem .6rem;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .09em;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: .28rem;
}
.book-title {
    font-size: .88rem;
    font-weight: 600;
    color: #2d2d2d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}
.book-size {
    font-size: .76rem;
    color: #9e9e9e;
}

/* ═══════════════════════════════════════
    PAGINAÇÃO
═══════════════════════════════════════ */
.pagination { gap: 5px; flex-wrap: wrap; }

.pagination .page-link {
    border-radius: 10px !important;
    min-width: 42px;
    height: 42px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: .88rem;
    border: 2px solid #e9ecef;
    color: #6c757d;
    background: #fff;
    padding: 0 .65rem;
    line-height: 1;
    transition: all .2s ease;
}
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #1a5f3f, #0d1f12);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(26,95,63,.45);
    transform: translateY(-2px);
}
.pagination .page-item:not(.disabled):not(.active) .page-link:hover {
    border-color: #1a5f3f;
    color: #1a5f3f;
    background: #e8f5e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,95,63,.18);
}
.pagination .page-item.disabled .page-link {
    opacity: .3;
    pointer-events: none;
    background: #f8f9fa;
}
#pagination-info {
    font-size: .82rem;
    color: #adb5bd;
}
#pagination-info strong { color: #6c757d; }

/* Estilo de login / register modern */
.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e2e8f0, #f8fafc);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
.auth-card {
    width: min(420px, 92vw);
    padding: 2rem;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    border: 1px solid #e5e7eb;
}
.auth-card h1 {
    margin: 0 0 1.25rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
}
.auth-form {
    display: grid;
    gap: 0.8rem;
}
.auth-form input {
    width: 100%;
    padding: 0.72rem 0.84rem;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    outline: none;
}
.auth-form input:focus {
    border-color: #1a5f3f;
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.16);
}
.auth-btn {
    border: none;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #1a5f3f, #134a30);
    padding: 0.72rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}
.auth-btn:hover { opacity: 0.94; }
.auth-foot {
    margin-top: 0.9rem;
    color: #6b7280;
    font-size: 0.85rem;
    text-align: center;
}
.auth-link { color: #1a5f3f; text-decoration: none; font-weight: 600; }

/* ═══════════════════════════════════════════════
   BARRA DE PESQUISA  (index.html)
═══════════════════════════════════════════════ */
.search-bar-wrapper { max-width: 640px; }

.search-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,.06);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.search-input-group:focus-within {
    border-color: #1a5f3f;
    box-shadow: 0 4px 22px rgba(26,95,63,.16);
}
.search-icon {
    padding: 0 .75rem 0 1rem;
    color: #adb5bd;
    font-size: 1rem;
    pointer-events: none;
    transition: color .2s;
}
.search-input-group:focus-within .search-icon { color: #1a5f3f; }

.search-field {
    flex: 1;
    border: none;
    outline: none;
    font-size: .97rem;
    padding: .65rem .4rem;
    background: transparent;
    color: #2d2d2d;
}
.search-field::placeholder { color: #adb5bd; }

.search-clear-btn {
    border: none;
    background: transparent;
    padding: 0 .9rem;
    color: #adb5bd;
    cursor: pointer;
    font-size: .9rem;
    transition: color .15s;
}
.search-clear-btn:hover { color: #1a5f3f; }

.search-info {
    font-size: .82rem;
    color: #6c757d;
    margin-top: .45rem;
    padding-left: .3rem;
}