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

/* Design tokens keep the site consistent across pages. */
:root {
  /* Brand Palette */
  --brand-bg: #0f172a;
  --brand-panel: rgba(15, 23, 42, 0.9);
  --brand-card: rgba(30, 41, 59, 0.88);
  --brand-text: #e2e8f0;
  --brand-text-light: #cbd5f5;
  --brand-muted: #94a3b8;
  --brand-accent: #38bdf8;
  --brand-accent-hover: #0ea5e9;
  --brand-success: #22c55e;
  --brand-danger: #f87171;

  /* Borders & FX */
  --brand-border: rgba(148, 163, 184, 0.35);
  --brand-shadow: 0 30px 60px rgba(15, 23, 42, 0.45);
  --panel-blur: 30px;

  /* Spacing Scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 4rem;

  /* Layout Helpers */
  --layout-max-width: 1200px;
  --layout-narrow-width: 760px;
  --section-space-x: var(--space-sm);
  --section-space-y: clamp(2.5rem, 5vw, 4.5rem);
  --section-space-y-compact: clamp(1.5rem, 4vw, 3.25rem);
  --hero-space-top: clamp(3rem, 7vw, 5.5rem);
  --hero-space-bottom: clamp(2rem, 6vw, 4rem);
  --hero-gradient: radial-gradient(circle at top, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0.95));

  /* Border Radius Scale */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --radius-full: 999px;

  /* Typography */
  --font-base: "Inter", system-ui, -apple-system, blinkmacsystemfont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--brand-text);
  background-color: var(--brand-bg);
  font-family: var(--font-base);
  line-height: 1.6;
}

main {
  flex: 1;
}

a {
  color: var(--brand-accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.page-wrap {
  width: 100%;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 0 var(--section-space-x);
}

.section-centered,
.section-centered .page-wrap {
  text-align: center;
}

.section-centered .card,
.section-centered .text-left {
  text-align: left;
}

.page-wrap.narrow,
.narrow {
  max-width: var(--layout-narrow-width);
}

.hero {
  padding: var(--hero-space-top) var(--section-space-x) var(--hero-space-bottom);
  text-align: center;
  background: var(--hero-gradient);
}

.hero-title {
  margin: 0 0 var(--space-sm);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--brand-text);
}

.hero-subtitle {
  margin: 0 auto var(--space-lg);
  max-width: var(--layout-narrow-width);
  color: var(--brand-text-light);
}

.section {
  padding: var(--section-space-y) var(--section-space-x);
}

.section-title {
  margin-bottom: var(--space-sm);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: var(--space-md) auto;
  max-width: 720px;
}

.feature-list li {
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

code {
  font-family: "JetBrains Mono", SFMono-Regular, Consolas, "Liberation Mono", monospace;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.65);
  color: var(--brand-accent);
  font-size: 0.95em;
}

.card {
  background-color: var(--brand-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--brand-border);
  box-shadow: var(--brand-shadow);
  padding: var(--space-lg);
  backdrop-filter: blur(var(--panel-blur));
  transition: transform 0.2s ease;
  text-align: left;
}

@supports not (backdrop-filter: blur(1px)) {
  .card {
    background-color: rgba(30, 41, 59, 0.95);
  }
}

.card:hover {
  transform: translateY(-4px);
}

.card-compact {
  padding: var(--space-md);
  background: rgba(15, 23, 42, 0.75);
}

.card-title {
  margin-top: 0;
  color: var(--brand-accent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.card-emphasis {
  border: 2px solid var(--brand-accent);
}

.price {
  font-size: 1.75rem;
  margin: var(--space-sm) 0;
  color: var(--brand-accent);
}

.lead {
  font-size: 1.15rem;
  color: var(--brand-text-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  appearance: none;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border 0.2s ease,
    transform 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand-accent);
  color: var(--brand-bg);
}

.btn-primary:hover {
  background: var(--brand-accent-hover);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.65);
  color: var(--brand-accent);
  border-color: var(--brand-border);
}

.btn-ghost:hover {
  border-color: var(--brand-accent);
}

.input,
input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--brand-text);
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  background: rgba(15, 23, 42, 0.85);
}

::placeholder {
  color: var(--brand-muted);
  opacity: 0.85;
}

:disabled,
[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.form-grid {
  display: grid;
  gap: var(--space-sm);
}

.grid-span-2 {
  grid-column: span 2;
}

@media (width <= 640px) {
  .grid-span-2 {
    grid-column: span 1;
  }
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

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

.form-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-muted);
}

.field-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.field-row .form-field {
  flex: 1 1 200px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.inline-form input {
  max-width: 320px;
}

.inline-form .btn {
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.15);
  color: var(--brand-accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cta-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-sm);
}

.stats-tile {
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: var(--space-sm);
  text-align: left;
}

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

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  font-size: 0.95rem;
  color: var(--brand-muted);
}

.text-left {
  text-align: left;
}

.mt-sm {
  margin-top: var(--space-sm);
}

.status-message {
  margin-top: var(--space-sm);
  font-weight: 600;
  min-height: 1.25rem;
}

.status-info {
  color: var(--brand-muted);
}

.status-success {
  color: var(--brand-success);
}

.status-error {
  color: var(--brand-danger);
}

.status-warning {
  color: #fbbf24;
}

.security-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--brand-muted);
  font-size: 0.95rem;
}

.security-list li strong {
  color: var(--brand-text);
}

.backlog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.65);
  overflow: hidden;
}

.backlog-item {
  padding: var(--space-sm);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.backlog-item:last-child {
  border-bottom: none;
}

.backlog-title {
  font-weight: 600;
  color: var(--brand-text);
}

.backlog-meta {
  font-size: 0.9rem;
  color: var(--brand-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.backlog-description {
  font-size: 0.95rem;
  color: var(--brand-text-light);
}

.backlog-empty {
  padding: var(--space-lg);
  text-align: center;
  color: var(--brand-muted);
}

footer,
.site-footer {
  margin-top: auto;
  padding: var(--section-space-y-compact) var(--section-space-x);
  text-align: center;
  color: var(--brand-muted);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.9rem;
}

@media (width <= 960px) {
  .page-wrap {
    padding: 0 var(--space-sm);
  }

  .hero {
    padding: calc(var(--hero-space-top) * 0.9) var(--space-sm) calc(var(--hero-space-bottom) * 0.9);
  }

  .card-grid {
    gap: var(--space-md);
  }
}

@media (width <= 768px) {
  .card,
  .card-compact {
    padding: var(--space-md);
  }

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

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

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

@media (width <= 640px) {
  .hero {
    padding: var(--space-lg) var(--space-sm);
  }

  .cta-stack {
    flex-direction: column;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
