/* LITREAD Modern Minimalist Stylesheet */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Dark Theme Default */
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --bg-hover: #2e2e2e;

  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;

  --border: #2a2a2a;
  --border-focus: #555555;

  --accent: #ffffff;
  --accent-inverted: #121212;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  --header-height: 64px;
}

[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f5;
  --bg-hover: #e9ecef;

  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;

  --border: #e0e0e0;
  --border-focus: #1a1a1a;

  --accent: #121212;
  --accent-inverted: #ffffff;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.reading-mode {
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Offline Banner */
.offline-banner {
  display: none;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 8px 16px;
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.offline-banner.active {
  display: flex;
}

.offline-banner svg {
  width: 16px;
  height: 16px;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1300px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-primary);
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 460px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  pointer-events: none;
  color: var(--text-muted);
}

.search-icon svg {
  width: 16px;
  height: 16px;
}

.search-input-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 16px 0 38px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.search-input-wrap input:focus {
  border-color: var(--border-focus);
}

.search-input-wrap input::placeholder {
  color: var(--text-muted);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-inverted);
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background-color: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-icon.active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.user-display {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Upload Progress Floating Bar */
.upload-progress-container {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 320px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
}

.upload-progress-container.active {
  display: block;
}

.upload-progress-header {
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-track {
  height: 4px;
  background-color: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
}

.upload-bar {
  height: 100%;
  width: 0%;
  background-color: var(--text-primary);
  transition: width 0.2s ease;
}

/* Dropzone Overlay */
.drop-zone-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.drop-zone-overlay.drag-active {
  display: flex;
}

.drop-zone-content {
  border: 2px dashed #ffffff;
  border-radius: var(--radius-lg);
  padding: 60px 80px;
  text-align: center;
  color: #ffffff;
  pointer-events: none;
}

.drop-icon svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

/* Main Layout */
.app-main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px;
}

/* Library Toolbar */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  background-color: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.filter-tab {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 500;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sort-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
}

.sort-select:focus {
  border-color: var(--border-focus);
}

.view-switch {
  display: flex;
  gap: 4px;
}

/* Stats */
.library-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.stat-num {
  font-weight: 600;
  color: var(--text-primary);
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px;
}

.book-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

/* Cover Image / Placeholder */
.book-cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background-color: var(--bg-tertiary);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.book-card:hover .book-cover-img {
  transform: scale(1.03);
}

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  position: relative;
  border-left: 4px solid rgba(255, 255, 255, 0.08);
}

.placeholder-format {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.placeholder-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.placeholder-author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.format-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.offline-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 0.68rem;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.offline-badge svg {
  width: 12px;
  height: 12px;
}

.translation-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(14, 165, 233, 0.85);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.02em;
}

.translation-badge svg {
  width: 12px;
  height: 12px;
}

/* Card Body */
.book-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.book-author {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 12px;
}

.book-lang-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.85;
}

.book-progress-wrap {
  margin-top: auto;
  margin-bottom: 12px;
}

.progress-bar {
  height: 4px;
  background-color: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.book-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-read {
  flex: 1;
  height: 32px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-read:hover {
  background-color: var(--accent);
  color: var(--accent-inverted);
  border-color: var(--accent);
}

.btn-read svg {
  width: 14px;
  height: 14px;
}

.btn-delete {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-delete svg {
  width: 14px;
  height: 14px;
}

/* Processing Book Placeholder Card */
.book-card.is-processing {
  opacity: 0.95;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.03);
}

.book-card.is-processing .book-cover-wrap {
  cursor: default;
}

.book-card.is-processing .book-cover-placeholder {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(255, 255, 255, 0.03) 100%);
  position: relative;
  overflow: hidden;
}

.book-card.is-processing .book-cover-placeholder::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: placeholder-shimmer 1.8s infinite;
}

@keyframes placeholder-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.processing-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.75);
  color: var(--text-primary);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.processing-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.progress-fill.processing-fill {
  background: linear-gradient(90deg, var(--text-muted), var(--text-primary));
  animation: progress-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes progress-pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.btn-read.btn-processing {
  cursor: not-allowed;
  opacity: 0.8;
  pointer-events: none;
}

/* List View */
.books-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.books-list .book-card {
  flex-direction: row;
  align-items: center;
  padding: 10px 16px;
  height: 72px;
}

.books-list .book-cover-wrap {
  width: 44px;
  height: 56px;
  aspect-ratio: auto;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.books-list .format-badge,
.books-list .offline-badge {
  display: none;
}

.books-list .book-info {
  flex-direction: row;
  align-items: center;
  padding: 0 0 0 16px;
  gap: 20px;
}

.books-list .book-title {
  flex: 2;
  margin-bottom: 0;
}

.books-list .book-author {
  flex: 1.5;
  margin-bottom: 0;
}

.books-list .book-progress-wrap {
  flex: 1.5;
  margin: 0;
}

.books-list .book-actions {
  flex-shrink: 0;
}

/* Empty State */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}

.empty-state.active {
  display: flex;
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-icon-wrap svg {
  width: 100%;
  height: 100%;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 380px;
  margin-bottom: 24px;
}

/* Auth Dialog */
.auth-dialog {
  border: none;
  background: transparent;
  max-width: 420px;
  width: 90%;
  margin: auto;
  padding: 0;
  color: var(--text-primary);
}

.auth-dialog[open],
.auth-dialog.active {
  display: block;
}

.auth-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.auth-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand-logo {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.auth-brand-logo svg {
  width: 32px;
  height: 32px;
}

.auth-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.auth-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-form input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.auth-form input:focus {
  border-color: var(--border-focus);
}

.auth-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin-bottom: 14px;
  min-height: 20px;
}

.auth-footer {
  text-align: center;
  margin-top: 18px;
}

.auth-footer a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-footer a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }
  .search-bar {
    max-width: 200px;
  }
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .library-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-tabs {
    overflow-x: auto;
  }
  .toolbar-right {
    justify-content: space-between;
  }
}

/* Translate Button and Modal */
.btn-translate-card {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-translate-card:hover {
  background-color: var(--bg-hover);
  color: #38bdf8;
  border-color: var(--border);
}

.btn-translate-card.translated {
  color: #38bdf8;
}

.btn-translate-card svg {
  width: 15px;
  height: 15px;
}

.translate-dialog {
  max-width: 440px;
}

.translate-card {
  padding: 24px;
}

.translate-modal-sparkle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.translate-select {
  width: 100%;
  height: 40px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0 12px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.translate-select:focus {
  border-color: var(--accent);
}

.translate-info-note {
  margin: 16px 0;
  padding: 12px 14px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.translate-note-icon {
  color: #38bdf8;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.translate-status-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
}

.translate-status-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.translate-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Authes.org OIDC Styles */
.auth-oidc-container {
  margin-top: 20px;
  margin-bottom: 16px;
}

.btn-oidc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 18px;
  background: var(--text-primary);
  color: var(--bg-primary) !important;
  border-radius: var(--radius-sm);
  border: 1px solid var(--text-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-oidc:hover {
  background: var(--accent-hover);
  color: var(--bg-primary) !important;
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.oidc-key-icon {
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0 20px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 12px;
}

/* ==========================================================================
   READPAGE Minimalist Monochrome Landing Page
   ========================================================================== */

.landing-view {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  color: var(--text-primary);
  animation: fadeInLanding 0.3s ease;
}

@keyframes fadeInLanding {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header Guest Navigation */
.header-guest-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background-color: var(--bg-hover);
  border-color: var(--border);
}

.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 0.96rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 0.82rem;
}

/* Hero Section */
.landing-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 40px 0 72px;
  border-bottom: 1px solid var(--border);
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.landing-badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.landing-title {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-wrap: balance;
}

.landing-lead {
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 32px;
  text-wrap: pretty;
  max-width: 540px;
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.landing-btn-arrow {
  transition: transform 0.2s ease;
}

.btn-start-reading:hover .landing-btn-arrow {
  transform: translateX(3px);
}

.landing-auth-subtext {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.landing-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.84rem;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.landing-link-btn:hover {
  opacity: 0.75;
}

/* Monochrome Mockup Book Frame */
.landing-mockup {
  position: relative;
  display: flex;
  flex-direction: column;
}

.mockup-frame {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.mockup-frame:hover {
  border-color: var(--border-focus);
}

.mockup-header {
  height: 38px;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.mockup-dots {
  display: flex;
  gap: 6px;
}

.mockup-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--border-focus);
  background: transparent;
}

.mockup-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.mockup-sync-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.mockup-book-body {
  display: flex;
  background-color: var(--bg-primary);
  min-height: 270px;
  padding: 22px 20px;
  gap: 20px;
  position: relative;
  font-family: "Georgia", "Cambria", "Times New Roman", serif;
}

.mockup-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mockup-page-gutter {
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.mockup-chapter {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.mockup-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-align: justify;
}

.lead-para::first-letter {
  font-size: 2.1rem;
  float: left;
  line-height: 0.85;
  padding-right: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 700;
}

.mockup-footer {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 10px;
}

.mockup-badges {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mockup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Landing Section General */
.landing-section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.section-heading {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 40px;
  text-wrap: balance;
}

/* Feature Cards Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.feature-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.feature-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
}

.feature-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.feature-title {
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.feature-desc {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* Details Section */
.landing-details-section {
  padding-bottom: 60px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.detail-item {
  padding: 24px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.detail-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.detail-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.detail-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Bottom CTA Banner */
.landing-cta-banner {
  padding: 64px 32px;
  margin: 60px 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  display: flex;
  justify-content: center;
}

.cta-inner {
  max-width: 640px;
}

.cta-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 14px;
  text-wrap: balance;
}

.cta-sub {
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 28px;
  text-wrap: pretty;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.cta-oidc-row {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cta-oidc-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.cta-oidc-link:hover {
  opacity: 0.75;
}

/* Landing Footer */
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.footer-link-btn:hover,
.footer-link:hover {
  color: var(--text-primary);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 0.15s ease;
}

.footer-version {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Modal Close Button */
.auth-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-close-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.auth-card {
  position: relative;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 20px 0 48px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .landing-view {
    padding: 24px 16px 60px;
  }

  .landing-title {
    font-size: 2.1rem;
  }

  .landing-lead {
    font-size: 1rem;
  }

  .mockup-page-right,
  .mockup-page-gutter {
    display: none;
  }

  .landing-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 14px;
  }
}


