/* ==========================================================================
   Watchlist Burner Theme (Letterboxd Flame & Dark Cinema)
   ========================================================================== */

:root {
  --bg: #0c0f14;
  --surface: #141922;
  --surface-glass: rgba(20, 25, 34, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #00E054;
  
  --text-main: #f0f3f6;
  --text-muted: #8b949e;
  --text-dim: #586069;
  
  /* Brand Flame Palette */
  --flame-green: #00E054;
  --flame-cyan: #40BCF4;
  --flame-orange: #FF8000;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 24px 48px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Ambient Background Glows
   ========================================================================== */

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

.glow-green {
  width: 480px;
  height: 480px;
  background: var(--flame-green);
  top: -120px;
  left: 15%;
}

.glow-orange {
  width: 400px;
  height: 400px;
  background: var(--flame-orange);
  bottom: 5%;
  right: 10%;
}

.glow-cyan {
  width: 350px;
  height: 350px;
  background: var(--flame-cyan);
  top: 40%;
  left: 65%;
}

/* ==========================================================================
   Header / Topbar
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  height: 28px;
  width: 28px;
  object-fit: contain;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.logo span {
  color: var(--flame-orange);
  background: linear-gradient(135deg, var(--flame-green), var(--flame-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.status {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Status Bar Segments */
.statusbar[hidden] {
  display: none;
}

.statusbar {
  display: flex;
  width: 200px;
  height: 8px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  overflow: visible;
  position: relative;
}

.statusbar-seg {
  position: relative;
  height: 100%;
  min-width: 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.statusbar-watched { background: var(--flame-green); }
.statusbar-library { background: var(--flame-cyan); }
.statusbar-nolib   { background: var(--flame-orange); }

.statusbar-tip {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #19202c;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
  z-index: 20;
}

.statusbar-seg:hover .statusbar-tip { display: block; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-secondary:hover {
  background: #1d2533;
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
  width: 100%;
  margin-top: 10px;
  padding: 13px 20px;
  font-size: 0.95rem;
  border: none;
  background: linear-gradient(135deg, #00E054 0%, #00b343 100%);
  color: #07190c;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

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

/* ==========================================================================
   View Container & Auth Cards
   ========================================================================== */

.view {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 160px);
  padding: 20px 0;
}

.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  position: relative;
  animation: cardFadeUp 0.4s ease-out;
}

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

.card-header {
  text-align: center;
  margin-bottom: 26px;
}

.hero-icon {
  height: 128px;
  object-fit: contain;
}

.card-header h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.card-header .subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* ==========================================================================
   Form Elements & Inputs
   ========================================================================== */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.field-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s ease;
}

input {
  width: 100%;
  background: rgba(12, 15, 20, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px 42px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
  outline: none;
}

input::placeholder {
  color: var(--text-dim);
}

input:focus {
  background: rgba(12, 15, 20, 0.95);
  border-color: var(--flame-green);
  box-shadow: 0 0 0 3px rgba(0, 224, 84, 0.15);
}

.input-wrapper:focus-within .input-icon {
  color: var(--flame-green);
}

.form-divider {
  position: relative;
  text-align: center;
  margin: 4px 0;
}

.form-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.form-divider span {
  position: relative;
  background: #141922;
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

/* Privacy & Error Banners */
.privacy-note {
  margin-top: 22px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 1.45;
}

.privacy-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-muted);
}

.error-banner {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--radius-sm);
  color: #ff7b7b;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: center;
}

/* ==========================================================================
   Loading View
   ========================================================================== */

.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 60vh;
  text-align: center;
}

.progress-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.3s ease;
}

.progress-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.loading-text {
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  animation: pulseText 2s ease-in-out infinite;
}

.loading-detail {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 380px;
  line-height: 1.4;
}

@keyframes pulseText {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* ==========================================================================
   Poster Grid View
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

.poster {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.poster a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: #111;
}

.poster:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 28px rgba(0,0,0,0.6);
}

.poster.disabled {
  opacity: 0.4;
  filter: grayscale(0.85);
}

.poster.disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  color: #ff9f43;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 159, 67, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  margin-top: 80px;
  font-size: 1.05rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 600px) {
  .topbar {
    padding: 12px 16px;
  }
  .statusbar {
    width: 120px;
  }
  .glass-card {
    padding: 28px 20px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }
}