/**
 * Match Letter - Minimalist Theme Design System
 * Fast, lightweight, mobile-first dark theme inspired by Linear, Apple & Letterboxd Pro.
 */

:root {
  --bg-base: #0b0e14;
  --bg-surface: #121720;
  --bg-surface-hover: #171e2a;
  --bg-elevated: #1a222f;
  --bg-input: #141923;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.22);
  --border-focus: #00e054;
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-green: #00e054;
  --accent-green-hover: #00c94b;
  --accent-cyan: #40bcf4;
  --accent-cyan-hover: #33a6db;
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --max-width: 1200px;

  /* Safe Area Insets for Mobile Devices */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* Fast Box Model & Tap Optimization */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Layout Utilities */
.site-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 20px 80px;
  padding-left: max(20px, var(--sal));
  padding-right: max(20px, var(--sar));
}

/* Header & Navbar */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 14, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: var(--sat);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--accent-green);
  flex-shrink: 0;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.btn-sponsor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(234, 76, 137, 0.08);
  border: 1px solid rgba(234, 76, 137, 0.25);
  color: #ff79b0;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-sponsor:hover {
  background: rgba(234, 76, 137, 0.16);
  border-color: rgba(234, 76, 137, 0.45);
  color: #ff94c2;
}

.btn-sponsor:active {
  transform: scale(0.96);
}

.btn-sponsor svg {
  color: #ea4c89;
  flex-shrink: 0;
}

/* Segmented Mode Tabs */
.segmented-tabs {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
  min-height: 36px;
}

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

.tab-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

/* Typography & Hero */
.hero {
  text-align: center;
  padding: 36px 16px 28px;
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  font-weight: 400;
}

/* Card / Form Container */
.form-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.input-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.input-field-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px 0 14px;
  height: 52px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.input-field-wrapper:focus-within {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(0, 224, 84, 0.15);
}

.input-prefix {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1rem;
  user-select: none;
  margin-right: 8px;
  flex-shrink: 0;
}

/* 16px font size on inputs to prevent iOS Safari auto-zoom */
.text-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  width: 100%;
  height: 100%;
}

.text-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.input-icon-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

.input-clear-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.input-clear-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.input-clear-btn.visible {
  display: flex;
}

.row-remove-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

.row-remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-red);
}

.row-remove-btn:active {
  transform: scale(0.92);
}

/* Secondary Actions Bar */
.form-aux-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 8px;
}

.btn-subtle {
  background: transparent;
  border: 1px dashed var(--border-medium);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  min-height: 40px;
}

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

.btn-subtle:active {
  transform: scale(0.97);
}

.btn-subtle.remove-btn {
  border-style: solid;
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}

.btn-subtle.remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-red);
}

/* Primary Button */
.btn-primary {
  width: 100%;
  height: 52px;
  background: var(--accent-green);
  color: #051408;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--accent-green-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
  border: 1px solid var(--border-subtle);
}

/* Crawl Progress Minimalist Card */
.crawl-progress-card {
  margin-top: 20px;
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: none;
}

.crawl-progress-card.active {
  display: block;
}

.crawl-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.crawl-status-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.crawl-status-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 1.5s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}

.crawl-status-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.crawl-progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 14px;
}

.crawl-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green), #40bcf4);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
}

.crawl-user-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-progress-pill {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
}

.user-progress-pill-header {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.user-progress-pill-status {
  color: var(--text-primary);
  font-weight: 600;
}

/* Results Header Bar */
.results-header-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.results-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  min-height: 38px;
}

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

.btn-back:active {
  transform: scale(0.97);
}

.results-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}

.results-headline h1 {
  margin: 0 0 6px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

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

.user-tag {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
}

.results-stats-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  text-align: center;
  min-width: 100px;
}

.stat-pill-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-green);
  line-height: 1.1;
}

.stat-pill-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 2px;
}

/* Results Filter & Sort Controls */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.search-wrapper {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px 0 14px;
  height: 46px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-wrapper:focus-within {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(0, 224, 84, 0.12);
}

.search-wrapper svg.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  margin-right: 10px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px; /* 16px prevents iOS zoom */
  height: 100%;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.search-clear-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.search-clear-btn.visible {
  display: flex;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.sort-select-wrapper {
  position: relative;
  flex-shrink: 0;
}

.sort-select-wrapper select {
  height: 46px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 0 38px 0 14px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease;
}

.sort-select-wrapper select:hover {
  border-color: var(--border-medium);
}

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

.sort-select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 5px;
  background-color: var(--text-muted);
  clip-path: polygon(100% 0%, 0 0%, 50% 100%);
  pointer-events: none;
}

/* Movie Poster Grid */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.movie-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
}

.movie-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.movie-card:active {
  transform: scale(0.975);
}

.poster-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #141a24;
  overflow: hidden;
}

.movie-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.movie-poster-img.loading {
  opacity: 0.3;
}

.movie-poster-img.hidden {
  display: none !important;
}

.poster-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px;
  text-align: center;
  background: radial-gradient(circle at 50% 25%, #1f293d 0%, #0d121c 65%, #070a10 100%);
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  user-select: none;
}

.poster-fallback.visible {
  display: flex;
}

/* 6 Dynamic Cinematic Palettes based on movie title hash */
.poster-fallback.theme-0 {
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 60%, #020617 100%);
  --glow-color: rgba(148, 163, 184, 0.25);
}
.poster-fallback.theme-1 {
  background: radial-gradient(circle at 50% 20%, #2e1065 0%, #1e1b4b 60%, #09061c 100%);
  --glow-color: rgba(167, 139, 250, 0.25);
}
.poster-fallback.theme-2 {
  background: radial-gradient(circle at 50% 20%, #064e3b 0%, #022c22 60%, #01140e 100%);
  --glow-color: rgba(52, 211, 153, 0.25);
}
.poster-fallback.theme-3 {
  background: radial-gradient(circle at 50% 20%, #4c0519 0%, #290812 60%, #120207 100%);
  --glow-color: rgba(251, 113, 133, 0.25);
}
.poster-fallback.theme-4 {
  background: radial-gradient(circle at 50% 20%, #451a03 0%, #271003 60%, #120700 100%);
  --glow-color: rgba(251, 191, 36, 0.25);
}
.poster-fallback.theme-5 {
  background: radial-gradient(circle at 50% 20%, #134e4a 0%, #042f2e 60%, #021717 100%);
  --glow-color: rgba(45, 212, 191, 0.25);
}

.fallback-header {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fallback-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}

.fallback-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  width: 100%;
}

.fallback-icon-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 16px var(--glow-color, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.poster-fallback-title {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.25;
  color: #ffffff;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  word-break: break-word;
}

.fallback-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fallback-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.sheet-poster-fallback {
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0f172a 100%);
  color: var(--text-secondary);
  padding: 6px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sheet-poster-fallback.theme-0 { background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0f172a 100%); }
.sheet-poster-fallback.theme-1 { background: radial-gradient(circle at 50% 30%, #2e1065 0%, #1e1b4b 100%); }
.sheet-poster-fallback.theme-2 { background: radial-gradient(circle at 50% 30%, #064e3b 0%, #022c22 100%); }
.sheet-poster-fallback.theme-3 { background: radial-gradient(circle at 50% 30%, #4c0519 0%, #290812 100%); }
.sheet-poster-fallback.theme-4 { background: radial-gradient(circle at 50% 30%, #451a03 0%, #271003 100%); }
.sheet-poster-fallback.theme-5 { background: radial-gradient(circle at 50% 30%, #134e4a 0%, #042f2e 100%); }

.poster-hover-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(11, 14, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: none;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.movie-card:hover .poster-hover-badge {
  display: block;
}

.movie-details {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 8px;
}

.movie-title-line {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.25;
}

.movie-year {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
  font-size: 0.85rem;
}

.ratings-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.rating-user {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}

.rating-val {
  color: var(--accent-green);
  font-weight: 600;
  white-space: nowrap;
}

.match-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(64, 188, 244, 0.1);
  padding: 3px 7px;
  border-radius: 4px;
  align-self: flex-start;
}

/* Movie Quick-View Modal / Bottom Sheet */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.movie-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 12px 20px calc(24px + var(--sab));
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.5);
}

.modal-backdrop.active .movie-sheet {
  transform: translateY(0);
}

.sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.sheet-poster {
  width: 76px;
  aspect-ratio: 2 / 3;
  background: #141a24;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

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

.sheet-meta {
  flex: 1;
  min-width: 0;
}

.sheet-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0 0 4px;
}

.sheet-year {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.sheet-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.sheet-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.sheet-ratings-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.sheet-ratings-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.sheet-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sheet-rating-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sheet-actions {
  display: flex;
  gap: 10px;
}

.sheet-btn-primary {
  flex: 1;
  height: 48px;
  background: var(--accent-green);
  color: #051408;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.sheet-btn-primary:hover {
  background: var(--accent-green-hover);
}

.sheet-btn-primary:active {
  transform: scale(0.97);
}

.sheet-btn-secondary {
  height: 48px;
  padding: 0 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

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

.sheet-btn-secondary:active {
  transform: scale(0.97);
}

/* Floating Back-to-Top Button */
.btn-back-to-top {
  position: fixed;
  bottom: calc(20px + var(--sab));
  right: max(20px, var(--sar));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}

.btn-back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.btn-back-to-top:active {
  transform: scale(0.92);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 20px calc(24px + var(--sab));
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text-primary);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 14px;
    height: 56px;
    gap: 8px;
  }

  .brand {
    font-size: 1rem;
    gap: 8px;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
  }

  .brand-icon svg {
    width: 15px;
    height: 15px;
  }

  .btn-sponsor {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .btn-sponsor span {
    display: none;
  }

  .segmented-tabs {
    padding: 2px;
  }

  .tab-btn {
    padding: 5px 12px;
    font-size: 0.8rem;
    min-height: 32px;
  }

  .hero {
    padding: 24px 12px 20px;
  }

  .hero-title {
    font-size: 1.95rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .site-main {
    padding: 20px 14px 60px;
  }

  .form-card {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }

  .input-field-wrapper {
    height: 50px;
  }

  .movie-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .movie-details {
    padding: 10px 12px;
  }

  .movie-title-line {
    font-size: 0.86rem;
  }

  .movie-year {
    font-size: 0.78rem;
  }

  .results-summary-card {
    padding: 16px;
  }

  .results-headline h1 {
    font-size: 1.35rem;
  }

  .results-stats-pills {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-pill {
    padding: 8px 12px;
    min-width: unset;
  }

  .stat-pill-value {
    font-size: 1.2rem;
  }

  /* Sticky controls bar for seamless mobile scrolling */
  .controls-bar {
    position: sticky;
    top: calc(56px + var(--sat));
    z-index: 80;
    background: rgba(11, 14, 20, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 0;
    margin-bottom: 16px;
    flex-direction: column;
    gap: 10px;
  }

  .search-wrapper {
    width: 100%;
    min-width: unset;
    height: 44px;
  }

  .sort-select-wrapper {
    width: 100%;
  }

  .sort-select-wrapper select {
    width: 100%;
    height: 44px;
  }
}

@media (max-width: 380px) {
  .brand span {
    display: none;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .movie-grid {
    gap: 8px;
  }

  .movie-details {
    padding: 8px 10px;
  }
}

/* Modal Desktop Centering */
@media (min-width: 769px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }

  .movie-sheet {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-medium);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    padding: 24px;
  }

  .modal-backdrop.active .movie-sheet {
    transform: scale(1);
    opacity: 1;
  }

  .sheet-drag-handle {
    display: none;
  }
}

/* Social Media Poster Generator Modal */
.poster-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 20px 20px calc(24px + var(--sab));
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.modal-backdrop.active .poster-sheet {
  transform: translateY(0);
}

.poster-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.poster-title-box {
  flex: 1;
}

.poster-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.poster-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.poster-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  align-items: center;
  justify-content: space-between;
}

.poster-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poster-control-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.poster-segmented-control {
  display: inline-flex;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.poster-format-btn,
.poster-theme-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 28px;
}

.poster-format-btn:hover,
.poster-theme-btn:hover {
  color: var(--text-primary);
}

.poster-format-btn.active,
.poster-theme-btn.active {
  background: var(--bg-elevated);
  color: var(--accent-green);
  border: 1px solid var(--border-medium);
}

.poster-theme-btn[data-theme="light"].active {
  color: #00b341;
}

.poster-theme-btn[data-theme="cream"].active {
  color: #c25e00;
}

.poster-theme-btn[data-theme="mono"].active {
  color: #f4f4f5;
}

.poster-preview-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #080a10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 280px;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.poster-canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.poster-canvas-wrapper canvas {
  max-width: 100%;
  height: auto;
  max-height: 50vh;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.2);
  display: block;
}

.poster-status-message {
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-green);
  min-height: 20px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.poster-status-message.visible {
  opacity: 1;
  transform: translateY(0);
}

.poster-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-poster-primary {
  flex: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-green);
  color: #0b0e14;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 46px;
  box-shadow: 0 4px 14px rgba(0, 224, 84, 0.25);
}

.btn-poster-primary:hover {
  background: var(--accent-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 224, 84, 0.35);
}

.btn-poster-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-poster-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 46px;
}

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

.btn-poster-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (min-width: 769px) {
  .poster-sheet {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-medium);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    padding: 24px;
    max-height: 88vh;
  }

  .modal-backdrop.active .poster-sheet {
    transform: scale(1);
    opacity: 1;
  }
}

/* Sleek Export Dropdown Menu */
.export-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.export-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 230px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.export-dropdown-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.export-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition: background 0.12s ease;
}

.export-dropdown-item:hover {
  background: var(--bg-surface-hover);
}

.export-dropdown-item svg {
  flex-shrink: 0;
}

.export-item-text {
  display: flex;
  flex-direction: column;
}

.export-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.export-item-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}





/* Sleek Sync Banner */
.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 224, 84, 0.04);
  border: 1px solid rgba(0, 224, 84, 0.16);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-top: 14px;
  gap: 12px;
  font-size: 0.83rem;
}

@media (max-width: 640px) {
  .sync-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}

/* ==========================================================================
   Mobile-Responsive Sign In / Sign Up Modal & Navigation Elements
   ========================================================================== */

.btn-signin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
  white-space: nowrap;
}

.btn-signin:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-green);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 224, 84, 0.15);
}

.btn-signin:active {
  transform: scale(0.98);
}

/* User Profile Chip */
.user-chip-wrapper {
  position: relative;
  display: inline-block;
}

.btn-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: all 0.15s ease;
}

.btn-user-chip:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.user-chip-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  object-fit: cover;
}

.user-chip-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dropdown */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 6px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all 0.15s ease;
}

.user-dropdown-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.user-dropdown-email {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-handle {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.user-dropdown-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.user-dropdown-item.signout-item:hover {
  color: var(--accent-red);
}

/* Auth Modal Backdrop */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}

.auth-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Auth Modal Card */
.auth-modal-card {
  width: 100%;
  max-width: 400px;
  background: #111620;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 1px rgba(255, 255, 255, 0.15);
  padding: 26px 24px;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  position: relative;
}

.auth-modal-backdrop.active .auth-modal-card {
  transform: scale(1) translateY(0);
}

.modal-drag-handle {
  display: none;
}

.auth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.auth-modal-title {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

.auth-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.auth-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
}

.auth-modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

/* Auth Mode Toggle Pills */
.auth-tabs {
  display: flex;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: 20px;
  gap: 3px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.auth-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Form inputs inside Auth Modal */
.auth-form-group {
  margin-bottom: 16px;
}

.auth-form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.auth-text-input {
  width: 100%;
  height: 46px;
  background: #141923;
  background-clip: padding-box;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.94rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-text-input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(0, 224, 84, 0.15);
}

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

.auth-password-wrapper {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.auth-password-wrapper .auth-text-input {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  background: transparent !important;
  border: none !important;
  outline: none;
  box-shadow: none !important;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
}

.auth-password-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06) !important;
}

.auth-password-toggle:focus-visible {
  color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(0, 224, 84, 0.3) !important;
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
  display: block;
}

/* Turnstile Container */
.turnstile-box {
  margin: 14px 0 18px;
  min-height: 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Auth Feedback Banner */
.auth-feedback-msg {
  font-size: 0.82rem;
  min-height: 20px;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: none;
  line-height: 1.4;
}

.auth-feedback-msg.error {
  display: block;
  color: #ff6b6b;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.auth-feedback-msg.success {
  display: block;
  color: var(--accent-green);
  background: rgba(0, 224, 84, 0.1);
  border: 1px solid rgba(0, 224, 84, 0.25);
}

.auth-submit-btn {
  width: 100%;
  height: 48px;
  background: var(--accent-green);
  color: #0b0e14;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.auth-submit-btn:hover {
  background: var(--accent-green-hover);
  box-shadow: 0 4px 16px rgba(0, 224, 84, 0.35);
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-footer-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-switch-link {
  background: none;
  border: none;
  color: var(--accent-green);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Mobile Bottom-Sheet Drawer (< 640px) */
@media (max-width: 640px) {
  .auth-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .auth-modal-card {
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    padding: 16px 20px max(24px, env(safe-area-inset-bottom, 24px));
    transform: translateY(100%);
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.65);
  }

  .auth-modal-backdrop.active .auth-modal-card {
    transform: translateY(0);
  }

  .modal-drag-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto 14px;
  }

  .nav-actions {
    gap: 6px;
  }

  .btn-signin {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-height: 34px;
  }
}

