@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --dm-bg: #000000;
  --dm-surface: rgba(12, 12, 12, 0.86);
  --dm-surface-strong: #111111;
  --dm-border: rgba(255, 120, 0, 0.16);
  --dm-text: #f4f4f4;
  --dm-muted: rgba(255, 255, 255, 0.56);
  --dm-accent: #ff6a00;
  --dm-accent-2: #ff9a3d;
  --dm-ember: #ff3d00;
  --dm-shadow: 0 30px 110px rgba(0, 0, 0, 0.5);
}

html {
  font-size: 15px;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 102, 0, 0.12), transparent 26%),
    radial-gradient(circle at 50% 65%, rgba(255, 102, 0, 0.08), transparent 28%),
    linear-gradient(180deg, #050505 0%, #000000 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--dm-text);
  background: transparent;
  font-family: "Inter", "Segoe UI", sans-serif;
}

h1, h2, h3, .navbar-brand {
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: 0.05em;
}

a {
  color: var(--dm-accent);
}

.app-shell {
  min-height: 100vh;
  position: relative;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(255, 106, 0, 0.08), transparent 18%),
    radial-gradient(circle at 80% 20%, rgba(255, 106, 0, 0.07), transparent 16%),
    radial-gradient(circle at 50% 70%, rgba(255, 106, 0, 0.05), transparent 18%);
  opacity: 0.9;
  mix-blend-mode: screen;
}

.app-header, .app-footer {
  position: relative;
  z-index: 1;
}

.app-header {
  padding: 1rem 0 0;
  z-index: 20;
}

.app-nav {
  border: 1px solid var(--dm-border);
  background: rgba(4, 4, 4, 0.76);
  border-radius: 0.9rem;
  box-shadow: var(--dm-shadow);
  padding: 1rem 1.25rem;
  backdrop-filter: blur(22px);
  position: relative;
  overflow: visible;
}

.app-nav::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 106, 0, 0.08) 55%, transparent 100%);
  pointer-events: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dm-text) !important;
  text-decoration: none;
}

.brand-logo {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 0.6rem;
  box-shadow: 0 0 0 1px rgba(255, 106, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.45);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 0.9;
}

.brand-copy small {
  font-family: "Inter", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.34em;
  color: var(--dm-muted);
  text-transform: uppercase;
}

.app-main {
  position: relative;
  z-index: 1;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.hero-panel, .panel, .stat-card {
  border: 1px solid var(--dm-border);
  background: var(--dm-surface);
  box-shadow: var(--dm-shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  border-radius: 1rem;
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 62% 35%, rgba(255, 106, 0, 0.16), transparent 18%),
    radial-gradient(circle at 72% 22%, rgba(255, 106, 0, 0.22), transparent 14%),
    linear-gradient(145deg, rgba(255, 106, 0, 0.04), transparent 42%);
  pointer-events: none;
}

.hero-copy h1 {
  font-size: clamp(3rem, 5.5vw, 5.8rem);
  line-height: 0.88;
  margin: 0.35rem 0 1rem;
  max-width: 10ch;
  text-transform: uppercase;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.45em;
  color: var(--dm-muted);
  font-size: 0.8rem;
}

.lead, .muted-copy, .panel p, .panel li {
  color: var(--dm-muted);
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.hero-mantra {
  margin-top: 1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.74rem;
}

.hero-art {
  display: grid;
  align-content: start;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.hero-logo-frame {
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(255, 106, 0, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.08), 0 24px 70px rgba(0, 0, 0, 0.55);
  background: #000;
}

.hero-logo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: contrast(1.02) saturate(1.02);
}

.hero-quote {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem 0.2rem 0;
}

.hero-quote strong {
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: 0.24em;
  font-size: 1.6rem;
}

.hero-quote span {
  color: var(--dm-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-card {
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
}

.stat-card span, .stat-card small {
  display: block;
  color: var(--dm-muted);
}

.stat-card strong {
  display: block;
  margin: 0.3rem 0;
  font-size: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.dashboard-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  border-radius: 0.9rem;
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.auth-card {
  border: 1px solid var(--dm-border);
  border-radius: 0.9rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
}

.auth-copy p {
  color: var(--dm-muted);
  line-height: 1.75;
}

.dm-input {
  background: #060606;
  border: 1px solid rgba(255, 106, 0, 0.22);
  color: var(--dm-text);
}

.dm-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.dm-input:focus {
  background: #060606;
  color: var(--dm-text);
  border-color: rgba(255, 106, 0, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(255, 106, 0, 0.14);
}

.passkey-list {
  display: grid;
  gap: 0.8rem;
}

.passkey-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.passkey-item span {
  display: block;
  color: var(--dm-muted);
  font-size: 0.85rem;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.mini-card {
  border: 1px solid var(--dm-border);
  border-radius: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.mini-card h3, .panel h2 {
  margin-top: 0;
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}

.clean-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.clean-list li:last-child {
  border-bottom: 0;
}

.module-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.module-hero h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.module-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chat-page {
  display: block;
  margin-top: 1.25rem;
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 1.25rem;
}

.module-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.module-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.module-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.module-row strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.module-row p {
  margin-bottom: 0.45rem;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  color: var(--dm-muted);
  font-size: 0.85rem;
}

.module-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  min-width: 170px;
}

.module-row-actions form {
  margin: 0;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: min(72vh, 44rem);
}

.chat-stream {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(52vh, 32rem);
  overflow-y: auto;
  padding-right: 0.4rem;
}

.chat-composer {
  margin-top: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dm-text);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill--ember {
  border-color: rgba(255, 106, 0, 0.35);
  background: rgba(255, 106, 0, 0.12);
}

.pill--muted {
  background: rgba(255, 255, 255, 0.02);
  color: var(--dm-muted);
}

.stacked-form {
  display: flex;
  flex-direction: column;
}

.dm-input {
  background: rgba(0, 0, 0, 0.34) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--dm-text) !important;
}

.dm-input:focus {
  border-color: rgba(255, 106, 0, 0.45) !important;
  box-shadow: 0 0 0 0.2rem rgba(255, 106, 0, 0.12) !important;
}

.insight-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #f2f6ff;
}

.app-footer {
  padding: 0 0 2rem;
  color: var(--dm-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.dropdown-menu {
  background: #111111;
  border: 1px solid var(--dm-border);
  z-index: 2000;
}

.app-nav .dropdown {
  position: relative;
}

.app-nav .dropdown-menu {
  margin-top: 0.65rem;
}

.dropdown-item {
  color: var(--dm-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(255, 106, 0, 0.12);
  color: #fff;
}

.dropdown-divider {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.dropdown-item form {
  width: 100%;
}

.dropdown-item .btn-link {
  color: inherit;
  text-align: left;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--dm-accent), var(--dm-accent-2));
  border: 0;
  color: #120800;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(255, 106, 0, 0.24);
}

.btn-outline-light {
  border-color: rgba(255,106,0,0.32);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 106, 0, 0.12);
  border-color: rgba(255,106,0,0.56);
  color: #fff;
}

@media (max-width: 991.98px) {
  .hero-panel,
  .dashboard-grid,
  .dashboard-grid--compact,
  .mini-grid,
  .stats-row,
  .auth-panel,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .module-hero {
    align-items: start;
    flex-direction: column;
  }

  .module-row {
    flex-direction: column;
  }

  .module-row-actions {
    align-items: flex-start;
    min-width: 0;
  }

  .chat-panel {
    min-height: auto;
  }

  .chat-stream {
    max-height: 45vh;
  }
}
