/* ========================================================
   SIRENE AMIGA — Premium Dark Aurora Theme
   ======================================================== */

/* --- Design Tokens --- */
:root {
  --bg-deep: #050816;
  --bg-surface: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-elevated: rgba(30, 41, 59, 0.55);
  --bg-input: rgba(15, 23, 42, 0.6);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(148, 163, 184, 0.1);
  --border-light: rgba(148, 163, 184, 0.18);
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --primary-glow: rgba(139, 92, 246, 0.25);
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.2);
  --success: #10b981;
  --danger: #ef4444;
  --danger-hover: #f87171;
  --gradient-primary: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-aurora: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #10b981 100%);
  --gradient-text: linear-gradient(135deg, #c4b5fd, #67e8f9, #6ee7b7);
  --shadow-glow: 0 0 60px rgba(139, 92, 246, 0.12);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-button: 0 4px 16px rgba(139, 92, 246, 0.3);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --glass-blur: blur(20px);
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  color: var(--text-primary);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-deep);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  display: block;
  max-width: 100%;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 700;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Form Elements --- */
button,
input,
select,
textarea {
  font: inherit;
  color: var(--text-primary);
  border: none;
  outline: none;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

input[type="range"] {
  padding: 0;
  background: transparent;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  margin: 0.5rem 0;
}

input[type="range"]::-webkit-slider-track {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-surface);
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 0 8px var(--primary-glow);
}

input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 12px var(--primary-glow);
}

input[type="checkbox"] {
  width: 44px;
  height: 24px;
  padding: 0;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition-normal), background var(--transition-fast);
}

input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
  transform: translateX(20px);
  background: white;
}

/* --- Buttons --- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

button:hover {
  background: rgba(51, 65, 85, 0.6);
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.25);
}

button:active {
  transform: scale(0.97);
}

button.primary {
  background: var(--primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-button);
}

button.primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

button.gradient-btn {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-button);
  position: relative;
  overflow: hidden;
}

button.gradient-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

button.gradient-btn:hover::before {
  opacity: 1;
}

button.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

button.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger-hover);
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.icon-btn.lg {
  width: 52px;
  height: 52px;
  font-size: 1.3rem;
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.stack {
  display: grid;
  gap: 0.75rem;
}

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

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

label {
  display: block;
}

label .label-text {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Pill / Badge --- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-glow);
  color: var(--primary-hover);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.pill.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

.pill.offline {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
  border-color: rgba(245, 158, 11, 0.25);
  animation: pulse-pill 2s ease-in-out infinite;
}

.pill.muted-pill {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border-color: rgba(100, 116, 139, 0.2);
}

.pill.active-pill {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

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

/* --- Card / Panel --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-normal);
}

.card:hover {
  border-color: var(--border-light);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.1rem;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header .card-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.card-icon.purple { background: var(--primary-glow); }
.card-icon.cyan { background: rgba(6, 182, 212, 0.2); }
.card-icon.amber { background: var(--accent-glow); }
.card-icon.green { background: rgba(16, 185, 129, 0.2); }
.card-icon.red { background: rgba(239, 68, 68, 0.15); }

/* --- Item Card (tracks, schedules, users) --- */
.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.item-card:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: var(--border-light);
}

.item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.item-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0 0;
}

.item-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.actions-row {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* --- Switch component --- */
.switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.switch span {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.switch input {
  width: auto;
}

/* =========================================
   LANDING PAGE
   ========================================= */
.landing {
  position: relative;
  min-height: 100vh;
  animation: land-in 600ms ease both;
}

/* Aurora background mesh */
.landing::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(139, 92, 246, 0.12), transparent),
    radial-gradient(ellipse 50% 60% at 80% 30%, rgba(6, 182, 212, 0.08), transparent),
    radial-gradient(ellipse 40% 40% at 50% 80%, rgba(16, 185, 129, 0.06), transparent),
    radial-gradient(ellipse 30% 30% at 75% 75%, rgba(245, 158, 11, 0.05), transparent);
  z-index: -1;
  pointer-events: none;
}

/* Floating orbs */
.landing::after {
  content: '';
  position: fixed;
  top: 10%;
  right: 10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08), transparent 70%);
  animation: float-orb 12s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 20px) scale(1.05); }
  66% { transform: translate(20px, -30px) scale(0.95); }
}

.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* -- Landing Nav -- */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

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

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--gradient-primary);
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.brand-name {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.nav-cta {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.nav-cta:hover {
  background: var(--primary-glow);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--primary-hover);
}

/* -- Hero Section -- */
.landing-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 2rem 0 4rem;
}

.hero-content {
  max-width: 620px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--primary-hover);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

.hero-title {
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 520px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
}

.hero-btn.primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
  border: none;
}

.hero-btn.primary:hover {
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

.hero-btn.secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.hero-btn.secondary:hover {
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-primary);
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.trust-badge .badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

/* -- Auth Card -- */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: sticky;
  top: 2rem;
  max-width: 420px;
  width: 100%;
  justify-self: end;
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-header .eyebrow-text {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-hover);
  margin-bottom: 0.35rem;
}

.auth-header h2 {
  font-size: 1.8rem;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-form button[type="submit"] {
  margin-top: 0.35rem;
}

.auth-form button:not(.primary) {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.auth-form button:not(.primary):hover {
  color: var(--primary-hover);
  border-color: var(--primary-glow);
}

/* -- Feature Strip -- */
.features-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 3rem 0;
}

.feature-strip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-normal);
}

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

.feature-number {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.feature-strip-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.feature-strip-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* -- Story Section -- */
.story-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 4rem 0;
}

.story-section h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.05;
}

.story-section p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* -- Feature Grid -- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 0 0 4rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-normal);
  min-height: 180px;
}

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

.feature-card.tall {
  grid-row: span 2;
}

.feature-card.wide {
  grid-column: span 2;
}

.feature-icon-box {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.feature-icon-box.purple {
  background: var(--primary-glow);
}

.feature-icon-box.cyan {
  background: rgba(6, 182, 212, 0.18);
}

.feature-icon-box.amber {
  background: var(--accent-glow);
}

.feature-icon-box.green {
  background: rgba(16, 185, 129, 0.18);
}

.feature-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* -- Landing Footer -- */
.landing-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

@keyframes land-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   APP VIEW
   ========================================= */
.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem 6rem;
  animation: app-in 400ms ease both;
}

@keyframes app-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* -- Top Bar -- */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar-brand {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient-primary);
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.topbar-info {
  min-width: 0;
}

.topbar-info .school-label {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-info .school-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* -- School Switcher -- */
.school-switcher {
  display: block;
  max-width: 100%;
  margin-bottom: 0.75rem;
}

.school-switcher span {
  display: none;
}

.school-switcher select {
  font-size: 0.82rem;
}

/* -- Player Section -- */
.player-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
}

.player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.player-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.player-toggle span {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.visual-stage {
  display: grid;
  place-items: center;
  min-height: 140px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.8)),
    radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.08), transparent 50%);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 0.75rem;
  transition: min-height var(--transition-smooth);
}

.visual-stage.expanded {
  min-height: 320px;
}

.visual-stage img,
.visual-stage video {
  width: 100%;
  height: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #000;
}

.visual-stage p {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.player-audio-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-audio-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.player-audio-status.playing .status-dot {
  background: var(--success);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

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

.player-controls button {
  flex: 1;
  min-width: 100px;
}

/* -- Tab Navigation -- */
.tab-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
}

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

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.tab-btn .tab-icon {
  font-size: 1rem;
}

.tab-content {
  display: none;
  animation: tab-in 300ms ease both;
}

.tab-content.active {
  display: grid;
  gap: 1rem;
}

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

/* -- Form Grids -- */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.form-row.compact {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.form-row .full-width {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
}

/* -- Days Picker -- */
.days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  grid-column: 1 / -1;
}

.day-chip {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.day-chip:hover {
  border-color: var(--primary-glow);
  color: var(--text-secondary);
}

.day-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* -- Announce Form -- */
.announce-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

/* -- Toast notifications -- */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 2rem);
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  pointer-events: auto;
  animation: toast-in 300ms ease both;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.toast.leaving {
  animation: toast-out 250ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px) scale(0.95); }
}

/* -- User Form -- */
.user-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 880px) {
  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 1.5rem 0 2rem;
  }

  .auth-card {
    position: static;
    max-width: 100%;
    justify-self: stretch;
  }

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

  .story-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2.5rem 0;
  }

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

  .feature-card.tall,
  .feature-card.wide {
    grid-row: auto;
    grid-column: auto;
  }

  .app-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    justify-content: flex-end;
  }

  .player-controls {
    flex-direction: column;
  }

  .player-controls button {
    min-width: auto;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .user-form-grid {
    grid-template-columns: 1fr;
  }

  .announce-row {
    grid-template-columns: 1fr;
  }

  .item-card {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-row {
    justify-content: flex-end;
  }

  .tab-btn .tab-label {
    display: none;
  }

  .tab-btn .tab-icon {
    font-size: 1.2rem;
  }

  .tab-btn {
    padding: 0.65rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

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

  .days {
    justify-content: center;
  }
}

/* =========================================
   SCROLLBAR
   ========================================= */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.35);
}

/* =========================================
   WAVE ANIMATION (landing decoration)
   ========================================= */
.wave-decoration {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}

.wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--gradient-primary);
  animation: wave-bounce 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 50%; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 90%; animation-delay: 0.3s; }
.wave-bar:nth-child(5) { height: 60%; animation-delay: 0.4s; }

@keyframes wave-bounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* =========================================
   EMPTY STATE
   ========================================= */
.empty-state {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
}

.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* =========================================
   INTERCOM — Push-to-Talk
   ========================================= */
.talk-btn {
  width: 100%;
  min-height: 72px;
  border-radius: var(--radius-lg);
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--bg-elevated);
  border: 2px solid var(--border-light);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.talk-btn:hover {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
  color: var(--text-primary);
}

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

.talk-btn.recording {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: white;
  animation: talk-pulse 1.2s ease-in-out infinite;
}

@keyframes talk-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
  }
}

.talk-btn.recording::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.1), transparent 60%);
  transform: translate(-50%, -50%);
  animation: talk-glow 2s ease-in-out infinite;
}

@keyframes talk-glow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.8); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.intercom-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* Hero Talk Button (prominent for operators) */
.talk-btn-hero {
  min-height: 90px;
  font-size: 1.3rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
  border: 2px solid rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.08);
}

.talk-btn-hero:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
}

/* TTS Controls */
.tts-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 480px) {
  .tts-controls {
    grid-template-columns: 1fr 1fr;
  }
}

.tts-voice-label select {
  width: 100%;
}

.volume-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.vol-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.vol-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 36px;
  text-align: right;
}

/* Custom range slider */
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border-light);
  outline: none;
  transition: background var(--transition-fast);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(var(--gradient-primary));
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.5);
}

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(var(--gradient-primary));
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
  cursor: pointer;
  border: none;
}

.volume-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--border-light);
}

/* Incoming intercom banner on player */
.intercom-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger-hover);
  font-size: 0.85rem;
  font-weight: 600;
  animation: intercom-in 300ms ease both;
}

.intercom-banner .rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse-dot 1s ease-in-out infinite;
}

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

/* =========================================
   ADMIN PANEL
   ========================================= */

/* Current school badge (shown when super_admin is managing a specific school) */
.admin-school-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  margin: 0 var(--spacing-md);
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  font-size: 0.82rem;
}

.admin-school-badge .badge-label {
  color: var(--text-muted);
  font-weight: 500;
}

.admin-school-badge .badge-name {
  color: var(--primary);
  font-weight: 700;
  flex: 1;
}

.admin-school-badge .badge-btn {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-school-badge .badge-btn:hover {
  background: rgba(139, 92, 246, 0.25);
}

/* Search input */
.admin-search {
  margin-bottom: 1rem;
}

.admin-search input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.admin-search input:focus {
  outline: none;
  border-color: var(--primary);
}

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

/* Schools grid */
.admin-schools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .admin-schools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* School card */
.school-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  cursor: default;
}

.school-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.04);
}

.school-card.active {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.08);
}

.school-card .school-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.school-card .school-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(var(--gradient-primary));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
}

.school-card .school-card-info {
  flex: 1;
  min-width: 0;
}

.school-card .school-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  word-break: break-word;
}

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

.school-card .school-card-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.school-card .stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.school-card .stat-icon {
  font-size: 0.7rem;
}

.school-card .enter-school-btn {
  width: 100%;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(var(--gradient-primary));
  border: none;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.85;
}

.school-card .enter-school-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.admin-no-results {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* --- Quick Messages --- */
.quick-msg-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-msg-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  width: 100%;
}

.quick-msg-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
}

/* --- Expositor Mode --- */
body.expositor-mode {
  background: #000;
}

body.expositor-mode .app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 0.4rem 1rem;
}

body.expositor-mode .player-section {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0;
  background: #000;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.expositor-mode .visual-stage {
  flex: 1;
  min-height: 100vh;
  border-radius: 0;
  background: #000;
}

body.expositor-mode .visual-stage img,
body.expositor-mode .visual-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.expositor-mode .player-top,
body.expositor-mode .player-controls {
  display: none;
}

body.expositor-mode .intercom-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
}
