:root {
  --canopy-950: #060B08;
  --canopy-900: #0E1712;
  --canopy-800: #16221B;
  --canopy-700: #213024;
  --canopy-600: #2E4233;
  --mist: #8FA294;
  --parchment: #ECE7D8;
  --amber: #E8B23D;
  --amber-dim: #B9862A;
  --jade: #2BB3A3;
  --coral: #E0594B;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canopy-900);
  color: var(--parchment);
  font-family: var(--font-body);
  line-height: 1.5;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--jade); }

/* Ambient backdrop: faint topographic lines + a soft amber glow, fixed behind everything */
.topo-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--canopy-900);
  background-repeat: no-repeat, repeat;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(232,178,61,0.10), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cpath d='M0 80 Q100 30 200 80 T400 80' stroke='%232BB3A3' fill='none' stroke-width='1' opacity='0.18'/%3E%3Cpath d='M0 180 Q100 130 200 180 T400 180' stroke='%232BB3A3' fill='none' stroke-width='1' opacity='0.18'/%3E%3Cpath d='M0 280 Q100 230 200 280 T400 280' stroke='%232BB3A3' fill='none' stroke-width='1' opacity='0.18'/%3E%3Cpath d='M0 380 Q100 330 200 380 T400 380' stroke='%232BB3A3' fill='none' stroke-width='1' opacity='0.18'/%3E%3C/svg%3E");
}

/* Header */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.75rem;
  border-bottom: 1px solid var(--canopy-700);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--parchment);
  letter-spacing: 0.01em;
}
.brand:hover { color: var(--parchment); }

.brand-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(232,178,61,0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232,178,61,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(232,178,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,178,61,0); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-pulse { animation: none; }
}

.link-button {
  background: none;
  border: none;
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
}
.link-button:hover { color: var(--coral); }

.logout-form { margin: 0; }

/* Flash messages */
.flash {
  max-width: 440px;
  margin: 1.25rem auto 0;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
}
.flash-status {
  background: rgba(43,179,163,0.12);
  border: 1px solid rgba(43,179,163,0.35);
  color: var(--jade);
}

/* Auth pages */
body.is-auth .panel-main {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--canopy-800);
  border: 1px solid var(--canopy-700);
  border-radius: 14px;
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.auth-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.auth-subheading {
  color: var(--mist);
  font-size: 0.92rem;
  margin: 0 0 1.5rem;
}

.auth-form { display: flex; flex-direction: column; gap: 0.3rem; }

.auth-form label {
  font-size: 0.85rem;
  color: var(--mist);
  margin-top: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  background: var(--canopy-900);
  border: 1px solid var(--canopy-600);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,178,61,0.18);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--mist);
  margin-top: 1rem;
}

.btn-primary {
  margin-top: 1.5rem;
  background: linear-gradient(180deg, var(--amber), var(--amber-dim));
  border: none;
  border-radius: 8px;
  color: var(--canopy-950);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(232,178,61,0.3);
  transform: translateY(-1px);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--parchment);
  outline-offset: 2px;
}

.auth-switch {
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--mist);
  text-align: center;
}

.form-error-summary {
  background: rgba(224,89,75,0.1);
  border: 1px solid rgba(224,89,75,0.35);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.form-error-summary ul { margin: 0; padding-left: 1.1rem; }
.form-error-summary li { color: var(--coral); font-size: 0.86rem; }

/* Dashboard */
.panel-main { padding: 2.5rem 1.75rem; max-width: 980px; margin: 0 auto; }

.dash-welcome h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 0 0 0.4rem;
}
.dash-welcome p { color: var(--mist); margin: 0 0 2rem; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.dash-tile {
  background: var(--canopy-800);
  border: 1px solid var(--canopy-700);
  border-radius: 12px;
  padding: 1.4rem;
  position: relative;
}

.dash-tile h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.tile-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--mist);
  margin: 0;
}

.tile-pulse {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--canopy-600);
}
