*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-card: #141414;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --blue: #6e7cc9;
  --blue-light: #b1b0e8;
  --blue-dim: rgba(110, 127, 201, 0.12);
  --blue-glow: rgba(110, 149, 201, 0.3);
  --text-primary: #e4e6f0;
  --text-secondary: #989eb0;
  --text-muted: #6b6b6b;
  --success: #4caf7d;
  --error: #e05555;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(110, 146, 201, 0.15);
  --transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }

.navbar {
  position: fixed;
  top: 20px;
  left: 24px;
  right: 24px;
  background: rgba(17,17,17,0.88);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.nav-brand:hover { background: var(--blue-dim); }

.nav-logo svg { width: 32px; height: 32px; }

.nav-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 6px;
  background: rgba(26,26,26,0.6);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.nav-btn svg { width: 18px; height: 18px; }
.nav-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-btn.active {
  background: linear-gradient(135deg, var(--blue-dim), rgba(110, 131, 201, 0.2));
  color: var(--blue-light);
  border: 1px solid var(--blue-dim);
  box-shadow: var(--shadow-glow);
}
.nav-btn.active svg { color: var(--blue-light); }

.nav-auth { display: flex; gap: 10px; }
.btn-login, .btn-register {
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-login {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-login:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }
.btn-register {
  background: linear-gradient(135deg, var(--blue), #5574b8);
  border: none;
  color: #0a0a0a;
}
.btn-register:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(110, 157, 201, 0.3); }

.nav-user { position: relative; }
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 40px;
  cursor: pointer;
  transition: var(--transition);
}
.user-badge:hover { border-color: var(--blue); background: var(--blue-dim); box-shadow: var(--shadow-glow); }
.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--blue), #556fb8);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #0a0a0a;
}
.user-pseudo { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }

.user-card {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  animation: fadeSlide 0.2s ease;
  z-index: 1001;
  backdrop-filter: blur(10px);
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-card-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--blue), #5583b8);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #0a0a0a;
}
.user-card-name { font-weight: 700; font-family: 'Playfair Display', serif; }
.user-card-email { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.user-card-divider { height: 1px; background: var(--border); margin: 12px 0; }
.user-card-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.user-card-btn svg { width: 16px; height: 16px; }
.user-card-btn:hover { background: var(--blue-dim); color: var(--blue-light); }
.user-card-btn.danger { color: var(--error); }
.user-card-btn.danger:hover { background: rgba(224,85,85,0.1); }

main { padding-top: 100px; min-height: 100vh; }
.page { animation: fadePage 0.4s ease; }
@keyframes fadePage {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  text-align: center;
  padding: 40px 24px 60px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--blue-dim) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.4;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 6px 18px;
  border-radius: 40px;
  margin-bottom: 24px;
  border: 1px solid var(--blue-dim);
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--blue);
  opacity: 0.5;
}
.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 20px;
}
.typed-text {
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px var(--blue-glow);
}
.cursor-bar {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--blue);
  margin-left: 8px;
  border-radius: 2px;
  animation: blink 1s step-end infinite;
  box-shadow: 0 0 8px var(--blue);
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.hero-desc {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 56px;
}
.hero-stat {
  text-align: center;
  padding: 16px 24px;
  background: rgba(20,20,20,0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(5px);
}
.hero-stat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--blue);
  text-shadow: 0 0 15px var(--blue-glow);
}
.hero-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

.search-bar-wrap { max-width: 500px; margin: 0 auto 32px; }
.search-bar {
  width: 100%;
  padding: 14px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.search-bar:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim), 0 0 20px var(--blue-glow); }

.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 40px;
  margin-bottom: 36px;
  justify-content: center;
}
.filter-chip {
  padding: 8px 22px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 40px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.filter-chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }
.filter-chip.active {
  background: linear-gradient(135deg, var(--blue-dim), rgba(201,169,110,0.25));
  border-color: var(--blue);
  color: var(--blue-light);
  box-shadow: 0 0 12px var(--blue-glow);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 40px;
  margin-bottom: 28px;
}
.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-sub { font-size: 0.8rem; color: var(--text-muted); }

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 28px;
  padding: 0 40px 60px;
  max-width: 1400px;
  margin: 0 auto;
}
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.book-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent, var(--blue-dim));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.book-card:hover {
  transform: translateY(-8px);
  border-color: var(--blue-dim);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 20px var(--blue-glow);
}
.book-card:hover::before { opacity: 1; }
.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--bg-tertiary);
}
.book-cover-placeholder {
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #1a1a1a, #222);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}
.book-cover-placeholder svg { width: 42px; height: 42px; opacity: 0.3; }
.book-info { padding: 16px; }
.book-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-author { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.book-date { font-size: 0.7rem; color: var(--text-muted); opacity: 0.6; margin-bottom: 8px; }
.book-genre-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--blue-dim);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 40px;
  font-size: 0.7rem;
  color: var(--blue);
}

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 60px 40px 30px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto 40px;
}
.footer-brand .nav-title {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.footer-col a:hover { color: var(--blue); transform: translateX(4px); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-copy { font-size: 0.75rem; color: var(--text-muted); }
.footer-badges { display: flex; gap: 12px; }
.footer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 40px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.footer-badge svg { width: 10px; height: 10px; color: var(--success); }

.creation-page { padding: 40px; max-width: 900px; margin: 0 auto; }
.creation-header { margin-bottom: 40px; }
.creation-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.creation-header p { color: var(--text-muted); font-size: 0.95rem; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  width: fit-content;
}
.tab-btn {
  padding: 10px 26px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--blue-dim), rgba(201,169,110,0.2));
  color: var(--blue-light);
  border: 1px solid var(--blue-dim);
  box-shadow: var(--shadow-glow);
}

.form-section { display: none; }
.form-section.active { display: block; animation: fadePage 0.3s ease; }

.form-group { margin-bottom: 24px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim), 0 0 15px var(--blue-glow);
}
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.cover-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 44px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.cover-upload:hover { border-color: var(--blue); background: var(--blue-dim); }
.cover-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.cover-upload svg { width: 44px; height: 44px; color: var(--text-muted); margin-bottom: 12px; }
.cover-upload p { font-size: 0.85rem; color: var(--text-muted); }
.cover-preview {
  width: 100px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 16px auto 0;
  display: block;
  box-shadow: var(--shadow-sm);
}

.editor-toolbar {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
}
.editor-tool {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}
.editor-tool:hover { background: var(--blue-dim); color: var(--blue); }
.editor-divider { width: 1px; height: 24px; background: var(--border); margin: 0 8px; align-self: center; }
.editor-area {
  min-height: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 24px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.8;
  outline: none;
}
.editor-area:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-dim); }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--text-muted); }

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}
.word-count { font-size: 0.8rem; color: var(--text-muted); }

.btn-primary {
  padding: 12px 30px;
  background: linear-gradient(135deg, var(--blue), #b89555);
  border: none;
  border-radius: var(--radius-md);
  color: #0a0a0a;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--blue-glow); }
.btn-secondary {
  padding: 12px 26px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }

.my-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.my-book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 18px;
  transition: var(--transition);
}
.my-book-card:hover { border-color: var(--blue-dim); box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 12px var(--blue-glow); }
.my-book-cover {
  width: 70px;
  height: 105px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}
.my-book-info { flex: 1; min-width: 0; }
.my-book-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}
.my-book-meta { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 12px; }
.my-book-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-edit, .btn-danger {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-edit { color: var(--text-secondary); }
.btn-edit:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }
.btn-danger { color: var(--error); border-color: rgba(224,85,85,0.3); }
.btn-danger:hover { border-color: var(--error); background: rgba(224,85,85,0.1); }

.faq-page { padding: 60px 40px; max-width: 800px; margin: 0 auto; }
.faq-header { margin-bottom: 50px; text-align: center; }
.faq-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.faq-header p { color: var(--text-muted); }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
  transition: var(--transition);
}
.faq-item:hover { border-color: var(--blue-dim); }
.faq-question {
  width: 100%;
  padding: 20px 26px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.faq-question:hover { background: var(--blue-dim); }
.faq-icon {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1rem;
}
.faq-item.open .faq-icon {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
  transform: rotate(45deg);
}
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.3s; padding: 0 26px; }
.faq-item.open .faq-answer { max-height: 300px; padding: 0 26px 22px; }
.faq-answer p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInBg 0.2s ease;
}
@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 460px;
  position: relative;
  animation: modalIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow: var(--shadow-lg);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: var(--blue-dim); }
.modal h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.modal p.sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 28px; }
.modal-footer {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-footer small { font-size: 0.8rem; color: var(--text-muted); }
.modal-footer a { color: var(--blue); text-decoration: none; cursor: pointer; }
.modal-footer a:hover { color: var(--blue-light); }

.strength-bar { height: 4px; background: var(--border); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 4px; transition: width 0.3s, background 0.3s; width: 0%; }
.strength-text { font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; }
.input-group { position: relative; }
.input-group .form-input { padding-right: 48px; }
.input-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.profile-page { padding: 60px 40px; max-width: 700px; margin: 0 auto; }
.profile-header {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 40px;
  padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.profile-avatar-big {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--blue), #b89555);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 2.2rem;
  color: #0a0a0a;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--blue-glow);
}
.profile-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 800;
}
.profile-email { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.profile-stats { display: flex; gap: 32px; margin-top: 16px; }
.profile-stat { text-align: center; }
.profile-stat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
}
.profile-stat-label { font-size: 0.7rem; color: var(--text-muted); }
.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.profile-section h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastIn 0.3s ease;
  border-left: 3px solid var(--blue);
  backdrop-filter: blur(10px);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(30px); }
}
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  gap: 12px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state svg {
  width: 70px;
  height: 70px;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 20px;
}
.empty-state h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.empty-state p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }

.book-reader-page { padding: 40px; max-width: 820px; margin: 0 auto; }
.book-reader-header { display: flex; gap: 36px; margin-bottom: 44px; }
.book-reader-cover {
  width: 150px;
  height: 225px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}
.book-reader-meta h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.book-reader-meta .author { color: var(--blue); font-size: 0.95rem; margin-bottom: 14px; }
.book-reader-meta .desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.book-reader-back { margin-bottom: 28px; }
.book-reader-back a {
  color: var(--blue);
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.book-reader-back a:hover { color: var(--blue-light); gap: 12px; }
.book-reader-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  font-size: 1rem;
  line-height: 1.9;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .navbar { left: 12px; right: 12px; padding: 8px 16px; }
  .nav-links .nav-btn span { display: none; }
  .nav-btn { padding: 8px 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .books-grid { padding: 0 16px 40px; gap: 18px; }
  .section-title-row { padding: 0 16px; }
  .filter-row { padding: 0 16px; }
  .creation-page, .faq-page, .profile-page { padding: 24px 16px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; }
  .hero-stat { padding: 12px 18px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .book-reader-header { flex-direction: column; align-items: center; text-align: center; }
  .book-reader-content { padding: 28px; }
}