/**
 * MilestoneLoom AI Scope & Blueprint Architect
 * Production Design System & App Stylesheet
 * Brand Guide Reference: Obsidian Loom (Dark) / Architectural Blueprint (Light)
 */

/* =========================================================================
   1. DESIGN TOKENS & SYSTEM VARIABLES
   ========================================================================= */

:root {
  /* OBSIDIAN LOOM THEME (DEFAULT / DARK) */
  --loom-bg: #06070b;
  --loom-surface-1: #0d0f17;
  --loom-surface-2: #151824;
  --loom-surface-3: #1e2336;

  --loom-border-subtle: rgba(255, 255, 255, 0.08);
  --loom-border-strong: rgba(255, 255, 255, 0.16);
  --loom-border-accent: rgba(99, 102, 241, 0.38);

  --loom-text-primary: #f8fafc;
  --loom-text-secondary: #94a3b8;
  --loom-text-muted: #64748b;

  --loom-indigo: #6366f1;
  --loom-indigo-glow: rgba(99, 102, 241, 0.28);
  --loom-cyan: #06b6d4;
  --loom-cyan-glow: rgba(6, 182, 212, 0.28);
  --loom-emerald: #10b981;
  --loom-emerald-glow: rgba(16, 185, 129, 0.28);
  --loom-amber: #f59e0b;
  --loom-ruby: #ef4444;

  /* Gradients */
  --loom-gradient-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --loom-gradient-subtle: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.02) 100%);
  --loom-gradient-border: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(6, 182, 212, 0.4) 50%, rgba(16, 185, 129, 0.6) 100%);
  --loom-gradient-surface: linear-gradient(180deg, #10131f 0%, #0b0c13 100%);
  --loom-gradient-card-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);

  /* Shadows */
  --loom-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.6);
  --loom-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.1);
  --loom-shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.9), 0 0 28px rgba(99, 102, 241, 0.16);
  --loom-shadow-glow: 0 0 35px -5px var(--loom-indigo-glow);
  --loom-shadow-milestone: 0 0 30px -5px var(--loom-emerald-glow);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spring Transitions */
  --loom-ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --loom-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --loom-duration-fast: 150ms;
  --loom-duration-base: 250ms;
  --loom-duration-slow: 450ms;

  --header-height: 72px;
}

/* ARCHITECTURAL BLUEPRINT (LIGHT MODE) OVERRIDE */
[data-theme='light'] {
  --loom-bg: #f8fafc;
  --loom-surface-1: #ffffff;
  --loom-surface-2: #f1f5f9;
  --loom-surface-3: #e2e8f0;

  --loom-border-subtle: rgba(15, 23, 42, 0.08);
  --loom-border-strong: rgba(15, 23, 42, 0.16);
  --loom-border-accent: rgba(79, 70, 229, 0.4);

  --loom-text-primary: #0f172a;
  --loom-text-secondary: #334155;
  --loom-text-muted: #64748b;

  --loom-indigo: #4f46e5;
  --loom-indigo-glow: rgba(79, 70, 229, 0.16);
  --loom-cyan: #0891b2;
  --loom-cyan-glow: rgba(8, 145, 178, 0.16);
  --loom-emerald: #059669;
  --loom-emerald-glow: rgba(5, 150, 105, 0.16);
  --loom-amber: #d97706;
  --loom-ruby: #dc2626;

  --loom-gradient-primary: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
  --loom-gradient-subtle: linear-gradient(180deg, rgba(79, 70, 229, 0.05) 0%, rgba(8, 145, 178, 0.02) 100%);
  --loom-gradient-border: linear-gradient(135deg, rgba(79, 70, 229, 0.4) 0%, rgba(8, 145, 178, 0.3) 50%, rgba(5, 150, 105, 0.4) 100%);
  --loom-gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --loom-gradient-card-glow: radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.10) 0%, transparent 70%);

  --loom-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --loom-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 0 1px rgba(15, 23, 42, 0.1);
  --loom-shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.1), 0 0 20px rgba(79, 70, 229, 0.08);
  --loom-shadow-glow: 0 0 25px -4px var(--loom-indigo-glow);
  --loom-shadow-milestone: 0 0 25px -4px var(--loom-emerald-glow);
}

/* =========================================================================
   2. RESET & BASE ELEMENTS
   ========================================================================= */

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

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--loom-text-primary);
  background-color: var(--loom-bg);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.loom-app-body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--loom-bg);
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.04), transparent 800px);
  background-size: 32px 32px, 100% 100%;
  transition: background-color var(--loom-duration-base) ease, color var(--loom-duration-base) ease;
}

[data-theme='light'] body.loom-app-body {
  background-image: 
    radial-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79, 70, 229, 0.03), transparent 800px);
}

/* Ambient glow orb behind app hero */
body.loom-app-body::before {
  content: '';
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
[data-theme='light'] body.loom-app-body::before {
  background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.1) 0%, rgba(8, 145, 178, 0.05) 50%, transparent 70%);
}

/* Hidden elements helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* =========================================================================
   3. BACKGROUND NEURAL CANVAS
   ========================================================================= */

.neural-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* =========================================================================
   4. STICKY HEADER NAVIGATION
   ========================================================================= */

.loom-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(6, 7, 11, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--loom-border-subtle);
  transition: background var(--loom-duration-base) ease, border-color var(--loom-duration-base) ease;
}

[data-theme='light'] .loom-header {
  background: rgba(248, 250, 252, 0.86);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--loom-text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--loom-border-subtle);
  background: var(--loom-surface-1);
  transition: all var(--loom-duration-fast) ease;
}

.nav-back-link:hover {
  color: var(--loom-text-primary);
  border-color: var(--loom-border-strong);
  background: var(--loom-surface-2);
  transform: translateX(-2px);
}

.back-icon {
  width: 14px;
  height: 14px;
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: var(--loom-border-strong);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-isotype {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  transition: transform var(--loom-duration-base) var(--loom-ease-spring);
}

.brand-logo:hover .brand-isotype {
  transform: rotate(10deg) scale(1.05);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.brand-milestone {
  color: var(--loom-text-primary);
}

.brand-loom {
  font-weight: 800;
  background: var(--loom-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--loom-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Header Controls & Actions */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Dropdown Menu (Presets) */
.dropdown-wrap {
  position: relative;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--loom-border-subtle);
  background: var(--loom-surface-1);
  color: var(--loom-text-secondary);
  font-family: var(--font-display);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--loom-duration-fast) ease;
}

.ctrl-btn:hover {
  color: var(--loom-text-primary);
  background: var(--loom-surface-2);
  border-color: var(--loom-border-strong);
}

.ctrl-icon {
  width: 15px;
  height: 15px;
}

.caret-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--loom-duration-fast) ease;
}

.dropdown-wrap.open .caret-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--loom-surface-2);
  border: 1px solid var(--loom-border-strong);
  border-radius: 12px;
  box-shadow: var(--loom-shadow-lg);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 120;
  backdrop-filter: blur(16px);
}

.dropdown-wrap.open .dropdown-menu {
  display: flex;
  animation: fadeInDown var(--loom-duration-fast) var(--loom-ease-spring);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--loom-text-primary);
  cursor: pointer;
  transition: background var(--loom-duration-fast) ease;
}

.dropdown-item:hover {
  background: var(--loom-surface-3);
}

.preset-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--loom-text-primary);
}

.preset-desc {
  font-size: 0.725rem;
  color: var(--loom-text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--loom-border-subtle);
  margin: 0.25rem 0;
}

.dropdown-item.reset-item .preset-name {
  color: var(--loom-text-secondary);
}

/* Language Switcher Pill */
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: var(--loom-surface-1);
  border: 1px solid var(--loom-border-subtle);
  border-radius: 8px;
  padding: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--loom-text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--loom-duration-fast) ease;
}

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

.lang-btn.active {
  background: var(--loom-indigo);
  color: #ffffff;
  box-shadow: 0 0 12px var(--loom-indigo-glow);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.theme-icon {
  width: 17px;
  height: 17px;
}

[data-theme='dark'] .sun-icon {
  display: block;
}

[data-theme='dark'] .moon-icon {
  display: none;
}

[data-theme='light'] .sun-icon {
  display: none;
}

[data-theme='light'] .moon-icon {
  display: block;
}

/* Global Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--loom-duration-base) var(--loom-ease-spring);
  white-space: nowrap;
}

.btn-sm {
  height: 38px;
  padding: 0 1rem;
  font-size: 0.825rem;
}

.btn-large {
  height: 48px;
  padding: 0 1.5rem;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--loom-indigo);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--loom-indigo-glow);
}

.btn-primary:hover {
  background: #5558e6;
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transform: rotate(25deg);
  animation: shine 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { transform: translateX(-150%) rotate(25deg); }
  35%, 100% { transform: translateX(150%) rotate(25deg); }
}

.btn-secondary {
  background: var(--loom-surface-1);
  color: var(--loom-text-primary);
  border-color: var(--loom-border-strong);
}

.btn-secondary:hover {
  background: var(--loom-surface-2);
  border-color: var(--loom-border-accent);
  transform: translateY(-1px);
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* =========================================================================
   5. HERO & BANNER SECTION
   ========================================================================= */

.app-main {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.hero-banner {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 3rem;
}

.hero-badge-wrap {
  display: inline-flex;
  margin-bottom: 1.25rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--loom-indigo);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.chip-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--loom-indigo);
  box-shadow: 0 0 10px var(--loom-indigo);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--loom-text-primary);
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--loom-text-secondary);
  max-width: 760px;
  margin: 0 auto 1.75rem;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--loom-surface-1);
  border: 1px solid var(--loom-border-subtle);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--loom-text-secondary);
}

.pill-check {
  width: 14px;
  height: 14px;
  color: var(--loom-emerald);
}

/* =========================================================================
   6. MASTER CONFIGURATOR GRID (LEFT BUILDER / RIGHT PREVIEW)
   ========================================================================= */

.configurator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .configurator-layout {
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 1.5rem;
  }
}

@media (max-width: 1024px) {
  .configurator-layout {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   7. LEFT COLUMN: STEPPER BUILDER
   ========================================================================= */

.builder-column {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Stepper Progress Bar */
.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--loom-surface-1);
  border: 1px solid var(--loom-border-subtle);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  position: sticky;
  top: calc(var(--header-height) + 12px);
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.step-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--loom-text-muted);
  transition: all var(--loom-duration-fast) ease;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--loom-surface-2);
  color: var(--loom-text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--loom-border-subtle);
}

.step-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
}

.step-indicator:hover {
  color: var(--loom-text-primary);
}

.step-indicator.active {
  color: var(--loom-text-primary);
}

.step-indicator.active .step-num {
  background: var(--loom-indigo);
  color: #ffffff;
  border-color: var(--loom-indigo);
  box-shadow: 0 0 10px var(--loom-indigo-glow);
}

.step-line {
  flex: 1;
  height: 1px;
  background: var(--loom-border-subtle);
  margin: 0 1rem;
}

/* Step Container Card */
.step-card {
  position: relative;
  background: var(--loom-surface-1);
  border: 1px solid var(--loom-border-subtle);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--loom-shadow-sm);
  transition: border-color var(--loom-duration-base) ease;
  scroll-margin-top: calc(var(--header-height) + 80px);
}

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

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.step-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--loom-indigo);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.step-requirement {
  font-size: 0.75rem;
  color: var(--loom-text-muted);
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--loom-text-primary);
  margin-bottom: 0.4rem;
}

.step-description {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--loom-text-secondary);
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

/* Option Card (Spotlight Card) */
.option-card {
  position: relative;
  background: var(--loom-surface-glass, rgba(20, 23, 36, 0.7));
  border: 1px solid var(--loom-border-strong);
  border-radius: 16px;
  padding: 1.35rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform var(--loom-duration-fast) var(--loom-ease-spring),
              border-color var(--loom-duration-fast) ease,
              background var(--loom-duration-fast) ease,
              box-shadow var(--loom-duration-fast) ease;
  overflow: hidden;
  user-select: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--loom-shadow-sm);
}

.option-card:hover {
  transform: translateY(-3px);
  border-color: var(--loom-border-accent);
  background: var(--loom-surface-3);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.option-card.selected {
  border-color: var(--loom-indigo);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.card-glow {
  position: absolute;
  inset: 0;
  background: var(--loom-gradient-card-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--loom-duration-base) ease;
}

.option-card.selected .card-glow {
  opacity: 1;
}

.option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.option-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.option-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-icon-box svg {
  width: 20px;
  height: 20px;
}

.option-icon-box.indigo {
  background: rgba(99, 102, 241, 0.15);
  color: var(--loom-indigo);
}

.option-icon-box.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--loom-cyan);
}

.option-icon-box.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--loom-emerald);
}

.option-icon-box.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--loom-amber);
}

.option-price-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--loom-text-primary);
  background: var(--loom-surface-1);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--loom-border-subtle);
}

.option-price-tag .tag-label {
  font-size: 0.65rem;
  color: var(--loom-text-muted);
  text-transform: uppercase;
}

.option-price-tag .tag-label.highlight {
  color: var(--loom-indigo);
  font-weight: 800;
}

.option-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--loom-text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.015em;
}

.option-desc {
  font-size: 0.825rem;
  line-height: 1.45;
  color: var(--loom-text-secondary);
  margin-bottom: 0.85rem;
  flex-grow: 1;
}

.option-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--loom-surface-1);
  color: var(--loom-text-muted);
  border: 1px solid var(--loom-border-subtle);
}

.chip.highlight {
  color: var(--loom-indigo);
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.1);
}

/* Radio & Checkbox Indicators */
.radio-indicator {
  position: static;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--loom-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--loom-duration-fast) ease;
  flex-shrink: 0;
}

.radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  transform: scale(0);
  transition: transform var(--loom-duration-fast) var(--loom-ease-spring);
}

.option-card.selected .radio-indicator {
  border-color: var(--loom-indigo);
  background: var(--loom-indigo);
  box-shadow: 0 0 10px var(--loom-indigo-glow);
}

.option-card.selected .radio-dot {
  transform: scale(1);
}

.checkbox-indicator {
  position: static;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--loom-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--loom-surface-1);
  transition: all var(--loom-duration-fast) ease;
  flex-shrink: 0;
}

.check-icon {
  width: 12px;
  height: 12px;
  color: #ffffff;
  transform: scale(0);
  transition: transform var(--loom-duration-fast) var(--loom-ease-spring);
}

.option-card.selected .checkbox-indicator {
  border-color: var(--loom-indigo);
  background: var(--loom-indigo);
  box-shadow: 0 0 10px var(--loom-indigo-glow);
}

.option-card.selected .check-icon {
  transform: scale(1);
}

/* Spotlight Effect on Cards */
.loom-spotlight-card {
  position: relative;
  overflow: hidden;
}

.loom-spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    650px circle at var(--mouse-x, -1000px) var(--mouse-y, -1000px),
    rgba(99, 102, 241, 0.10),
    transparent 45%
  );
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loom-spotlight-card:hover::before {
  opacity: 1;
}

.loom-spotlight-card > * {
  position: relative;
  z-index: 2;
}

/* Border Beam Effect on Active Cards */
.loom-border-beam {
  position: relative;
  overflow: hidden;
}

.loom-border-beam::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent 0deg,
    transparent 280deg,
    var(--loom-indigo) 320deg,
    var(--loom-cyan) 345deg,
    var(--loom-emerald) 360deg
  );
  animation: loom-spin-beam 5s linear infinite;
  z-index: 0;
  pointer-events: none;
}

.loom-border-beam::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--loom-surface-2);
  border-radius: 13px;
  z-index: 1;
}

.loom-border-beam > * {
  position: relative;
  z-index: 2;
}

@keyframes loom-spin-beam {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =========================================================================
   8. RIGHT COLUMN: REAL-TIME SCOPE & BLUEPRINT STUDIO
   ========================================================================= */

.preview-column {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  z-index: 40;
}

.preview-card {
  background: var(--loom-surface-glass, rgba(13, 15, 23, 0.78));
  border: 1px solid var(--loom-border-strong);
  border-radius: 22px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(99, 102, 241, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  max-height: calc(100vh - var(--header-height) - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.65rem;
  scrollbar-width: thin;
  scrollbar-color: var(--loom-border-strong) transparent;
}

.preview-card::-webkit-scrollbar {
  width: 5px;
}

.preview-card::-webkit-scrollbar-track {
  background: transparent;
}

.preview-card::-webkit-scrollbar-thumb {
  background: var(--loom-border-strong);
  border-radius: 9999px;
}

/* Summary Top Card */
.summary-top-card {
  background: var(--loom-surface-2);
  border: 1px solid var(--loom-border-accent);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.summary-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.live-ping {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--loom-emerald);
  box-shadow: 0 0 10px var(--loom-emerald);
  animation: pulse 1.8s infinite;
}

.live-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--loom-emerald);
}

.badge-fixed {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--loom-indigo);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.summary-numbers-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sum-metric-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sum-label {
  font-size: 0.725rem;
  color: var(--loom-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.sum-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.currency-symbol {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--loom-indigo);
}

.sum-price-number {
  font-family: var(--font-mono);
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--loom-text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.currency-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--loom-text-muted);
  margin-left: 0.25rem;
}

.sum-subtext {
  font-size: 0.7rem;
  color: var(--loom-text-secondary);
}

.sum-metric-divider {
  width: 1px;
  height: 48px;
  background: var(--loom-border-strong);
}

.sum-time-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--loom-cyan);
  line-height: 1;
}

.active-spec-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--loom-border-subtle);
}

.spec-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--loom-surface-1);
  color: var(--loom-text-secondary);
  border: 1px solid var(--loom-border-subtle);
}

/* =========================================================================
   9. INTERACTIVE ARCHITECTURE TOPOLOGY MAP
   ========================================================================= */

.blueprint-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blueprint-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  width: 17px;
  height: 17px;
  color: var(--loom-indigo);
}

.section-icon.emerald {
  color: var(--loom-emerald);
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--loom-text-primary);
}

.active-node-counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--loom-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.arch-canvas-wrap {
  background: var(--loom-surface-2);
  border: 1px solid var(--loom-border-subtle);
  border-radius: 14px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.arch-layer-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  margin-bottom: 0.5rem;
}

.arch-layer-tag {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--loom-text-muted);
  letter-spacing: 0.05em;
}

.arch-diagram {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.arch-tier {
  display: grid;
  gap: 0.5rem;
}

.tier-client {
  grid-template-columns: 1fr 1fr;
}

.tier-gateway {
  grid-template-columns: repeat(3, 1fr);
}

.tier-ai {
  grid-template-columns: repeat(3, 1fr);
}

.tier-data {
  grid-template-columns: repeat(3, 1fr);
}

/* Architecture Node Card */
.arch-node {
  background: var(--loom-surface-1);
  border: 1px solid var(--loom-border-subtle);
  border-radius: 9px;
  padding: 0.5rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.35;
  transition: all var(--loom-duration-base) var(--loom-ease-spring);
  position: relative;
}

.arch-node.active {
  opacity: 1;
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 14px -3px var(--loom-indigo-glow);
}

.arch-node.active-cyan {
  opacity: 1;
  border-color: rgba(6, 182, 212, 0.5);
  background: rgba(6, 182, 212, 0.06);
  box-shadow: 0 0 14px -3px var(--loom-cyan-glow);
}

.node-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--loom-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--loom-text-muted);
}

.arch-node.active .node-icon {
  background: rgba(99, 102, 241, 0.2);
  color: var(--loom-indigo);
}

.arch-node.active-cyan .node-icon {
  background: rgba(6, 182, 212, 0.2);
  color: var(--loom-cyan);
}

.node-icon svg {
  width: 14px;
  height: 14px;
}

.node-content {
  flex-grow: 1;
  overflow: hidden;
}

.node-title {
  font-family: var(--font-display);
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--loom-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-detail {
  font-size: 0.625rem;
  color: var(--loom-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-status {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--loom-surface-2);
  color: var(--loom-text-muted);
}

.arch-node.active .node-status {
  background: rgba(16, 185, 129, 0.15);
  color: var(--loom-emerald);
}

/* Connecting Lines */
.arch-lines {
  width: 100%;
  height: 16px;
  color: var(--loom-border-strong);
  opacity: 0.5;
}

.flow-line {
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
  animation: flowLine 2s linear infinite;
}

@keyframes flowLine {
  from { stroke-dashoffset: 16; }
  to { stroke-dashoffset: 0; }
}

/* =========================================================================
   10. 3-MILESTONE MATHEMATICAL STACK
   ========================================================================= */

.milestones-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.milestone-rule-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--loom-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.milestones-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.milestone-card {
  background: var(--loom-surface-2);
  border: 1px solid var(--loom-border-subtle);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  transition: all var(--loom-duration-base) var(--loom-ease-spring);
}

.milestone-card:hover {
  border-color: var(--loom-border-strong);
  background: var(--loom-surface-3);
}

.milestone-card.active {
  border-color: var(--loom-border-accent);
}

.m-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.m-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.m-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--loom-indigo);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.m-percent {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--loom-text-secondary);
}

.m-stage-badge.highlight .m-code {
  color: var(--loom-emerald);
  background: rgba(16, 185, 129, 0.12);
}

.m-stage-badge.highlight .m-percent {
  color: var(--loom-emerald);
}

.m-price-tag {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--loom-text-primary);
}

.m-price-tag.highlight {
  color: var(--loom-emerald);
}

.m-currency {
  font-size: 0.8rem;
  color: var(--loom-text-muted);
}

.m-val {
  font-variant-numeric: tabular-nums;
}

.m-unit {
  font-size: 0.65rem;
  color: var(--loom-text-muted);
}

.m-title {
  font-family: var(--font-display);
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--loom-text-primary);
  margin-bottom: 0.25rem;
}

.m-desc {
  font-size: 0.775rem;
  line-height: 1.45;
  color: var(--loom-text-secondary);
  margin-bottom: 0.65rem;
}

.m-deliverables-wrap {
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--loom-surface-1);
  border: 1px solid var(--loom-border-subtle);
}

.del-heading {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--loom-text-muted);
  margin-bottom: 0.35rem;
}

.m-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.m-list li {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--loom-text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.m-list li::before {
  content: '✦';
  font-size: 0.6rem;
  color: var(--loom-cyan);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.m-acceptance {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.acc-tag {
  font-weight: 700;
  color: var(--loom-emerald);
  flex-shrink: 0;
}

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

/* =========================================================================
   11. PREVIEW ACTION SUITE (EXPORT & KICKOFF)
   ========================================================================= */

.preview-actions-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--loom-border-subtle);
}

.export-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.action-btn {
  font-size: 0.8rem;
  padding: 0.6rem 0.75rem;
}

.action-btn-kickoff {
  width: 100%;
}

.btn-sparkle {
  color: var(--loom-cyan);
  font-size: 0.9rem;
}

.btn-arrow {
  width: 16px;
  height: 16px;
  transition: transform var(--loom-duration-fast) ease;
}

.action-btn-kickoff:hover .btn-arrow {
  transform: translateX(3px);
}

/* =========================================================================
   12. INTERACTIVE MODAL & FORMS
   ========================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 11, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--loom-duration-base) ease;
}

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

.modal-container {
  background: var(--loom-surface-1);
  border: 1px solid var(--loom-border-strong);
  border-radius: 24px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--loom-shadow-lg);
  padding: 2.25rem;
  transform: scale(0.96) translateY(12px);
  transition: transform var(--loom-duration-base) var(--loom-ease-spring);
}

.modal-backdrop.open .modal-container {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--loom-border-subtle);
  background: var(--loom-surface-2);
  color: var(--loom-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--loom-duration-fast) ease;
}

.modal-close-btn:hover {
  color: var(--loom-text-primary);
  background: var(--loom-surface-3);
  border-color: var(--loom-border-strong);
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
}

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

.modal-badge-row {
  margin-bottom: 0.6rem;
}

.modal-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--loom-indigo);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
}

.modal-chip.success-chip {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--loom-emerald);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--loom-text-primary);
  margin-bottom: 0.35rem;
}

.modal-sub {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--loom-text-secondary);
}

/* Modal Summary Box */
.modal-summary-box {
  background: var(--loom-surface-2);
  border: 1px solid var(--loom-border-accent);
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
}

.m-sum-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.m-sum-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.m-sum-label {
  font-size: 0.68rem;
  color: var(--loom-text-muted);
  text-transform: uppercase;
}

.m-sum-value {
  font-family: var(--font-display);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--loom-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-sum-value.highlight {
  color: var(--loom-emerald);
  font-family: var(--font-mono);
}

/* Form Controls */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--loom-text-secondary);
}

.form-label .req {
  color: var(--loom-ruby);
}

.form-label .opt-label {
  font-size: 0.72rem;
  color: var(--loom-text-muted);
  font-weight: 400;
  margin-left: 0.25rem;
}

.form-input {
  height: 42px;
  border-radius: 9px;
  background: var(--loom-surface-2);
  border: 1px solid var(--loom-border-strong);
  color: var(--loom-text-primary);
  padding: 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: all var(--loom-duration-fast) ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--loom-indigo);
  box-shadow: 0 0 0 3px var(--loom-indigo-glow);
  background: var(--loom-surface-1);
}

.form-input.error {
  border-color: var(--loom-ruby);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-textarea {
  height: auto;
  padding: 0.75rem 0.85rem;
  resize: vertical;
}

.form-select {
  cursor: pointer;
}

.form-error {
  font-size: 0.725rem;
  color: var(--loom-ruby);
  display: none;
}

.form-input.error + .form-error {
  display: block;
}

/* Checkbox Row */
.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
}

.form-checkbox-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--loom-border-strong);
  background: var(--loom-surface-2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  transition: all var(--loom-duration-fast) ease;
}

.form-checkbox-label input:checked + .checkbox-custom {
  background: var(--loom-indigo);
  border-color: var(--loom-indigo);
  box-shadow: 0 0 10px var(--loom-indigo-glow);
}

.form-checkbox-label input:checked + .checkbox-custom::after {
  content: '✓';
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.checkbox-text {
  font-size: 0.775rem;
  line-height: 1.4;
  color: var(--loom-text-muted);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--loom-border-subtle);
}

.modal-footer.centered {
  justify-content: center;
}

.submit-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.modal-form.submitting .submit-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal View 2: Success Confirmation */
.success-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.success-svg {
  width: 72px;
  height: 72px;
}

.success-badge-row {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.modal-view#modal-success-view {
  text-align: center;
}

.success-details-card {
  background: var(--loom-surface-2);
  border: 1px solid var(--loom-border-strong);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.succ-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.succ-label {
  font-size: 0.775rem;
  color: var(--loom-text-muted);
}

.succ-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--loom-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.succ-val {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--loom-text-primary);
}

.succ-val.highlight {
  color: var(--loom-emerald);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* =========================================================================
   13. TOAST NOTIFICATIONS
   ========================================================================= */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--loom-surface-1);
  border: 1px solid var(--loom-border-strong);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: var(--loom-shadow-lg);
  color: var(--loom-text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  animation: slideToast 0.3s var(--loom-ease-spring) forwards;
}

.toast-icon {
  width: 18px;
  height: 18px;
  color: var(--loom-emerald);
  flex-shrink: 0;
}

@keyframes slideToast {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.25s ease;
}

/* =========================================================================
   14. RESPONSIVE BREAKPOINTS & ACCESSIBILITY
   ========================================================================= */

@media (max-width: 768px) {
  .loom-header {
    height: auto;
    padding: 0.75rem 0;
  }

  .header-container {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .header-brand-wrap {
    gap: 0.75rem;
  }

  .brand-text .brand-badge {
    display: none;
  }

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

  .stepper-nav {
    overflow-x: auto;
    padding: 0.5rem 0.75rem;
  }

  .step-label {
    display: none;
  }

  .step-card {
    padding: 1.25rem;
  }

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

  .form-group.full-width {
    grid-column: span 1;
  }

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

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .neural-canvas {
    display: none;
  }
}
