/* Building AI — Unique Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --steel-950: #0c1222;
  --steel-900: #131c2e;
  --steel-800: #1a2742;
  --steel-700: #252f45;
  --steel-600: #3d4a5c;
  --steel-400: #7a8799;
  --steel-300: #9ca8b8;
  --steel-200: #c5cdd8;
  --steel-100: #e8ecf1;
  --steel-50: #f4f6f9;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-600: #d97706;
  --copper: #b45309;
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.15);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.35s;
  --duration-slow: 0.5s;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--steel-50);
  color: var(--steel-900);
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
}

.bg-mesh {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 158, 11, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(19, 28, 46, 0.04), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(245, 158, 11, 0.08), transparent),
    var(--steel-50);
}
.bg-mesh-dark {
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(245, 158, 11, 0.08), transparent 60%),
    var(--steel-900);
}

.input-app {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--steel-200);
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
.input-app:hover { border-color: var(--steel-300); }
.input-app:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
  outline: none;
  transform: translateY(-1px);
}

.btn-primary {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  color: white;
  background: linear-gradient(135deg, var(--amber-600) 0%, var(--copper) 100%);
  border: none;
  box-shadow: 0 4px 14px rgba(180, 83, 9, 0.35);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-normal), filter var(--duration-fast);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(180, 83, 9, 0.4); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  background: white;
  border: 2px solid var(--steel-200);
  color: var(--steel-700);
  transition: all var(--duration-fast);
}
.btn-secondary:hover { border-color: var(--steel-300); background: var(--steel-50); }

.otp-input {
  width: clamp(44px, 12vw, 56px);
  height: 56px;
  text-align: center;
  font-size: 1.375rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border: 2px solid var(--steel-200);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out-expo);
}
.otp-input:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  outline: none;
  transform: scale(1.05);
}

.card-app {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(12, 18, 34, 0.04), 0 1px 2px rgba(12, 18, 34, 0.06);
  border: 1px solid rgba(197, 205, 216, 0.5);
  padding: 1.5rem;
  transition: box-shadow var(--duration-normal), transform var(--duration-normal), border-color var(--duration-fast);
}
.card-app:hover {
  box-shadow: 0 12px 40px rgba(12, 18, 34, 0.08), 0 4px 12px rgba(12, 18, 34, 0.04);
  border-color: var(--steel-200);
}
.card-app.glass { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); }

.sidebar-link { transition: all var(--duration-fast); }
.sidebar-link:hover { background: var(--steel-100); }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, transparent 100%);
  color: var(--amber-600);
  border-left: 3px solid var(--amber-500);
}

.step-panel { animation: stepIn 0.45s var(--ease-out-expo) forwards; opacity: 0; transform: translateY(12px); }
@keyframes stepIn { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeUp 0.5s var(--ease-out-expo) forwards; }
.stagger-children > * { opacity: 0; animation: fadeUp 0.4s var(--ease-out-expo) forwards; }
.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; }

.step-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--steel-200);
  overflow: hidden;
  transition: all var(--duration-slow) var(--ease-out-expo);
}
.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-500), var(--amber-600));
  border-radius: 2px;
  transition: width var(--duration-slow) var(--ease-out-expo);
}

.logo-mark {
  background: linear-gradient(135deg, var(--steel-800) 0%, var(--steel-900) 100%);
  box-shadow: 0 8px 24px rgba(12, 18, 34, 0.2);
  position: relative;
  overflow: hidden;
}
.logo-mark::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber-500), transparent);
  opacity: 0.8;
}

.badge-sequential { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.badge-parallel { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-blocking { background: rgba(239, 68, 68, 0.15); color: #dc2626; }

#sidebar { transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
#sidebarOverlay { transition: opacity 0.3s ease; }
#sidebarOverlay:not(.hidden) { backdrop-filter: blur(4px); }
.admin-content > * { animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

#sidebar .sidebar-header,
header.admin-header { min-height: 68px; height: 68px; display: flex; align-items: center; }
#sidebar .sidebar-header { padding: 0 1rem; }
header.admin-header { padding: 0 1rem; box-shadow: 0 1px 0 0 rgba(0,0,0,0.04); }
header.admin-header > div { width: 100%; display: flex; align-items: center; justify-content: space-between; }
@media (min-width: 640px) { header.admin-header { padding: 0 1.5rem; } }

#userDropdownTrigger { border: 1px solid var(--steel-200); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
#userDropdownTrigger:hover { border-color: var(--steel-300); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }

.sidebar-collapsed #sidebar { width: 4.5rem !important; min-width: 4.5rem !important; }
.sidebar-collapsed #sidebar .sidebar-label,
.sidebar-collapsed #sidebar .sidebar-section,
.sidebar-collapsed #sidebar .sidebar-submenu,
.sidebar-collapsed #sidebar .sidebar-chevron,
.sidebar-collapsed #sidebar .logo-text { opacity: 0; width: 0; overflow: hidden; padding: 0; margin: 0; }
.sidebar-collapsed #sidebar .sidebar-submenu { display: none; }
.sidebar-collapsed #sidebar .sidebar-link,
.sidebar-collapsed #sidebar .logo-wrap { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed #sidebar .sidebar-header { padding: 0 0.75rem; }
.sidebar-collapsed #sidebar:hover { width: 18rem !important; min-width: 18rem !important; }
.sidebar-collapsed #sidebar:hover .sidebar-label,
.sidebar-collapsed #sidebar:hover .sidebar-section,
.sidebar-collapsed #sidebar:hover .sidebar-submenu,
.sidebar-collapsed #sidebar:hover .sidebar-chevron,
.sidebar-collapsed #sidebar:hover .logo-text { opacity: 1; width: auto; overflow: visible; }
.sidebar-collapsed #sidebar:hover .sidebar-submenu { display: block; }
.sidebar-collapsed #sidebar:hover .sidebar-link,
.sidebar-collapsed #sidebar:hover .logo-wrap { justify-content: flex-start; padding-left: 0.75rem; padding-right: 0.75rem; }
#sidebar { transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
#sidebar .sidebar-label, #sidebar .sidebar-section, #sidebar .logo-text { transition: opacity 0.2s, width 0.2s; white-space: nowrap; }
.sidebar-group-trigger { font-family: inherit; font-size: inherit; }
#userDropdown { transition: opacity 0.2s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); right: 0; left: auto; }
#userDropdownZone { margin-left: auto; flex-shrink: 0; }
#userDropdown.invisible { pointer-events: none; }
#userDropdown.opacity-0 { opacity: 0; }

/* Modal transitions */
.modal-overlay { transition: opacity 0.2s ease-out; }
.modal-overlay:not(.modal-open) { opacity: 0; pointer-events: none; }
.modal-overlay.modal-open { opacity: 1; pointer-events: auto; }
.modal-dialog { transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease-out; }
.modal-overlay:not(.modal-open) .modal-dialog { transform: scale(0.96); opacity: 0; }
.modal-overlay.modal-open .modal-dialog { transform: scale(1); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 640px) { .card-app { padding: 1.25rem; } }
@media (min-width: 1024px) { .admin-content > * { animation: none; } }
@media (max-width: 1023px) {
  .sidebar-collapsed #sidebar { width: 4.5rem !important; }
  .sidebar-collapsed #sidebar:hover { width: 18rem !important; }
}
