/* ═══════════════════════════════════════════════════════════
   BONITA — CINEMATIC LAB UI
   "This is not a dashboard. It is an atmosphere."
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   CSS VARIABLES — Bonita's Palette
   ───────────────────────────────────────────────────────────── */
:root {
  /* Canvas */
  --canvas-base: #0A0A0A;
  --canvas-elevated: #111111;
  
  /* Amber (from portrait lighting) */
  --amber-warm: #D4943A;
  --amber-deep: #8B5A2B;
  --amber-glow: #1A1305;
  
  /* Burgundy (headwrap) */
  --burgundy: #8B2942;
  --burgundy-deep: #6B1F32;
  
  /* Gold (earrings / emphasis) */
  --gold: #D4AF37;
  --gold-muted: #B8962F;
  
  /* Text */
  --text-primary: #F5F5F5;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;
  
  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  
  /* Transitions */
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--canvas-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────
   GLOBAL OVERLAYS — Cinema Feel
   ───────────────────────────────────────────────────────────── */

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

/* Amber Radial Glow */
.amber-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    ellipse 80% 60% at 85% 80%,
    var(--amber-glow) 0%,
    transparent 70%
  );
}

/* ─────────────────────────────────────────────────────────────
   VIEWS — Transition System
   ───────────────────────────────────────────────────────────── */
.view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  z-index: 10;
}

.view.active {
  opacity: 1;
  visibility: visible;
}

/* ─────────────────────────────────────────────────────────────
   LANDING PAGE
   ───────────────────────────────────────────────────────────── */
#landing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.landing-content {
  padding: var(--space-xl);
  padding-left: 8%;
  z-index: 20;
}

.hero-text h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.tagline {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}

.cta-button {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-style: italic;
  color: var(--gold);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color var(--transition-smooth);
}

.cta-button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0.6);
  transform-origin: left;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.cta-button:hover::after {
  transform: scaleX(1);
  box-shadow: 0 0 12px var(--gold-muted);
}

/* Portrait Panel */
.portrait-panel {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.bonita-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%; /* Crown Protection: anchor at face, not top of head */
}

.portrait-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--canvas-base) 0%,
    transparent 30%
  );
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────
   CHAT INTERFACE — The Cinematic Lab
   ───────────────────────────────────────────────────────────── */
#chat {
  display: grid;
  grid-template-columns: 1fr 400px;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: var(--space-lg);
  padding-right: var(--space-md);
  z-index: 20;
}

/* Header */
.chat-header {
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: var(--space-md);
}

.bonita-presence {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.presence-indicator {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: presence-pulse 3s ease-in-out infinite;
}

@keyframes presence-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.presence-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-primary);
}

/* Messages Area */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Hide scrollbar but allow scroll */
.messages-area::-webkit-scrollbar {
  width: 4px;
}
.messages-area::-webkit-scrollbar-track {
  background: transparent;
}
.messages-area::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

/* Message Styling — No bubbles, clean stacking */
.message {
  max-width: 75%;
  line-height: 1.8;
}

.message.user {
  align-self: flex-end;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.message.bonita {
  align-self: flex-start;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
}

.message.bonita .message-line {
  opacity: 0;
  animation: line-fade-in 0.6s ease forwards;
  margin-bottom: 0.5em;
}

.message.bonita .message-line:last-child {
  margin-bottom: 0;
}

.para-spacer {
  height: 1em;
}

@keyframes line-fade-in {
  from { 
    opacity: 0; 
    transform: translateY(6px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
  }
}

/* ─────────────────────────────────────────────────────────────
   INTRO SEQUENCE — The Four-Bar Cadence
   ───────────────────────────────────────────────────────────── */
.intro-sequence {
  max-width: 85%;
}

.intro-sequence .intro-bar {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  margin-bottom: 0.8em;
}

.intro-sequence .intro-bar.visible {
  opacity: 1;
  transform: translateY(0);
}

.intro-sequence .intro-bar:last-child {
  color: var(--gold);
  font-style: normal;
  margin-top: 0.4em;
}

/* Listening State — Ambient Pulse (not bouncing dots) */
.listening-state {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}

.listening-state.hidden {
  display: none;
}

.ambient-pulse {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--amber-warm);
  opacity: 0.6;
  animation: ambient-breathe 2.5s ease-in-out infinite;
}

@keyframes ambient-breathe {
  0%, 100% { 
    transform: scale(0.8);
    opacity: 0.4;
    box-shadow: 0 0 0 0 rgba(212, 148, 58, 0);
  }
  50% { 
    transform: scale(1);
    opacity: 0.8;
    box-shadow: 0 0 20px 8px rgba(212, 148, 58, 0.2);
  }
}

.listening-text {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Input Area */
.input-area {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.input-wrapper {
  flex: 1;
  position: relative;
}

#user-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: var(--space-sm) 0;
  resize: none;
  line-height: 1.5;
}

#user-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.input-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--gold-muted);
  opacity: 0.4;
  transition: opacity var(--transition-smooth), box-shadow var(--transition-smooth);
}

#user-input:focus ~ .input-underline {
  opacity: 1;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.send-button {
  background: transparent;
  border: none;
  color: var(--gold);
  cursor: pointer;
  padding: var(--space-xs);
  opacity: 0.6;
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.send-button:hover {
  opacity: 1;
  transform: translateX(2px);
}

/* Chat Portrait Sidebar */
.chat-portrait {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.bonita-portrait-small {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%; /* Crown Protection: anchor at face, not top of head */
  opacity: 0.9;
}

.chat-portrait .portrait-gradient {
  background: linear-gradient(
    90deg,
    var(--canvas-base) 0%,
    transparent 50%
  );
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE — Mobile First
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  #chat {
    grid-template-columns: 1fr;
  }
  
  .chat-portrait {
    display: none;
  }
  
  .chat-container {
    padding: var(--space-md);
  }
}

@media (max-width: 768px) {
  /* Landing */
  #landing {
    grid-template-columns: 1fr;
    grid-template-rows: 40vh 1fr;
  }
  
  .portrait-panel {
    order: -1;
  }
  
  .portrait-gradient {
    background: linear-gradient(
      180deg,
      transparent 50%,
      var(--canvas-base) 100%
    );
  }
  
  .landing-content {
    padding: var(--space-lg);
    text-align: center;
  }
  
  .hero-text h1 {
    font-size: 1.75rem;
  }
  
  .cta-button::after {
    left: 50%;
    transform: translateX(-50%) scaleX(0.6);
    transform-origin: center;
  }
  
  .cta-button:hover::after {
    transform: translateX(-50%) scaleX(1);
  }
  
  /* Chat */
  .message {
    max-width: 90%;
  }
}

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

/* Focus states */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATION WAITLIST MODAL — Stills-First v1.0
   ═══════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

body.modal-open {
  overflow: hidden;
}

.modal-content {
  background: var(--canvas-elevated);
  border: 1px solid rgba(212, 148, 58, 0.15);
  border-radius: 12px;
  max-width: 440px;
  width: 90%;
  padding: var(--space-lg);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-header {
  text-align: center;
  margin-bottom: var(--space-md);
}

.modal-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-xs);
}

.modal-header h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.modal-lead {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.modal-detail {
  color: var(--amber-warm);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

.waitlist-form {
  margin-top: var(--space-md);
}

.form-group {
  margin-bottom: var(--space-sm);
}

.form-group input[type="email"] {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--canvas-base);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.form-group input[type="email"]:focus {
  outline: none;
  border-color: var(--amber-warm);
}

.form-group input[type="email"]::placeholder {
  color: var(--text-muted);
}

.preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--amber-warm);
}

.waitlist-submit {
  width: 100%;
  padding: 0.875rem;
  background: var(--amber-warm);
  border: none;
  border-radius: 8px;
  color: var(--canvas-base);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-top: var(--space-sm);
}

.waitlist-submit:hover {
  background: var(--gold);
  transform: translateY(-1px);
}

.modal-footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: var(--space-sm);
}

.modal-success {
  text-align: center;
  padding: var(--space-md) 0;
}

.modal-success .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(212, 148, 58, 0.15);
  border-radius: 50%;
  color: var(--amber-warm);
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.modal-success h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs) 0;
}

.modal-success p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   GENERATION GALLERY — with ContentCreators Standard Badge
   ═══════════════════════════════════════════════════════════ */

.generation-gallery {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: var(--space-lg);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.gallery-header h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.request-animation-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(212, 148, 58, 0.3);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.request-animation-btn:hover {
  border-color: var(--amber-warm);
  color: var(--amber-warm);
}

.coming-soon-tag {
  background: rgba(212, 148, 58, 0.15);
  color: var(--amber-warm);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--canvas-elevated);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gallery-image-container {
  position: relative;
  aspect-ratio: 1;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════
   CONTENTCREATORS STANDARD BADGE
   "This isn't branding. This is authorship."
   ═══════════════════════════════════════════════════════════ */

.ccs-badge {
  position: absolute;
  bottom: var(--space-xs);
  left: var(--space-xs);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gallery-item:hover .ccs-badge {
  opacity: 1;
  transform: translateY(0);
}

.badge-icon {
  color: var(--gold);
  font-size: 0.7rem;
}

.badge-text {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Tier Badge */
.tier-badge {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge.tier-standard {
  background: rgba(160, 160, 160, 0.2);
  color: var(--text-secondary);
}

.tier-badge.tier-pro {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold);
}

/* Gallery Actions */
.gallery-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--canvas-base);
}

.gallery-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-btn:hover {
  border-color: var(--amber-warm);
  color: var(--amber-warm);
}

.gallery-btn.animate-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════
   HIDDEN UTILITY
   ═══════════════════════════════════════════════════════════ */

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   CLARITY NOTES — Trust Signals, Not Features
   "Default ON. Subtle. Builds trust."
   ═══════════════════════════════════════════════════════════ */

.clarity-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-sm);
  padding-top: var(--space-xs);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  animation: clarityFadeIn 0.4s ease forwards;
  animation-delay: 0.6s;
}

@keyframes clarityFadeIn {
  to { opacity: 0.5; }
}

.clarity-note:hover {
  opacity: 0.8;
}

.clarity-icon {
  font-size: 0.7rem;
  color: var(--gold-muted);
}

.clarity-text {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

/* ═══════════════════════════════════════════════════════════
   DIGNITY REFINEMENTS — Remove Template Feel
   "If it feels like stock AI, it fails."
   ═══════════════════════════════════════════════════════════ */

/* Softer transitions for trust */
.message.bonita {
  transition: opacity 0.4s ease;
}

/* Remove any sharp corners — everything should feel organic */
.message, 
.modal-content, 
.gallery-item,
.cta-button,
.send-button {
  border-radius: 8px;
}

/* Subtle hover states — not aggressive */
.cta-button:hover,
.send-button:hover {
  transform: translateY(-1px);
  transition: transform 0.3s ease;
}

/* Gallery: Honor-based visual hierarchy */
.gallery-item[data-quality="stellar"] {
  border-color: rgba(212, 175, 55, 0.3);
}

.gallery-item[data-quality="stellar"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-muted), transparent);
}

/* Thoughtful spacing — not cramped, not wasteful */
.messages-area {
  padding: var(--space-md);
}

.message + .message {
  margin-top: var(--space-md);
}

/* Input area — inviting, not demanding */
.input-wrapper {
  position: relative;
}

.input-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber-warm), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.input-wrapper:focus-within::after {
  opacity: 0.5;
}

/* Remove anything that screams "AI chatbot" */
.message.user {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.message.bonita {
  background: transparent;
  border: none;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS — The Welcome Mat
   ═══════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--canvas-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  max-width: 380px;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Student Welcome — Special styling */
.toast.student-welcome {
  border-color: rgba(212, 175, 55, 0.3);
  background: linear-gradient(135deg, var(--canvas-elevated) 0%, rgba(212, 175, 55, 0.05) 100%);
}

.toast.student-welcome .toast-title {
  color: var(--gold);
}

.toast.student-welcome .toast-message strong {
  color: var(--gold);
}

/* Toast types */
.toast-success { border-left: 3px solid #4CAF50; }
.toast-error { border-left: 3px solid #f44336; }
.toast-info { border-left: 3px solid var(--amber-warm); }

/* ═══════════════════════════════════════════════════════════
   CREDIT BADGE — Top-right visibility
   ═══════════════════════════════════════════════════════════ */

.credit-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.credit-badge:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
}

.credit-icon {
  color: var(--gold);
  font-size: 0.85rem;
}

.credit-count {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  transition: transform 0.2s ease;
}

.credit-count.credit-updated {
  transform: scale(1.2);
}

.credit-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: lowercase;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE — The Front Door
   ═══════════════════════════════════════════════════════════ */

#login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--canvas-base);
  z-index: 100;
}

#login-page.active {
  display: flex;
}

.login-container {
  max-width: 420px;
  width: 90%;
  padding: 2.5rem;
  text-align: center;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.login-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* Google Sign-In Button */
.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.google-signin-btn:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.login-footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--amber-warm);
  text-decoration: none;
}

/* Student badge in login */
.student-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--gold-muted);
}

/* ═══════════════════════════════════════════════════════════
   USER HEADER — When authenticated
   ═══════════════════════════════════════════════════════════ */

.user-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, var(--canvas-base) 0%, transparent 100%);
  z-index: 50;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.user-tier {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-tier.student {
  color: var(--gold);
}
