:root {
--bg: #212121;
--surface: #2a2a2a;
--text: #f5f0e8;
--accent: #f5f0e8;
--accent-light: #2f2f2f;
  --amber: #d4a017;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* --- Navbar --- */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo { font-family: 'Lora', serif; font-size: 20px; font-weight: 600; text-decoration: none; color: var(--text); }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; transition: all .15s; }
.nav-link:hover, .nav-link.active { background: var(--accent-light); color: var(--accent); }
.nav-logout { color: var(--danger); }
.nav-logout:hover { background: #fdecea; color: var(--danger); }

/* --- Main --- */
.main-content { max-width: 960px; margin: 0 auto; padding: 32px 24px 64px; }

/* --- Botões --- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; border: 1.5px solid transparent; transition: all .15s; }
.btn-primary { background: #f5f0e8; color: #212121; border-color: #f5f0e8; }
.btn-primary:hover { background: #d4c9b5; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--border); }
.btn-amazon { background: #ff9900; color: #fff; border-color: #ff9900; margin-top: 12px; }
.btn-amazon:hover { background: #e68a00; }
.btn-full { width: 100%; justify-content: center; }

/* --- Landing --- */
.landing { text-align: center; padding: 64px 0 48px; }
.landing-title { font-family: 'Lora', serif; font-size: clamp(32px, 5vw, 52px); font-weight: 600; line-height: 1.2; margin-bottom: 16px; }
.landing-title em { color: var(--accent); font-style: italic; }
.landing-sub { font-size: 18px; color: var(--muted); max-width: 520px; margin: 0 auto 32px; }
.landing-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 64px; text-align: left; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature-icon { font-size: 28px; display: block; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--muted); }

/* --- Auth --- */
.auth-page { display: flex; justify-content: center; padding: 48px 16px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 400px; }
.auth-logo { font-family: 'Lora', serif; font-size: 22px; font-weight: 600; text-decoration: none; color: var(--text); display: block; margin-bottom: 24px; }
.auth-card h2 { font-size: 22px; font-weight: 600; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.form-group input { width: 100%; padding: 10px 14px; border: 1px solid #555; border-radius: 8px; font-size: 15px; background: #333333; color: #f5f0e8; outline: none; transition: border-color .15s; }
.form-group input:focus { border-color: var(--accent); }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 500; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #3a2020; color: var(--danger); border: 1px solid #5a3030; }

/* --- Page header --- */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-family: 'Lora', serif; font-size: 28px; font-weight: 600; }
.page-header p { color: var(--muted); font-size: 15px; margin-top: 4px; }

/* --- Search bar --- */
.search-bar-home { display: flex; gap: 8px; margin-bottom: 28px; }
.search-bar-home input { flex: 1; padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; background: #2a2a2a; color: #f5f0e8; outline: none; }
.search-bar-home input:focus { border-color: var(--accent); }

/* --- Books grid --- */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.book-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.book-thumb { width: 100%; height: 180px; object-fit: cover; display: block; }
.book-thumb-placeholder { width: 100%; height: 180px; background: var(--accent-light); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.book-card-info { padding: 12px; }
.book-card-title { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.book-card-author { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.book-genre-tag { font-size: 11px; background: var(--accent-light); color: var(--accent); border-radius: 4px; padding: 2px 7px; display: inline-block; font-weight: 500; }
.empty-state { color: var(--muted); font-size: 15px; padding: 32px 0; }
.empty-state a { color: var(--accent); }

/* --- Book detail --- */
.back-link { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 20px; }
.back-link:hover { color: var(--text); }
.book-detail-hero { display: flex; gap: 32px; margin-bottom: 40px; flex-wrap: wrap; }
.book-detail-cover { width: 160px; height: 230px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.book-detail-meta h1 { font-family: 'Lora', serif; font-size: 28px; font-weight: 600; line-height: 1.2; margin-bottom: 8px; }
.detail-author { font-size: 16px; color: var(--muted); margin-bottom: 12px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-section { margin-bottom: 32px; }
.detail-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.shelf-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Star rating --- */
.star-picker { display: flex; flex-direction: row; gap: 4px; margin-bottom: 12px; }
.star-picker input { display: none; }
.star-label { font-size: 32px; color: #ddd; cursor: pointer; transition: color .1s; }
.star-picker input:checked + .star-label,
.star-picker input:checked + .star-label ~ .star-label { color: #f5a623; }
.rating-form textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: 'Inter', sans-serif; background: #2a2a2a; color: #f5f0e8; outline: none; margin-bottom: 12px; resize: vertical; }
.rating-form textarea:focus { border-color: var(--accent); }

/* --- Profile --- */
.profile-page { max-width: 680px; }
.profile-header-card { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 24px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-header-card h1 { font-family: 'Lora', serif; font-size: 24px; font-weight: 600; }
.profile-since { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-num { display: block; font-size: 28px; font-weight: 600; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; display: block; }
.profile-section { margin-bottom: 32px; }
.profile-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.genre-bars { display: flex; flex-direction: column; gap: 10px; }
.genre-row { display: flex; align-items: center; gap: 10px; }
.genre-name { font-size: 13px; color: var(--muted); width: 120px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre-bar-bg { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.genre-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s ease; }
.genre-count { font-size: 12px; color: var(--muted); width: 20px; text-align: right; }
.recent-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.recent-item:last-child { border-bottom: none; }
.recent-thumb { width: 48px; height: 68px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.recent-title { font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; display: block; margin-bottom: 2px; }
.recent-title:hover { color: var(--accent); }
.recent-author { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stars-display { font-size: 14px; letter-spacing: 1px; }
.star-lit { color: #f5a623; }
.star-dim { color: #ddd; }
.recent-review { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 4px; }

/* --- Mobile --- */
@media (max-width: 600px) {
  .main-content { padding: 20px 16px 48px; }
  .landing-title { font-size: 28px; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .book-detail-hero { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}
