/* ============================================================
   Design tokens (shared by all pages)
   ============================================================ */

:root {
  --color-bg: #faf6f0;
  --color-surface: #ffffff;
  --color-text: #2b2420;
  --color-text-muted: #6b5f55;
  --color-border: #e8e1d8;
  --color-border-strong: #c9beb2;
  --color-accent: #c2410c;
  --color-accent-hover: #9a3412;
  --color-accent-soft: rgba(194, 65, 12, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;

  --shadow-card: 0 8px 24px rgba(43, 36, 32, 0.05);
  --shadow-card-hover: 0 16px 36px rgba(43, 36, 32, 0.11);
  --shadow-modal: 0 8px 24px rgba(43, 36, 32, 0.08);

  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  --transition-fast: 0.15s ease;
  --transition-lift: 0.25s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ============================================================
   Global (shared by all pages)
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  /* Faint dot grid = "planning paper" texture behind everything */
  background-color: var(--color-bg);
  background-image: radial-gradient(rgba(43, 36, 32, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--color-text);
}

h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-reveal: script.js tags cards with .reveal, then .visible on scroll */
.reveal {
  opacity: 0;
}

.reveal.visible {
  opacity: 1;
  /* "backwards" (not "both") so the animation releases transform when done,
     letting hover lift effects take over */
  animation: fade-up 0.55s ease backwards;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
  }
}

/* ============================================================
   Home Page
   ============================================================ */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.navbar {
  width: min(1100px, 92%);
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--color-accent);
}

.logo-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  transition: transform var(--transition-lift);
}

.logo:hover .logo-mark {
  transform: rotate(-8deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-button {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: white !important;
  transition: background-color var(--transition-fast);
}

.nav-button:hover {
  background: var(--color-accent-hover);
}

.hero {
  min-height: 560px;
  display: flex;
  align-items: center;
  /* Extra bottom padding creates room for the preview card to overlap */
  padding: 72px 0 180px;
  /* Diagonal hairline texture over a soft top glow for depth */
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.05) 0px,
      rgba(255, 255, 255, 0.05) 2px,
      transparent 2px,
      transparent 16px
    ),
    radial-gradient(ellipse 90% 70% at 50% -10%, #de5a1e 0%, var(--color-accent) 60%);
  color: white;
}

/* Staggered entrance for hero content on page load */
.hero-content > * {
  animation: fade-up 0.6s ease backwards;
}

.hero-content > *:nth-child(2) {
  animation-delay: 0.1s;
}

.hero-content > *:nth-child(3) {
  animation-delay: 0.2s;
}

.hero-content > *:nth-child(4) {
  animation-delay: 0.3s;
}

.hero-content {
  width: min(900px, 92%);
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.85);
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto 20px;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 1.05;
}

.hero-text {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.15rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  display: inline-block;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  transition: background-color var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast),
    transform var(--transition-lift), box-shadow var(--transition-lift);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(43, 36, 32, 0.18);
}

.primary-button {
  background: var(--color-text);
  color: white;
}

.primary-button:hover {
  background: #000000;
}

.secondary-button {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

.secondary-button:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---- App preview card (floats over the hero's bottom edge) ---- */

.preview-section {
  width: min(680px, 92%);
  margin: -128px auto 0;
  position: relative;
}

.preview-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(43, 36, 32, 0.16);
  overflow: hidden;
  animation: fade-up 0.6s ease 0.35s backwards;
}

.preview-chrome {
  display: flex;
  gap: 7px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--color-border);
}

.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border-strong);
}

.preview-body {
  padding: 22px 26px 26px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.preview-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.preview-status {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.preview-row {
  margin-bottom: 16px;
}

.preview-row:last-child {
  margin-bottom: 0;
}

.preview-row-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 0.88rem;
}

.preview-row-top span:first-child {
  font-weight: 700;
}

.preview-row-top span:last-child {
  color: var(--color-text-muted);
}

.preview-bar {
  height: 8px;
  border-radius: 999px;
  background: #f0e9e0;
  overflow: hidden;
}

.preview-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-accent);
}

.preview-phase {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.preview-goal {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* Fixed height so the card doesn't jump between slides with/without bars */
.preview-rows {
  min-height: 140px;
}

.preview-slide.swap {
  animation: fade-up 0.35s ease;
}

.preview-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 2px 26px 18px;
}

.preview-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-border-strong);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.preview-dots button:hover {
  background: var(--color-accent-hover);
}

.preview-dots button.active {
  background: var(--color-accent);
  transform: scale(1.3);
}

.features-section {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 64px 0 80px;
}

.section-heading {
  text-align: center;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.section-heading p {
  color: var(--color-text-muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.feature-card {
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-lift), box-shadow var(--transition-lift),
    border-color var(--transition-fast);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-strong);
}

.feature-card:hover .card-icon {
  transform: rotate(-8deg) scale(1.08);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  transition: transform var(--transition-lift);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.site-footer {
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 800px) {
  .navbar {
    flex-direction: column;
    gap: 16px;
    padding: 18px 0;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    min-height: auto;
    padding: 56px 0 150px;
  }

  .preview-section {
    margin-top: -104px;
  }
}

@media (max-width: 520px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

/* ============================================================
   Login Page (scoped under .auth-card so nothing leaks site-wide)
   ============================================================ */

.auth-page {
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  padding: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  box-shadow: var(--shadow-modal);
  animation: fade-up 0.5s ease backwards;
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

.auth-card p {
  color: var(--color-text-muted);
}

.auth-card .form-group {
  margin-bottom: 16px;
}

.auth-card label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.auth-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-card input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.auth-card button {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: white;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--transition-fast), opacity var(--transition-fast);
}

.auth-card button:hover {
  background: #000000;
}

.auth-card button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.auth-actions button {
  background: #e9e9e9;
  color: var(--color-text);
}

.auth-actions button:hover {
  background: #dcdcdc;
}

.auth-card .message {
  min-height: 24px;
  margin-top: 16px;
  font-size: 0.95rem;
}

.auth-card a {
  display: inline-block;
  margin-top: 12px;
  color: var(--color-accent);
  transition: color var(--transition-fast);
}

.auth-card a:hover {
  color: var(--color-accent-hover);
}

/* ============================================================
   Dashboard
   ============================================================ */

.dashboard-main {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 40px 0 80px;
}

.dashboard-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.dashboard-header p {
  margin: 0;
  color: var(--color-text-muted);
}

.logout-button {
  padding: 10px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.logout-button:hover {
  background: #f0f0f0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.dashboard-card {
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-lift), box-shadow var(--transition-lift),
    border-color var(--transition-fast);
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-strong);
}

.dashboard-card:hover .card-icon {
  transform: rotate(-8deg) scale(1.08);
}

.dashboard-card h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.dashboard-card p {
  margin-bottom: 0;
  color: var(--color-text-muted);
  line-height: 1.5;
}

@media (max-width: 800px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Status colors (reserved for state — never decorative)
   ============================================================ */

:root {
  --status-good: #0ca30c;
  --status-good-soft: rgba(12, 163, 12, 0.12);
  --status-warning: #fab219;
  --status-warning-soft: rgba(250, 178, 25, 0.2);
  --status-critical: #d03b3b;
  --status-critical-soft: rgba(208, 59, 59, 0.12);
}

/* ============================================================
   Shared UI: buttons, panels, forms, badges, meters
   ============================================================ */

.btn,
.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none; /* .btn is also used on <a> links (error page) */
  cursor: pointer;
  transition: background-color var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  background: var(--color-accent);
  color: white;
}

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

.btn-quiet {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

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

.btn-reject:hover {
  border-color: var(--status-critical);
  color: var(--status-critical);
}

.btn svg,
.btn-quiet svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Collapsible create-forms: <details> styled so the summary is the button */
.form-panel {
  margin-bottom: 24px;
}

.form-panel > summary {
  list-style: none;
  width: fit-content;
}

.form-panel > summary::-webkit-details-marker {
  display: none;
}

.form-panel[open] > summary {
  margin-bottom: 14px;
}

.panel-card {
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.panel-card h2,
.panel-card h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.panel-hint {
  margin: 0 0 18px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
  margin-bottom: 18px;
}

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

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-field textarea {
  resize: vertical;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* Status badge: soft tint + colored dot; the text stays in ink so the
   label, not the color, carries the meaning */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--color-text);
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--badge-dot, var(--color-border-strong));
  flex-shrink: 0;
}

.badge-good {
  --badge-dot: var(--status-good);
  background: var(--status-good-soft);
}

.badge-warning {
  --badge-dot: var(--status-warning);
  background: var(--status-warning-soft);
}

.badge-critical {
  --badge-dot: var(--status-critical);
  background: var(--status-critical-soft);
}

.badge-muted {
  background: rgba(43, 36, 32, 0.07);
}

/* Progress meter: accent fill on a lighter step of the same ramp */
.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  overflow: hidden;
}

.meter span {
  display: block;
  /* Fill percentage arrives from the template as --progress; custom
     properties keep Jinja expressions out of literal CSS declarations */
  width: var(--progress, 0%);
  height: 100%;
  border-radius: 999px;
  background: var(--color-accent);
}

.meter-caption {
  margin: 7px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.empty-card {
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.empty-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--color-text);
}

.empty-card p {
  margin: 0 auto;
  max-width: 460px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

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

/* ============================================================
   New-project wizard (multi-step dialog)
   ============================================================ */

.dashboard-toolbar {
  margin-bottom: 24px;
}

/* One-shot confirmation banner (e.g. after creating a project) */
.flash {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  line-height: 1.5;
}

.flash-success {
  border-left: 4px solid var(--status-good);
}

.wizard {
  width: min(560px, 94vw);
  padding: 0;
  border: none;
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 60px rgba(43, 36, 32, 0.28);
}

.wizard[open] {
  animation: wizard-in 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes wizard-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.wizard::backdrop {
  background: rgba(43, 36, 32, 0.45);
}

.wizard-top {
  border-bottom: 1px solid var(--color-border);
}

.wizard-progress {
  height: 4px;
  background: var(--color-accent-soft);
}

.wizard-progress span {
  display: block;
  height: 100%;
  width: 20%;
  background: var(--color-accent);
  border-radius: 0 999px 999px 0;
  transition: width 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.wizard-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 12px 28px;
}

.wizard-step-count {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.wizard-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.wizard-close:hover {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.wizard-viewport {
  overflow: hidden;
}

.wizard-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.wizard-step {
  flex: 0 0 100%;
  min-width: 0;
  padding: 28px 32px 8px;
  min-height: 280px;
}

.wizard-eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.wizard-question {
  margin: 0 0 8px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.wizard-hint {
  margin: 0 0 22px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.wizard-input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.wizard-input::placeholder {
  font-weight: 400;
  color: var(--color-border-strong);
}

.wizard-input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

textarea.wizard-input {
  resize: vertical;
  font-size: 1rem;
  line-height: 1.5;
}

.wizard-input-small {
  font-size: 1rem;
  font-weight: 400;
}

.wizard-sublabel {
  display: block;
  margin: 16px 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.wizard-sublabel span {
  font-weight: 400;
  color: var(--color-text-muted);
}

.wizard-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.wizard-dates .wizard-sublabel {
  margin-top: 0;
}

.money-wrap {
  position: relative;
}

.money-wrap > span {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-muted);
  pointer-events: none;
}

.money-wrap .wizard-input {
  padding-left: 34px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.money-wrap .wizard-input::-webkit-outer-spin-button,
.money-wrap .wizard-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wizard-echo {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-accent);
}

.wizard-echo.is-warning {
  color: var(--status-critical);
}

.wizard-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.wizard-review > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.wizard-review > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.wizard-review dt {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding-top: 2px;
}

.wizard-review dd {
  margin: 0;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 32px 24px;
}

.wizard-nav .btn,
.wizard-nav .btn-quiet {
  min-width: 120px;
  justify-content: center;
}

#wizard-back[hidden],
#wizard-next[hidden],
#wizard-create[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .wizard-step {
    padding: 22px 20px 8px;
  }

  .wizard-nav {
    padding: 14px 20px 20px;
  }

  .wizard-dates {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Dashboard: project cards
   ============================================================ */

.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-card-top h2 {
  margin: 0;
}

.project-card-desc {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.project-card-facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 3px;
}

.project-card-facts dd {
  margin: 0;
  font-weight: 700;
}

.project-card-progress {
  margin-top: auto;
}

.project-card-note {
  margin: auto 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ============================================================
   Project detail page
   ============================================================ */

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--color-accent-hover);
}

.project-head {
  margin-bottom: 18px;
}

.project-head-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.project-head-title h1 {
  margin: 0;
  font-size: 1.8rem;
}

.project-head-desc {
  margin: 10px 0 0;
  color: var(--color-text-muted);
  line-height: 1.55;
  max-width: 720px;
}

.project-head-scope {
  margin: 8px 0 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  max-width: 720px;
}

.baseline-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.baseline-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-accent);
}

.baseline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 22px;
}

.baseline-banner p {
  margin: 0;
  line-height: 1.5;
  max-width: 620px;
}

/* KPI row: stat tiles (label + value, optional meter/subtext) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.kpi-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}

.kpi-label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.kpi-value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kpi-tile .meter {
  margin-top: 10px;
}

.kpi-sub {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.detail-section {
  margin-top: 44px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

/* Entry lists: report log and change orders */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.entry-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.entry-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 0 0 12px;
}

.entry-facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 3px;
}

.entry-facts dd {
  margin: 0;
  font-weight: 700;
}

.entry-desc {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.entry-note {
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.entry-note h4 {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.entry-note p {
  margin: 0 0 10px;
  line-height: 1.55;
}

.decision-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.decision-form input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
}

.decision-form input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.decision-note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
