:root {
  --paper: #f8f5f0;
  --paper-dark: #ebe6dd;
  --ink: #2c2416;
  --ink-light: #5c5244;
  --ink-muted: #8a8274;
  --accent: #8b4513;
  --accent-light: #a0522d;
  --gold: #c9a227;
  --gold-light: #d4b84a;
  --success: #2d7a4f;
  --success-light: #3d9963;
  --shadow: rgba(44, 36, 22, 0.15);
  --shadow-deep: rgba(44, 36, 22, 0.25);
  
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-accent: 'Playfair Display', Georgia, serif;
  
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Grain texture overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Views */
.view {
  display: none;
  min-height: 100vh;
}

.view.active {
  display: block;
}

/* ==================== LIBRARY VIEW ==================== */

.library-header {
  text-align: center;
  padding: 4rem 2rem 3rem;
  position: relative;
  background: linear-gradient(180deg, var(--paper-dark) 0%, var(--paper) 100%);
}

.logout-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 36, 22, 0.05);
  border: 1px solid rgba(44, 36, 22, 0.1);
  border-radius: 12px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn svg {
  width: 20px;
  height: 20px;
}

.logout-btn:hover {
  background: rgba(44, 36, 22, 0.1);
  color: var(--ink);
  border-color: rgba(44, 36, 22, 0.2);
}

.header-decoration {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.library-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 0.5rem;
  animation: fadeInUp 1s var(--ease-out) both;
}

.library-subtitle {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: fadeInUp 1s var(--ease-out) 0.1s both;
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  padding: 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.book-card {
  position: relative;
  cursor: pointer;
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.book-card:nth-child(1) { animation-delay: 0.2s; }
.book-card:nth-child(2) { animation-delay: 0.3s; }
.book-card:nth-child(3) { animation-delay: 0.4s; }

.book-cover-wrapper {
  position: relative;
  aspect-ratio: 3/4;
  perspective: 1000px;
}

.book-cover {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px 12px 12px 4px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--paper-dark) 0%, #d4cfc4 100%);
  box-shadow: 
    0 2px 4px var(--shadow),
    0 8px 16px var(--shadow),
    0 16px 32px var(--shadow-deep),
    -4px 0 8px rgba(0,0,0,0.1) inset;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.book-card:hover .book-cover {
  transform: rotateY(-8deg) translateX(8px);
  box-shadow: 
    0 4px 8px var(--shadow),
    0 16px 32px var(--shadow),
    0 24px 48px var(--shadow-deep),
    -4px 0 8px rgba(0,0,0,0.1) inset,
    20px 0 40px rgba(0,0,0,0.1);
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.05) 50%, transparent 100%);
  border-radius: 4px 0 0 4px;
}

.book-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

.book-card:hover .book-cover-image {
  transform: scale(1.02);
}

.book-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 50%,
    rgba(44, 36, 22, 0.7) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
}

.book-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  margin-bottom: 0.25rem;
}

.book-pages-count {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

.book-meta {
  padding: 1.25rem 0.5rem;
  text-align: center;
}

.book-meta-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.book-meta-pages {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* Library Footer */
.library-footer {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.footer-line {
  width: 60px;
  height: 1px;
  background: var(--ink-muted);
  margin: 0 auto 1.5rem;
  opacity: 0.3;
}

/* ==================== READER VIEW ==================== */

#reader-view {
  display: none;
  flex-direction: column;
  height: 100vh;
  background: #1a1814;
}

#reader-view.active {
  display: flex;
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(180deg, #252119 0%, #1a1814 100%);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
  color: white;
}

.nav-controls {
  display: flex;
  gap: 0.5rem;
}

.nav-controls .nav-btn {
  padding: 0.5rem;
}

.book-info {
  text-align: center;
}

.book-info h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(255,255,255,0.9);
  margin-bottom: 0.125rem;
}

.page-indicator {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
}

/* Reader Container */
.reader-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.page-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-out);
  z-index: 10;
}

.page-nav-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  transform: translateY(-50%) scale(1.05);
}

.page-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-nav-btn:disabled:hover {
  transform: translateY(-50%);
  background: rgba(255,255,255,0.05);
}

.prev-btn {
  left: 1.5rem;
}

.next-btn {
  right: 1.5rem;
}

.page-wrapper {
  position: relative;
  max-width: calc(100% - 160px);
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-shadow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.page-image {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 
    0 4px 8px rgba(0,0,0,0.3),
    0 8px 24px rgba(0,0,0,0.3),
    0 16px 48px rgba(0,0,0,0.4);
  transition: transform 0.3s var(--ease-out), opacity 0.3s ease;
  background: var(--paper);
}

.page-image.zoomed {
  cursor: grab;
}

.page-image.zoomed:active {
  cursor: grabbing;
}

.page-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 24, 20, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.page-loading.active {
  opacity: 1;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Page Slider */
.page-slider-container {
  padding: 1rem 2rem 1.5rem;
  background: linear-gradient(0deg, #252119 0%, #1a1814 100%);
  flex-shrink: 0;
}

.page-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.page-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.page-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.page-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Page Thumbnails */
.page-thumbnails {
  display: none;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.3);
  overflow-x: auto;
  flex-shrink: 0;
}

.page-thumbnails.visible {
  display: flex;
}

.thumbnail {
  flex-shrink: 0;
  width: 48px;
  height: 64px;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.thumbnail:hover {
  opacity: 0.8;
}

.thumbnail.active {
  opacity: 1;
  border-color: var(--gold);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Responsive */
@media (max-width: 768px) {
  .books-grid {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
    gap: 2rem;
  }
  
  .library-header {
    padding: 3rem 1.5rem 2rem;
  }
  
  .reader-nav {
    padding: 0.5rem 1rem;
  }
  
  .book-info h2 {
    font-size: 1rem;
  }
  
  .back-btn span {
    display: none;
  }
  
  .page-nav-btn {
    width: 44px;
    height: 44px;
  }
  
  .prev-btn {
    left: 0.5rem;
  }
  
  .next-btn {
    right: 0.5rem;
  }
  
  .page-wrapper {
    max-width: calc(100% - 100px);
  }
}

/* Subject-specific colors for book covers */
.book-card[data-subject="spanish"] .book-cover {
  background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
}

.book-card[data-subject="english"] .book-cover {
  background: linear-gradient(135deg, #1e3a5f 0%, #0d1f33 100%);
}

.book-card[data-subject="math"] .book-cover {
  background: linear-gradient(135deg, #2d5016 0%, #1a3009 100%);
}

/* Placeholder cover styling */
.book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.book-cover-placeholder .book-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.book-cover-placeholder .placeholder-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  line-height: 1.2;
}

/* ==================== AUTH STYLES ==================== */

.hidden {
  display: none !important;
}

.auth-container {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #1a1612 0%, #2c2416 50%, #1a1612 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(201, 162, 39, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(139, 69, 19, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.auth-view {
  display: none;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  animation: authFadeIn 0.6s var(--ease-out) both;
}

.auth-view.active {
  display: block;
}

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

.auth-card {
  background: linear-gradient(145deg, rgba(248, 245, 240, 0.98) 0%, rgba(235, 230, 221, 0.95) 100%);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 40px 80px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--accent), var(--gold));
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--gold);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.auth-logo svg {
  width: 100%;
  height: 100%;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-muted);
  font-weight: 400;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-light);
  letter-spacing: 0.02em;
}

.form-group input {
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid transparent;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s var(--ease-out);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(255, 255, 255, 0.5);
}

.form-group input::placeholder {
  color: var(--ink-muted);
}

.form-group input:focus {
  background: white;
  border-color: var(--gold);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.05),
    0 0 0 4px rgba(201, 162, 39, 0.15);
}

/* Auth Buttons */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.auth-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease-out);
}

.auth-btn.primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--ink);
  box-shadow: 
    0 4px 12px rgba(201, 162, 39, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.auth-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(201, 162, 39, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.auth-btn.primary:hover svg {
  transform: translateX(4px);
}

.auth-btn.primary:active {
  transform: translateY(0);
}

.auth-btn.secondary {
  background: transparent;
  color: var(--ink-light);
  border: 2px solid rgba(44, 36, 22, 0.15);
}

.auth-btn.secondary:hover {
  background: rgba(44, 36, 22, 0.05);
  border-color: rgba(44, 36, 22, 0.25);
  color: var(--ink);
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-muted), transparent);
  opacity: 0.3;
}

.auth-divider span {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink-muted);
  text-transform: lowercase;
}

/* Back Button */
.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: -0.5rem;
}

.back-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.back-btn:hover {
  color: var(--ink);
}

.back-btn:hover svg {
  transform: translateX(-4px);
}

/* Auth Error */
.auth-error {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: #c41e3a;
  text-align: center;
  margin-top: 1rem;
  min-height: 1.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-error.visible {
  opacity: 1;
}

/* Verification View Specific */
.verification-card {
  max-width: 520px;
}

.verification-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  color: var(--gold);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.15) 0%, rgba(201, 162, 39, 0.05) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.verification-icon svg {
  width: 36px;
  height: 36px;
}

.verification-code-display {
  background: linear-gradient(135deg, #1a1612 0%, #2c2416 100%);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.code-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
}

.code-box {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  padding: 0.5rem;
  background: rgba(201, 162, 39, 0.1);
  border-radius: 8px;
  margin-bottom: 1rem;
  user-select: all;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn svg {
  width: 16px;
  height: 16px;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Verification Instructions */
.verification-instructions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step-number {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
  border: 2px solid rgba(201, 162, 39, 0.3);
  border-radius: 50%;
}

.step-content {
  padding-top: 0.25rem;
}

.step-content p {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ink-light);
  line-height: 1.4;
}

.email-link {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(139, 69, 19, 0.08);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.email-link:hover {
  background: rgba(139, 69, 19, 0.15);
  color: var(--accent-light);
}

/* Verification Status */
.verification-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(201, 162, 39, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.15);
}

.status-indicator {
  position: relative;
  width: 16px;
  height: 16px;
}

.status-indicator.waiting .pulse-ring {
  position: absolute;
  inset: -4px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: statusPulse 1.5s ease-out infinite;
}

.status-indicator.waiting .pulse-dot {
  position: absolute;
  inset: 0;
  background: var(--gold);
  border-radius: 50%;
}

@keyframes statusPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.status-indicator.verified .pulse-ring {
  display: none;
}

.status-indicator.verified .pulse-dot {
  position: absolute;
  inset: 0;
  background: var(--success);
  border-radius: 50%;
}

#status-text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ink-light);
}

/* Success Icon */
.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  color: var(--success);
  background: linear-gradient(135deg, rgba(45, 122, 79, 0.15) 0%, rgba(45, 122, 79, 0.05) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successPop 0.5s var(--ease-out);
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-icon svg {
  width: 40px;
  height: 40px;
}

/* Floating Books Decoration */
.auth-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.floating-book {
  position: absolute;
  width: 60px;
  height: 80px;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.1) 0%, rgba(139, 69, 19, 0.1) 100%);
  border-radius: 4px 8px 8px 4px;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1) inset;
  opacity: 0.5;
}

.floating-book.book-1 {
  top: 15%;
  left: 10%;
  animation: float1 8s ease-in-out infinite;
}

.floating-book.book-2 {
  top: 60%;
  right: 15%;
  width: 50px;
  height: 70px;
  animation: float2 10s ease-in-out infinite;
}

.floating-book.book-3 {
  bottom: 20%;
  left: 20%;
  width: 45px;
  height: 60px;
  animation: float3 12s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-30px) rotate(5deg); }
}

@keyframes float2 {
  0%, 100% { transform: translateY(0) rotate(8deg); }
  50% { transform: translateY(-25px) rotate(-3deg); }
}

@keyframes float3 {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-20px) rotate(8deg); }
}

/* Auth Container Hidden State */
.auth-container.hidden {
  display: none;
}

/* Responsive Auth */
@media (max-width: 540px) {
  .auth-view {
    padding: 1rem;
  }
  
  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  
  .auth-title {
    font-size: 2rem;
  }
  
  .code-box {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
  }
  
  .verification-instructions {
    gap: 0.75rem;
  }
  
  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
  }
}
