@import url("variables.css");

:root {
  color-scheme: dark;

  /* Typography */
  --app-font-family: 'Inter', 'Inter var', 'system-ui', sans-serif;
  --app-text-primary: #f8fafc;
  --app-text-secondary: rgba(226, 232, 240, 0.85);
  --app-text-muted: rgba(148, 163, 184, 0.7);
  --app-text-inverse: #05060f;

  /* Accent palette */
  --app-accent: #24D0FF;
  --app-accent-strong: #4F46EF;
  --app-accent-soft: rgba(36, 208, 255, 0.12);
  --app-accent-strong-soft: rgba(79, 70, 239, 0.12);
  --app-accent-soft-stronger: rgba(36, 208, 255, 0.55);
  --app-accent-trail: linear-gradient(
    90deg,
    rgba(36, 208, 255, 0),
    rgba(36, 208, 255, 0.65),
    rgba(79, 70, 239, 0)
  );
  --app-accent-glow: rgba(36, 208, 255, 0.35);
  --app-accent-strong-glow: rgba(79, 70, 239, 0.35);
  --app-accent-solid: rgba(36, 208, 255, 0.95);
  --app-accent-strong-solid: rgba(79, 70, 239, 0.95);
  --app-danger: #ef4444;
  --app-danger-strong: #f87171;
  --app-danger-soft: rgba(239, 68, 68, 0.18);
  --app-danger-glow: rgba(239, 68, 68, 0.35);

  /* Background + overlays */
  --app-background-solid: #05060f;
  --app-body-gradient: linear-gradient(180deg, #1a1a1a, #000000);
  --app-body-pattern: radial-gradient(
    circle at top left,
    rgba(255, 255, 255, 0.05) 0.0625rem,
    transparent 0.0625rem
  );
  --app-body-pattern-size: 0.25rem 0.25rem;
  --app-aurora-gradient: linear-gradient(0deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.02));
  --app-aurora-animation-duration: 40s;

  /* Surfaces */
  --app-surface-glass-gradient: linear-gradient(145deg, rgba(40, 40, 46, 0.92), rgba(16, 16, 20, 0.98));
  --app-surface-panel: rgba(34, 34, 40, 0.88);
  --app-surface-panel-strong: rgba(24, 24, 30, 0.95);
  --app-surface-border: rgba(148, 163, 184, 0.35);
  --app-surface-border-soft: rgba(148, 163, 184, 0.22);
  --app-surface-divider: linear-gradient(90deg, rgba(36, 208, 255, 0), rgba(36, 208, 255, 0.55), rgba(79, 70, 239, 0));
  --app-surface-shadow: 0 1.75rem 3.5rem -1.5rem rgba(0, 0, 0, 0.78);
  --app-cookie-shadow: 0 24px 65px -25px rgba(10, 12, 20, 0.9);

  /* Neutral control surfaces */
  --app-control-surface: linear-gradient(145deg, #2a2a2a, #222222);
  --app-control-surface-strong: linear-gradient(145deg, #202020, #181818);
  --app-control-border: #3a3a3a;
  --app-control-border-strong: #555555;

  /* Hero overlays */
  --app-hero-top-overlay: linear-gradient(180deg, rgba(5, 6, 15, 0.85), rgba(5, 6, 15, 0));
  --app-hero-top-glow: rgba(13, 27, 42, 0.75);
  --app-hero-right-glow: var(--app-accent-soft);
  --app-hero-left-glow: var(--app-accent-strong-soft);
  --app-backdrop-strong: rgba(5, 6, 15, 0.9);
  --app-backdrop-stronger: rgba(5, 6, 15, 0.95);
  --app-backdrop-footer: rgba(4, 5, 12, 0.95);

  /* Interaction */
  --app-focus-ring: var(--app-accent);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  overflow-x: hidden;
}

html {
  font-size: clamp(0.625rem, 0.4vw + 0.375rem, 0.875rem);
}

body {
  margin: 0;
  background-color: var(--app-background-solid);
  background-image: var(--app-body-gradient), var(--app-body-pattern);
  background-size: cover, var(--app-body-pattern-size);
  background-repeat: no-repeat, repeat;
  color: var(--app-text-primary);
  font-family: var(--app-font-family);
  line-height: 1.6;
  overflow-y: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--app-aurora-gradient);
  background-size: 100% 200%;
  animation: app-aurora var(--app-aurora-animation-duration) ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes app-aurora {
  from { background-position: 0% 0%; }
  to   { background-position: 0% 100%; }
}

:focus-visible {
  outline: 0.125rem solid var(--app-focus-ring);
  outline-offset: 0.125rem;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--app-text-primary);
}

.app-surface-glass {
  background: var(--app-surface-glass-gradient);
  border: 1px solid var(--app-surface-border);
  box-shadow: var(--app-surface-shadow);
  color: var(--app-text-secondary);
  -webkit-backdrop-filter: blur(1.5rem);
  backdrop-filter: blur(1.5rem);
}

  /*
    Generic elevated panel used across the app (account settings, plans, etc.)
    Give it the same glassy dark treatment as the chat modals so everything
    shares the neutral grey/black base.
  */
.app-panel {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
  border: 0.0625rem solid var(--app-surface-border);
  box-shadow: none;
  color: var(--app-text-primary);
  overflow: hidden;
  -webkit-backdrop-filter: blur(1.5rem);
          backdrop-filter: blur(1.5rem);
}

.app-panel::before {
  content: "";
  position: absolute;
  inset: -45% -25% 60% -25%;
  background: radial-gradient(circle at top right, rgba(120, 120, 128, 0.14), transparent 65%);
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

.app-panel > * {
  position: relative;
  z-index: 1;
}

.app-divider {
  background: var(--app-surface-divider);
}

.app-logo-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-width: 3.6rem;
  min-height: 3.6rem;
  border-radius: 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.app-logo-letter {
  font-family: 'Modak', 'Inter', sans-serif;
  font-size: 2.7rem;
  line-height: 1;
  color: #020508;
  background: linear-gradient(150deg, #020508 0%, #050b16 45%, #0c1930 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-stroke: 0.14rem rgba(148, 163, 184, 0.9);
  text-shadow: none;
}
