/* 
 * Relayra "Clean Slate" Design System
 * Aesthetic: High-end SaaS, Minimalist, Airy, Precision.
 * Palette: Emerald (Active), Slate (Neutral), White (Surface).
 */

:root {
  /* --- Primary: Emerald --- */
  --primary: #10B981;       /* Emerald 500 */
  --primary-dark: #059669;  /* Emerald 600 */
  --primary-light: #6EE7B7; /* Emerald 300 */
  --primary-faint: #ECFDF5; /* Emerald 50 */
  
  /* --- Semantic Colors --- */
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #3B82F6;
  --info-light: #EFF6FF;

  /* --- Neutral: Slate --- */
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* --- Background & Surface --- */
  --bg-primary: #FFFFFF;
  --bg-secondary: var(--slate-50);
  --bg-tertiary: var(--slate-100);
  
  /* --- Text Colors --- */
  --text-primary: var(--slate-900);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-400);
  --text-inverse: #FFFFFF;

  /* --- Borders (Hairline rule) --- */
  --border-primary: rgba(0, 0, 0, 0.08); /* Slightly darkened for clarity */
  --border-active: var(--primary);
  
  /* --- Typography --- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* --- Spacing & Radius --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;   /* rounded-2xl equivalent */
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Shadows (Airy/Subtle) --- */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-card: 0 8px 30px rgb(0 0 0 / 0.04);
  --shadow-hover: 0 12px 40px rgb(0 0 0 / 0.06);

  /* --- Emerald Glow (restrained, professional) --- */
  --glow-emerald-sm: 0 0 12px rgba(16, 185, 129, 0.15);
  --glow-emerald-md: 0 0 16px rgba(16, 185, 129, 0.25), 0 0 24px rgba(16, 185, 129, 0.12);
}

/* --- Lucide Icons --- */
.lucide {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Icon inside a colored circle (for empty states, feature cards) */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.icon-circle-lg {
  width: 64px;
  height: 64px;
}

.icon-circle-md {
  width: 44px;
  height: 44px;
}

.icon-circle-sm {
  width: 32px;
  height: 32px;
}

/* --- Base --- */
body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Prevent generic a:hover from overriding button text colors */
a.relayra-btn:hover {
  color: inherit;
}

/* --- Hero gradient (static, professional) --- */
.hero-gradient-bg {
  background: linear-gradient(180deg, var(--primary-faint) 0%, white 100%);
  overflow: visible;
  padding-top: 1rem; /* clearance for orbital pulse ring (extends 8px above circle) */
}

/* --- Final CTA section: full-width green, centered content --- */
.landing-cta-section {
  background: var(--primary);
  color: white;
  padding: 4rem 1.5rem;
  text-align: center;
}

.landing-cta-inner {
  max-width: 600px;
  margin: 0 auto;
}

/* Hero buttons: centered, full-width on mobile */
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  width: 100%;
}

/* --- Hero orbital: circular animation that pops --- */
.hero-section {
  position: relative;
  overflow: visible; /* ensure orbital pulse isn't clipped by header */
}

/* --- Hero carousel: sliding vertical headlines --- */
.hero-carousel {
  overflow: hidden;
  min-height: 200px;
  overflow-anchor: none;
}

.hero-carousel-track {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
}

.hero-carousel-slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 0;
  text-align: center;
}

.hero-carousel-headline {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-align: center;
}

.hero-carousel-sub {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  text-align: center;
}

.hero-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.hero-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--slate-300);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.hero-carousel-dot:hover {
  border-color: var(--primary);
  background: var(--primary-faint);
}

.hero-carousel-dot.active {
  background: var(--primary);
  border-color: var(--primary);
}

@media (max-width: 480px) {
  .hero-carousel-headline {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
  }

  .hero-carousel-sub {
    font-size: 1rem;
  }
}

.hero-orbital {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 2rem;
}

.hero-orbital-pulse {
  position: absolute;
  inset: -8px; /* reduced from -12px so top doesn't get cut off by header */
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.25);
  animation: heroOrbitalPulse 2.5s ease-in-out infinite;
}

.hero-orbital-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--primary) 0deg,
    var(--primary-light) 60deg,
    var(--primary) 120deg,
    var(--primary-faint) 180deg,
    var(--primary) 240deg,
    var(--primary-light) 300deg,
    var(--primary) 360deg
  );
  animation: heroOrbitalRotate 6s linear infinite;
  opacity: 0.95;
  box-shadow: var(--glow-emerald-md);
}

.hero-orbital-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: linear-gradient(180deg, var(--primary-faint) 0%, white 100%);
  border-radius: 50%;
}

.hero-orbital-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  z-index: 1;
}

@keyframes heroOrbitalRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes heroOrbitalPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 0.2; }
}

/* --- Layout Utilities --- */
.relayra-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.relayra-container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Form/centering utilities (devise, auth pages) */
.relayra-mx-auto { margin-left: auto; margin-right: auto; }
.relayra-max-w-md { max-width: 28rem; }
.relayra-w-full { width: 100%; }
.relayra-text-center { text-align: center; }

/* Auth form container: centered, narrow, with vertical spacing */
.relayra-container.relayra-max-w-md {
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.relayra-text-secondary { color: var(--text-secondary); }
.relayra-text-primary { color: var(--text-primary); }
.relayra-text-sm { font-size: 0.875rem; }
.relayra-text-lg { font-size: 1.125rem; }
.relayra-font-semibold { font-weight: 600; }
.relayra-mb-xl { margin-bottom: 2rem; }

/* --- Profession pills: compact inline "who it's for" --- */
.profession-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.profession-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary-faint);
  color: var(--primary-dark);
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid rgba(16, 185, 129, 0.2);
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.profession-pill:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.profession-pill .lucide {
  flex-shrink: 0;
  opacity: 0.9;
}

@media (max-width: 480px) {
  .profession-pills {
    gap: 0.4rem 0.75rem;
  }

  .profession-pill {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
  }
}



.hidden {
  display: none !important;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin-top: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 1.875rem; line-height: 1.3; }
h3 { font-size: 1.5rem; line-height: 1.4; }

p { margin-bottom: 1rem; }

/* --- Buttons --- */
.relayra-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  gap: 0.5rem;
}

.relayra-btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.relayra-btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.relayra-btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.relayra-btn-primary:hover {
  background: var(--primary-dark);
  color: white; /* Keep white text - prevents a:hover green override */
  transform: translateY(-1px);
  box-shadow: var(--glow-emerald-md);
}


.relayra-btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.relayra-btn-secondary:hover {
  background: var(--slate-50);
  color: var(--text-primary); /* Keep dark text on hover */
  border-color: var(--slate-200);
}

.relayra-btn-danger {
  background: #dc2626;
  color: white;
  border: 1px solid #dc2626;
}
.relayra-btn-danger:hover {
  background: #b91c1c;
  color: white;
  border-color: #b91c1c;
}

.relayra-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.relayra-btn-ghost:hover {
  background: rgba(0,0,0,0.03);
  color: var(--text-primary);
}

.relayra-btn-outline {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
}

.relayra-btn-outline:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
}

/* --- Inputs --- */
.relayra-input, 
.relayra-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-primary);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box; /* Important for widths */
}

.relayra-input:focus, 
.relayra-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-faint);
}

.relayra-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

/* --- Cards --- */
.relayra-card {
  background: white;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  overflow: hidden;
  position: relative;
}

.relayra-card-hover {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.relayra-card-hover:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

@keyframes success-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.95; }
}
.success-icon-pulse {
  animation: success-pulse 2s ease-in-out infinite;
}

/* --- Stats Grid --- */
.relayra-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.relayra-stat-card {
  background: white;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.relayra-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.relayra-stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Landing header (logged out) --- */
.landing-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-primary);
  position: fixed; /* fixed so content always starts below it */
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.landing-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Add padding to body when landing header is present so content starts below it */
body:has(.landing-header) {
  padding-top: 56px; /* approximate header height */
}

/* --- Navbar --- */
.relayra-nav {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  z-index: 50;
}

.relayra-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.relayra-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.relayra-nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.relayra-nav-link {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.relayra-nav-link:hover,
.relayra-nav-link.active {
  color: var(--primary);
}

/* --- Badges --- */
.relayra-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.relayra-badge-success { background: var(--success-light); color: var(--success); }
.relayra-badge-warning { background: var(--warning-light); color: var(--warning); }
.relayra-badge-info    { background: var(--info-light); color: var(--info); }
.relayra-badge-danger  { background: var(--danger-light); color: var(--danger); }

/* --- Onboarding Wizard (Clearer Structure) --- */
.onboarding-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3rem;
  position: relative;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.onboarding-steps::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--slate-200);
  z-index: 0;
}

.onboarding-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  padding: 0 1rem;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--slate-300);
  color: var(--slate-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
}

/* Orbital ring (matches hiw-circle) */
.step-circle::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--primary) 0deg,
    var(--primary-light) 90deg,
    var(--primary) 180deg,
    var(--primary-faint) 270deg,
    var(--primary) 360deg
  );
  animation: hiwOrbitalRotate 8s linear infinite;
  opacity: 0.4;
  z-index: -1;
}

.step-circle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.2);
  animation: hiwOrbitalRotate 8s linear infinite reverse;
  opacity: 0.6;
  z-index: -1;
}

.step-circle.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-faint);
}

.step-circle.completed {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.step-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.step-label.active {
  color: var(--primary);
}

/* --- Live Data Sweep (subtle "alive" indicator for credits, live call) --- */
.live-data-sweep {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.live-data-sweep::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(16, 185, 129, 0.1),
    transparent
  );
  animation: liveDataSweep 2.5s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes liveDataSweep {
  0% { left: -100%; }
  100% { left: 150%; }
}

/* --- Active Call Card (Special Component) --- */
.active-call-card {
  background: white;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all 0.3s ease;
}

.active-call-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}


.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-emerald 2s infinite;
}

.transcript-area {
  height: 240px;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transcript-bubble {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  max-width: 85%;
  line-height: 1.5;
}

.bubble-ai {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.bubble-user {
  background: var(--primary-faint);
  color: var(--primary-dark);
  border: 1px solid rgba(16, 185, 129, 0.1);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.ai-status-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

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

.wave-bar:nth-child(1) { height: 10px; animation-delay: 0.0s; }
.wave-bar:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 8px;  animation-delay: 0.3s; }

/* --- Animations --- */
@keyframes pulse-emerald {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes waveform {
  0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ==========================================================
 * Subtle Animations & Effects
 * Pure CSS - no libraries needed
 * ========================================================== */

/* --- Fade-in on Page Load --- 
 * Cards gently appear when the page loads.
 * Any element with class "fade-in" will animate in.
 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.5s ease-out both;
}

/* Stagger children: add "stagger-children" to a parent,
 * and each direct child fades in with a slight delay */
.stagger-children > * {
  animation: fadeInUp 0.4s ease-out both;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* --- Card Hover Lift ---
 * Cards float up slightly on hover with a smoother shadow.
 */
.relayra-card,
.relayra-stat-card,
.active-call-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.relayra-card:hover,
.relayra-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--slate-300);
}

/* --- Nav Link Sliding Underline ---
 * A thin emerald line slides in from the left on hover.
 */
.relayra-nav-link {
  position: relative;
}

.relayra-nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: width 0.15s ease;
}

.relayra-nav-link:hover::after,
.relayra-nav-link.active::after {
  width: 100%;
}

/* Footer links: subtle emerald hover */
.relayra-footer-link {
  transition: color 0.2s ease;
}

.relayra-footer-link:hover {
  color: var(--primary);
}

/* --- Button Press Effect ---
 * Buttons compress slightly when clicked for a tactile feel.
 */
.relayra-btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.1s;
}

/* --- Badge Subtle Shimmer ---
 * A faint shine sweeps across badges periodically.
 */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.relayra-badge {
  background-size: 200% 100%;
  transition: all 0.2s ease;
}

.relayra-badge-success {
  background-image: linear-gradient(
    90deg,
    var(--success-light) 0%,
    var(--success-light) 40%,
    rgba(16, 185, 129, 0.12) 50%,
    var(--success-light) 60%,
    var(--success-light) 100%
  );
  animation: shimmer 4s ease-in-out infinite;
}

/* --- Input Focus Glow ---
 * A soft emerald glow pulses once when an input gets focus.
 */
@keyframes focusGlow {
  0% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.15); }
  100% { box-shadow: 0 0 0 3px var(--primary-faint); }
}

.relayra-input:focus,
.relayra-textarea:focus {
  animation: focusGlow 0.6s ease-out;
}

/* --- Stat Value Entrance ---
 * Stat numbers "pop" in slightly for emphasis.
 */
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.relayra-stat-value {
  animation: popIn 0.4s ease-out both;
}

/* --- Smooth Page Transition ---
 * Works with Turbo Drive - page content fades in smoothly.
 */
.turbo-progress-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ==========================================================
 * "How It Works" Timeline Section
 * Horizontal connected steps with animated line + circles
 * ========================================================== */

.how-it-works {
  padding: 5rem 1.5rem 4rem;
}

.how-it-works h2 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 3.5rem;
}

/* The step container: horizontal layout with connecting line */
.hiw-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

/* The connecting line that runs behind the circles */
.hiw-steps::before {
  content: '';
  position: absolute;
  top: 28px; /* vertically centered on the 56px circle */
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--slate-200);
  z-index: 0;
}

/* Animated fill line that draws across on page load */
.hiw-steps::after {
  content: '';
  position: absolute;
  top: 28px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 1;
  transform-origin: left;
  animation: drawLine 1s ease-out 0.2s both;
}

@keyframes drawLine {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Each step */
.hiw-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 0 1.5rem;
}

/* The numbered circle - with orbital ring */
.hiw-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--slate-200);
  color: var(--slate-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1.25rem;
  position: relative;
  transition: all 0.4s ease;
  animation: circleReveal 0.5s ease-out both;
  overflow: visible;
}

/* Orbital ring around each step circle - rotates like hero */
.hiw-circle::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--primary) 0deg,
    var(--primary-light) 90deg,
    var(--primary) 180deg,
    var(--primary-faint) 270deg,
    var(--primary) 360deg
  );
  animation: hiwOrbitalRotate 8s linear infinite;
  opacity: 0.4;
  z-index: -1;
}

/* Spotlight cycles through steps: 1, 2, 3 */
.hiw-step:nth-child(1) .hiw-circle::before { animation-delay: 0s; }
.hiw-step:nth-child(2) .hiw-circle::before { animation-delay: -2.67s; }
.hiw-step:nth-child(3) .hiw-circle::before { animation-delay: -5.33s; }

.hiw-step:nth-child(1) .hiw-circle { animation-delay: 0.3s; }
.hiw-step:nth-child(2) .hiw-circle { animation-delay: 0.6s; }
.hiw-step:nth-child(3) .hiw-circle { animation-delay: 0.9s; }

@keyframes hiwOrbitalRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Each circle animates in sequence */
@keyframes circleReveal {
  0% {
    transform: scale(0.6);
    opacity: 0;
    border-color: var(--slate-200);
    color: var(--slate-500);
    background: white;
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    border-color: var(--primary);
    color: white;
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  }
}

/* Orbital ring visible after circle lands */
.hiw-circle::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.2);
  animation: hiwOrbitalRotate 8s linear infinite reverse;
  opacity: 0.6;
  z-index: -1;
}

.hiw-step:nth-child(1) .hiw-circle::after { animation-delay: 0s; }
.hiw-step:nth-child(2) .hiw-circle::after { animation-delay: -2.67s; }
.hiw-step:nth-child(3) .hiw-circle::after { animation-delay: -5.33s; }

/* Step text content fades in after circles */
.hiw-step-content {
  animation: fadeInUp 0.5s ease-out both;
}

.hiw-step:nth-child(1) .hiw-step-content { animation-delay: 0.5s; }
.hiw-step:nth-child(2) .hiw-step-content { animation-delay: 0.8s; }
.hiw-step:nth-child(3) .hiw-step-content { animation-delay: 1.1s; }

.hiw-step h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.hiw-step p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Mobile: stack vertically with a vertical line */
@media (max-width: 640px) {
  .hiw-steps {
    flex-direction: column;
    gap: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .hiw-steps::before,
  .hiw-steps::after {
    top: 0;
    bottom: 0;
    left: 28px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .hiw-steps::after {
    transform-origin: top;
  }

  .hiw-step {
    display: flex;
    text-align: left;
    gap: 1.25rem;
    padding: 0;
  }

  .hiw-circle {
    flex-shrink: 0;
    margin: 0;
  }

  /* Orbital rings scale with smaller circles */
  .hiw-circle::before {
    inset: -6px;
  }

  .hiw-circle::after {
    inset: -5px;
  }
}

/* ==========================================================
 * Dashboard Layout Components
 * ========================================================== */

.dashboard-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.dashboard-header-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* Stats strip: 4 stats in a row inside a card */
.dashboard-stats-strip {
  background: white;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 0;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

.dashboard-stat-cell {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid var(--slate-100);
}

.dashboard-stat-cell:last-child {
  border-right: none;
}

/* Main content: call card + activity sidebar */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* ==========================================================
 * Analytics Page Components
 * ========================================================== */

/* 2x2 metric cards */
.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.analytics-metric-card {
  background: white;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.analytics-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.analytics-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.analytics-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  animation: popIn 0.4s ease-out both;
}

.analytics-metric-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.125rem;
}

/* Two-column layout for charts */
.analytics-two-col {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
}

/* Progress bars in "Calls by Agent" */
.analytics-bar-track {
  height: 6px;
  background: var(--slate-100);
  border-radius: 3px;
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  animation: barGrow 0.8s ease-out both;
}

@keyframes barGrow {
  from { width: 0 !important; }
}

/* Credit ring */
.analytics-ring-wrapper {
  position: relative;
  display: inline-block;
  width: 120px;
  height: 120px;
}

.analytics-ring {
  width: 100%;
  height: 100%;
}

.analytics-ring-fill {
  animation: ringDraw 1.2s ease-out 0.3s both;
}

@keyframes ringDraw {
  from { stroke-dasharray: 0 314; }
}

.analytics-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Table styling */
.table-header {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.table-cell {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
}

/* Mobile call cards */
.mobile-call-card {
  padding: 1rem;
  border-bottom: 1px solid var(--slate-100);
}

.mobile-call-card:last-child {
  border-bottom: none;
}

/* Show/hide based on screen size */
.desktop-only { display: block; }
.mobile-only { display: none; }

/* ==========================================================
 * Mobile-First Responsive Design
 * "Phone app" mentality - everything works great on small screens
 * ========================================================== */

/* --- Mobile Nav (hamburger menu) --- */
.mobile-nav-toggle {
  display: none; /* Hidden on desktop */
}

.relayra-nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  padding: 0.5rem;
  min-width: 160px;
  z-index: 100;
}

.relayra-nav-dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.relayra-nav-dropdown a:hover {
  background: var(--slate-50);
  color: var(--text-primary);
}

/* ---- Tablet & Below (768px) ---- */
@media (max-width: 768px) {
  /* Nav becomes hamburger */
  .mobile-nav-toggle {
    display: inline-flex;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }

  .relayra-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-primary);
    box-shadow: var(--shadow-hover);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    z-index: 100;
  }

  .relayra-nav-links.mobile-open {
    display: flex;
  }

  .relayra-nav-link {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    width: 100%;
    display: block;
  }

  .relayra-nav-link:hover {
    background: var(--slate-50);
  }

  /* Remove the underline animation on mobile (doesn't work well with block links) */
  .relayra-nav-link::after {
    display: none;
  }

  .relayra-nav-inner {
    position: relative;
    padding: 0.75rem 1rem;
  }

  /* Dropdown wrappers in mobile nav */
  .relayra-nav-dropdown-wrapper {
    width: 100%;
  }

  .relayra-nav-dropdown-wrapper button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius-sm);
  }

  .relayra-nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 1rem;
    background: transparent;
  }

  /* The email/sign-out section */
  .relayra-nav-links > div:last-child {
    border-left: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-primary);
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Container padding */
  .relayra-container,
  .relayra-container-wide {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Typography scales down */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  /* Stats grid: 2 columns on tablet */
  .relayra-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Dashboard: Stack and center */
  .dashboard-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .dashboard-header-actions {
    width: 100%;
    justify-content: center;
  }

  .dashboard-header-actions .relayra-btn {
    flex: 1;
    max-width: 200px;
  }

  .dashboard-main-grid {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .dashboard-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-stat-cell:nth-child(2) {
    border-right: none;
  }

  .dashboard-stat-cell:nth-child(1),
  .dashboard-stat-cell:nth-child(2) {
    border-bottom: 1px solid var(--slate-100);
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  /* Analytics: Stack the 2-col layout */
  .analytics-two-col {
    grid-template-columns: 1fr;
  }

  /* Tables: show mobile cards, hide desktop tables */
  .desktop-only { display: none; }
  .mobile-only { display: block; }

  /* Footer: stack on mobile */
  footer .relayra-container-wide {
    padding: 1.5rem 1rem !important;
  }

  /* Landing: profession grid 2x2 on tablet */
  .how-it-works {
    padding: 3rem 1rem 3rem;
  }

  .landing-header-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Auth forms: symmetric padding on mobile */
  .relayra-container.relayra-max-w-md {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Center-themed: stats strip */
  .dashboard-stats-strip {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---- Small Phone (480px and below) ---- */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  /* Analytics metrics: still 2x2 but tighter */
  .analytics-metrics-grid {
    gap: 0.75rem;
  }

  .analytics-metric-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .analytics-metric-icon {
    width: 36px;
    height: 36px;
  }

  .analytics-metric-value {
    font-size: 1.5rem;
  }

  /* Dashboard stat strip: 1 column on very small */
  .dashboard-stats-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-stat-cell {
    border-right: none;
    border-bottom: 1px solid var(--slate-100);
  }

  .dashboard-stat-cell:last-child {
    border-bottom: none;
  }

  /* Stats: 1 column on tiny */
  .relayra-stats-grid {
    grid-template-columns: 1fr;
  }

  /* Buttons become full width */
  .relayra-btn-lg {
    width: 100%;
  }

  /* Hero buttons: stack full-width on mobile, symmetric edges */
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  /* Final CTA button: full width, symmetric */
  .landing-cta-btn {
    width: 100%;
    box-sizing: border-box;
  }

  .landing-cta-inner {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .landing-cta-section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Card padding tightens */
  .relayra-card {
    padding: 1.25rem;
  }

  /* How it works step text */
  .hiw-step p {
    font-size: 0.8125rem;
  }

  .hiw-circle {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  /* Credit ring: smaller on tiny screens */
  .analytics-ring-wrapper {
    width: 100px;
    height: 100px;
  }

  /* Hero orbital: slightly smaller on mobile */
  .hero-orbital {
    width: 110px;
    height: 110px;
    margin-bottom: 1.5rem;
  }

  .hero-orbital-inner .lucide {
    width: 22px;
    height: 22px;
  }

  .hero-orbital-pulse {
    inset: -6px; /* smaller on mobile to avoid header cutoff */
  }

  /* Landing hero: tighter padding, symmetric sides */
  .hero-section {
    padding-top: 3rem !important;
    padding-bottom: 2.5rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Adjust body padding for smaller header on mobile */
  body:has(.landing-header) {
    padding-top: 52px;
  }

  .hero-section h1 {
    font-size: clamp(1.5rem, 5vw, 2.25rem) !important;
  }

  .hero-section p {
    font-size: 1rem !important;
  }
}

/* ─── Voice Test Mic Indicator ─────────────────────────────── */
.voice-test-mic-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-secondary);
  margin: 0 auto;
  transition: all 0.3s ease;
}
.voice-test-mic-indicator.active {
  background: var(--primary-light);
  color: var(--primary);
}
.voice-test-mic-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all 0.3s ease;
}
.voice-test-mic-indicator.active .voice-test-mic-ring {
  border-color: var(--primary);
  animation: voiceTestPulse 1.5s ease-in-out infinite;
}
@keyframes voiceTestPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.5; }
}

/* Reduce motion for users who prefer it (accessibility) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Cookie Consent: bottom strip, non-blocking ─────────────── */
/* Push content up so CTAs aren't hidden behind banner */
body.cookie-banner-visible { padding-bottom: 5rem; }
.relayra-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--slate-800);
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.relayra-cookie-banner.hidden { display: none !important; }
.relayra-cookie-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 900px;
}
.relayra-cookie-text p { margin: 0; font-size: 0.875rem; }
.relayra-cookie-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.relayra-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.relayra-modal.hidden { display: none !important; }
.relayra-modal-content {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.relayra-modal-header, .relayra-modal-body, .relayra-modal-footer {
  padding: 1rem 1.5rem;
}
.relayra-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-primary); }
.relayra-modal-footer { border-top: 1px solid var(--border-primary); display: flex; gap: 0.5rem; justify-content: flex-end; }
.relayra-cookie-category { margin-bottom: 1rem; }
.relayra-cookie-category-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
