/* style.css */

/* Reset e Box-sizing */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variáveis de Cores (extraídas do convite.php) */
:root {
  --cream:    #fdfaf5;
  --text-dark:#2a221f;
  --gold:     #a07050;
  --accent:   #7a4030;
  --soft-bg:  #f4efe9;
  --success:  #2d5a27;
  --error:    #8b2a2a;
  --warning:  #7a5a10;
}

/* Estilos Globais do Body */
body {
  background-color: var(--cream);
  font-family: 'Lato', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  display: flex;
  flex-direction: column; /* Para layouts de página inteira */
  align-items: center;
  min-height: 100vh;
  padding: 40px 20px;
}

/* Fontes (importadas via Google Fonts) */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Títulos e Elementos de Cabeçalho */
.header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px; /* Ajustado para ser mais genérico */
}

.book-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 30px; /* Ajustado para ser mais genérico */
}

/* Contêineres de Autenticação/Formulário */
.auth-container, .dashboard-container, .reader-container {
  max-width: 600px; /* Largura padrão para formulários e dashboards */
  width: 100%;
  text-align: center;
  background-color: var(--soft-bg);
  padding: 40px 30px;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

/* Formulários */
.form-group { margin-bottom: 20px; }
.input-label {
  font-weight: 700;
  font-size: .9rem;
  display: block;
  margin-bottom: 8px;
  text-align: left;
}
.input-field {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #d1c8bd;
  background: white;
  border-radius: 2px;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  transition: border-color .2s;
}
.input-field:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(160,112,80,.12);
}
.input-hint {
  font-size: .8rem;
  color: #777;
  font-style: italic;
  display: block;
  margin-top: 5px;
}

/* Botões CTA */
.cta-button {
  text-decoration: none;
  display: block;
  width: 100%;
  padding: 18px;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  border-radius: 2px;
  margin-top: 20px; /* Ajustado para ser mais genérico */
  transition: all .3s ease;
  cursor: pointer;
  border: none;
  font-family: 'Lato', sans-serif;
  font-size: .9rem;
}
.btn-primary { background-color: var(--accent); color: white; }
.btn-primary:hover { background-color: var(--text-dark); }
.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--gold);
  color: var(--text-dark);
}
.btn-secondary:hover { background-color: var(--gold); color: white; }

/* Mensagens de Feedback */
.msg-feedback {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  text-align: center;
  font-size: .9rem;
}
.msg-error   { background: #fde8e8; border: 1px solid var(--error);   color: var(--error); }
.msg-success { background: #eef5ed; border: 1px solid var(--success); color: var(--success); }
.msg-warning { background: #fef8e8; border: 1px solid #c9960a;        color: var(--warning); }

/* Links Auxiliares */
.link-aux {
  display: block;
  margin-top: 15px;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
}
.link-aux:hover { color: var(--accent); }

/* Dashboard */
.welcome-message {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 30px;
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-top: 40px;
}
.book-card {
  background-color: white; /* Alterado para branco para contraste */
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0,0,0,.05);
  overflow: hidden;
  text-align: left;
  transition: transform .2s ease;
}
.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
}
.book-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}
.book-info { padding: 15px; }
.book-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 5px;
}
.book-info p {
  font-size: .9rem;
  color: #666;
  margin-bottom: 10px;
}
.read-button {
  display: block;
  background-color: var(--gold);
  color: white;
  padding: 10px 15px;
  text-align: center;
  text-decoration: none;
  border-radius: 2px;
  font-size: .9rem;
  font-weight: 700;
  transition: background-color .2s ease;
}
.read-button:hover { background-color: var(--accent); }

/* Leitor de Livros */
.reader-header {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(160,112,80,.2);
}
.reader-header .book-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--accent);
  margin: 0;
}
.reader-header .author-name {
  font-size: .9rem;
  color: #666;
}
.reader-header .back-link {
  color: var(--gold);
  text-decoration: none;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.reader-header .back-link:hover { color: var(--accent); }

.book-page-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: calc(100vh - 120px); /* Ajuste conforme necessário */
  background-color: white;
  border: 1px solid #e0e0e0;
  box-shadow: 0 5px 20px rgba(0,0,0,.1);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.book-content {
  padding: 30px;
  font-size: 1.1rem;
  line-height: 1.8;
  overflow-y: scroll;
  flex-grow: 1;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE 10+ */
  user-select: none; /* Standard syntax */
}
.book-content::-webkit-scrollbar { width: 8px; }
.book-content::-webkit-scrollbar-track { background: var(--soft-bg); }
.book-content::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }
.book-content::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.chapter-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 20px;
  text-align: center;
}
.chapter-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 30px;
  text-align: center;
  font-style: italic;
}
.book-content p { margin-bottom: 1em; text-align: justify; }
.book-content strong { color: var(--accent); }

.reader-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  border-top: 1px solid rgba(160,112,80,.2);
  background-color: var(--soft-bg);
  font-size: .9rem;
  color: #888;
}
.reader-footer .page-nav button {
  background-color: var(--gold);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .2s ease;
}
.reader-footer .page-nav button:hover:not(:disabled) { background-color: var(--accent); }
.reader-footer .page-nav button:disabled { background-color: #ccc; cursor: not-allowed; }

/* Marca d'água */
.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 2.5em;
  color: rgba(0, 0, 0, 0.05); /* Bem sutil */
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 10;
  font-family: 'Playfair Display', serif;
}

/* Responsividade */
@media (max-width: 768px) {
  body { padding: 20px 10px; }
  .auth-container, .dashboard-container, .reader-container { padding: 30px 15px; }
  .book-grid { grid-template-columns: 1fr; }
  .book-page-container { height: calc(100vh - 100px); max-width: 100%; }
  .book-content { padding: 20px; font-size: 1rem; }
  .chapter-title { font-size: 1.5rem; }
  .watermark { font-size: 1.8em; }
  .reader-footer { padding: 10px 15px; font-size: .8rem; }
  .reader-footer .page-nav button { padding: 6px 10px; }
}

/* Animações */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade { animation: fadeUp .4s ease forwards; }