/* Custom styles for Spec - AI-Powered Project Specification Generator */

/* Base styles */
:root {
  --primary: #2B68C1;
  --primary-dark: #2A3B8F;
  --secondary: #6B7280;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --light: #F9FAFB;
  --dark: #1F2937;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
}

/* Typography */
body {
  color: var(--gray-800);
  background-color: var(--gray-50);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.2;
}

h1 {
  font-size: 2.25rem;
  line-height: 2.5rem;
}

@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
    line-height: 1;
  }
}

h2 {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

@media (min-width: 768px) {
  h2 {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

h3 {
  font-size: 1.5rem;
  line-height: 2rem;
}

@media (min-width: 768px) {
  h3 {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}

h4 {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

@media (min-width: 768px) {
  h4 {
    font-size: 1.5rem;
    line-height: 2rem;
  }
}

p {
  margin-bottom: 1rem;
}

a {
  color: #2563eb;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

a:hover {
  color: #1e40af;
}

/* Header hero */
.header-hero {
  position: relative;
  overflow: hidden;
  color: #f8fafc;
  background: linear-gradient(120deg, #1d4ed8 0%, #1e3a8a 45%, #111c52 100%);
  border-bottom-left-radius: 2.5rem;
  border-bottom-right-radius: 2.5rem;
  box-shadow: 0 32px 60px -30px rgba(30, 58, 138, 0.7);
}

.header-hero::before,
.header-hero::after {
  content: "";
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
  opacity: 0.55;
  filter: blur(120px);
}

.header-hero::before {
  width: 420px;
  height: 420px;
  background: rgba(59, 130, 246, 0.65);
  top: -160px;
  left: -140px;
}

.header-hero::after {
  width: 360px;
  height: 360px;
  background: rgba(147, 197, 253, 0.4);
  bottom: -180px;
  right: -120px;
}

.header-logo-badge {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.35), rgba(56, 189, 248, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-logo-badge span {
  font-size: 0.85rem;
}

.header-kicker {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.85);
  margin-bottom: 0.2rem;
}

.header-title {
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 700;
  margin: 0;
  color: #f8fafc;
}

.header-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.header-nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.85);
  position: relative;
  padding-bottom: 0.25rem;
}

.header-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.8);
  transition: width 0.25s ease;
}

.header-nav-link:hover::after,
.header-nav-link:focus-visible::after {
  width: 100%;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #f8fafc;
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.header-cta:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.28);
}

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.9rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.9rem;
  font-weight: 500;
}

.header-lead {
  font-size: clamp(1.05rem, 2.1vw, 1.35rem);
  line-height: 1.8;
  color: rgba(241, 245, 249, 0.92);
  max-width: 42rem;
}

.header-primary,
.header-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.header-primary {
  background: #f8fafc;
  color: #1d4ed8;
  box-shadow: 0 20px 35px -18px rgba(248, 250, 252, 0.9);
}

.header-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 45px -18px rgba(248, 250, 252, 0.95);
}

.header-secondary {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(226, 232, 240, 0.35);
  color: rgba(248, 250, 252, 0.9);
}

.header-secondary:hover {
  transform: translateY(-3px);
  background: rgba(15, 23, 42, 0.5);
}

.header-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.header-stats li {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.header-stat__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f8fafc;
}

.header-stat__label {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
  line-height: 1.4;
}

.header-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-hero__body {
  align-items: center;
}

.header-preview__card {
  width: 100%;
  max-width: 360px;
  border-radius: 1.5rem;
  padding: 1.75rem;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.85), rgba(30, 64, 175, 0.75));
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 25px 50px -20px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.header-preview__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
}

.header-preview__list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.85);
  line-height: 1.5;
}

.header-preview__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  color: rgba(226, 232, 240, 0.85);
}

.header-hero__body {
  align-items: center;
}

/* How-it-works cards */
.how-step {
  position: relative;
  padding: 2rem 1.75rem;
  border-radius: 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 20px 45px -28px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dark .how-step {
  background: rgba(17, 24, 39, 0.9);
  border-color: rgba(148, 163, 184, 0.08);
  box-shadow: 0 20px 45px -28px rgba(15, 23, 42, 0.75);
}

.how-step:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 55px -30px rgba(15, 23, 42, 0.45);
}

.how-step__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.how-step__icon--intake {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.55));
}

.how-step__icon--draft {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(14, 116, 144, 0.55));
}

.how-step__icon--handoff {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(109, 40, 217, 0.55));
}

.how-step__stage {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(37, 99, 235, 0.85);
}

.dark .how-step__stage {
  color: rgba(147, 197, 253, 0.85);
}

.how-step__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dark .how-step__title {
  color: #e2e8f0;
}

.how-step__body {
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.7);
  line-height: 1.6;
}

.dark .how-step__body {
  color: rgba(226, 232, 240, 0.7);
}

.how-step__list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.65);
  display: grid;
  gap: 0.35rem;
}

.dark .how-step__list {
  color: rgba(226, 232, 240, 0.7);
}

.how-step__list li::marker {
  color: rgba(37, 99, 235, 0.8);
}

@media (max-width: 1024px) {
  .header-hero {
    border-bottom-left-radius: 2rem;
    border-bottom-right-radius: 2rem;
  }
}

@media (max-width: 768px) {
  .header-nav-links {
    justify-content: flex-start;
  }

  .header-stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .header-preview__card {
    max-width: none;
  }
}

.fallback-spec {
  display: grid;
  gap: 2rem;
  font-family: 'Inter', sans-serif;
  color: #0f172a;
}

.fallback-spec header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fallback-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(37, 99, 235, 0.8);
}

.fallback-spec h1 {
  font-size: clamp(2rem, 3vw, 2.75rem);
  margin: 0;
}

.fallback-type {
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.6);
}

.fallback-spec section {
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 1.75rem;
  box-shadow: 0 8px 24px -18px rgba(15, 23, 42, 0.3);
}

.fallback-spec h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.fallback-columns {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .fallback-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fallback-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
  color: rgba(15, 23, 42, 0.75);
}

.fallback-stack {
  display: grid;
  gap: 0.75rem;
}

.fallback-stack__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(37, 99, 235, 0.05);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  gap: 1rem;
}

.fallback-stack__item span {
  color: rgba(15, 23, 42, 0.6);
}

.fallback-warning {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.25);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(30, 64, 175, 0.9);
}

.text-muted {
  color: rgba(15, 23, 42, 0.55);
}

.fallback-kv-group {
  display: grid;
  gap: 0.75rem;
}

.fallback-kv {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.fallback-kv span {
  color: rgba(15, 23, 42, 0.6);
}

.dark .fallback-spec {
  color: #e2e8f0;
}

.dark .fallback-spec section {
  background: rgba(17, 24, 39, 0.85);
  border-color: rgba(148, 163, 184, 0.08);
}

.dark .fallback-stack__item {
  background: rgba(37, 99, 235, 0.15);
}

.dark .fallback-type,
.dark .text-muted,
.dark .fallback-stack__item span {
  color: rgba(203, 213, 225, 0.75);
}

.dark .fallback-kv {
  background: rgba(79, 70, 229, 0.16);
  border-color: rgba(129, 140, 248, 0.2);
}

.dark .fallback-kv span {
  color: rgba(203, 213, 225, 0.75);
}

/* Feature cards */
.feature-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.feature-card {
  padding: 2.25rem 2rem;
  border-radius: 1.75rem;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), rgba(15, 23, 42, 0.02));
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 22px 45px -30px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 55px -34px rgba(15, 23, 42, 0.55);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.feature-icon--precision {
  background: linear-gradient(140deg, rgba(37, 99, 235, 0.18), rgba(99, 102, 241, 0.35));
}

.feature-icon--speed {
  background: linear-gradient(140deg, rgba(14, 165, 233, 0.18), rgba(56, 189, 248, 0.3));
}

.feature-icon--security {
  background: linear-gradient(140deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.3));
}

.feature-card h3 {
  font-size: 1.35rem;
  margin: 0;
}

.feature-card p {
  margin: 0;
  color: rgba(15, 23, 42, 0.68);
  line-height: 1.6;
}

.feature-card ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.65);
}

.feature-card ul li::marker {
  color: rgba(37, 99, 235, 0.7);
}

.dark .feature-card {
  background: linear-gradient(140deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.25));
  border-color: rgba(148, 163, 184, 0.1);
}

.dark .feature-card p,
.dark .feature-card ul {
  color: rgba(226, 232, 240, 0.75);
}

.dark .feature-card ul li::marker {
  color: rgba(147, 197, 253, 0.7);
}

.ai-spec {
  background: #ffffff;
  border-radius: 1.75rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 24px 60px -32px rgba(15, 23, 42, 0.35);
  padding: clamp(2rem, 4vw, 3rem);
  display: block;
  color: #0f172a;
  line-height: 1.7;
}

.ai-spec > *:last-child {
  margin-bottom: 0;
}

.ai-spec section {
  margin-bottom: 2.5rem;
}

.ai-spec h2 {
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  margin-bottom: 1rem;
  font-weight: 700;
}

.ai-spec h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  margin: 1.5rem 0 0.75rem;
  font-weight: 600;
}

.ai-spec h4 {
  font-size: clamp(1.05rem, 1.4vw, 1.15rem);
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
}

.ai-spec p {
  margin-bottom: 1rem;
  color: rgba(15, 23, 42, 0.78);
}

.ai-spec ul,
.ai-spec ol {
  margin: 0 0 1.25rem 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  color: rgba(15, 23, 42, 0.78);
}

.ai-spec ul ul,
.ai-spec ol ol {
  margin-top: 0.5rem;
}

.ai-spec table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(241, 245, 249, 0.6);
}

.ai-spec table thead {
  background: rgba(37, 99, 235, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: rgba(30, 64, 175, 0.9);
}

.ai-spec table th,
.ai-spec table td {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  text-align: left;
  vertical-align: top;
}

.ai-spec table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.85);
}

.ai-spec .callout {
  position: relative;
  padding: 1.2rem 1.4rem;
  border-radius: 1rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(59, 130, 246, 0.08);
  color: rgba(15, 23, 42, 0.78);
  margin: 1.5rem 0;
}

.dark .ai-spec {
  background: rgba(17, 24, 39, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 30px 70px -36px rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
}

.dark .ai-spec p,
.dark .ai-spec ul,
.dark .ai-spec ol {
  color: rgba(226, 232, 240, 0.82);
}

.dark .ai-spec table {
  background: rgba(30, 41, 59, 0.75);
}

.dark .ai-spec table thead {
  background: rgba(59, 130, 246, 0.18);
  color: rgba(191, 219, 254, 0.95);
}

.dark .ai-spec table tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.65);
}

.dark .ai-spec .callout {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.12);
  color: rgba(226, 232, 240, 0.88);
}

@media (max-width: 768px) {
  .ai-spec {
    padding: 1.75rem;
  }

  .ai-spec table {
    font-size: 0.95rem;
  }

  .ai-spec ul,
  .ai-spec ol {
    margin-left: 1.2rem;
  }
}

/* Form elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

select {
  appearance: none;
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
  color: white;
  background-color: #2563eb;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
  cursor: pointer;
  text-align: center;
}

button:hover, .btn:hover {
  background-color: #1d4ed8;
}

button:focus, .btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid #2563eb;
  color: #2563eb;
}

.btn-outline:hover {
  background-color: #eff6ff;
}

.btn-danger {
  background-color: #dc2626;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-danger:focus {
  box-shadow: 0 0  ​0 2px rgba(220, 38, 38, 0.5);
}

/* Card */
.card {
  background-color: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Alert */
.alert {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-warning {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-info {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background-color: var(--gray-400);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--gray-500);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in-up {
  animation: slideInUp 0.3s ease-out;
}

/* Custom classes */
.gradient-text {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-image: linear-gradient(to right, #2563eb, #1e40af);
}

/* Print styles */
@media print {
  body {
    background-color: white !important;
    color: black !important;
    font-size: 12pt;
  }
  
  .no-print {
    display: none !important;
  }
  
  .print-break-before {
    page-break-before: always;
  }
  
  .print-break-after {
    page-break-after: always;
  }
  
  .print-break-avoid {
    page-break-inside: avoid;
  }
  
  /* Ensure links are visible in print */
  a {
    color: #1a365d !important;
    text-decoration: underline !important;
  }
  
  /* Ensure proper spacing for printed pages */
  @page {
    margin: 1.5cm;
  }
}

/* Custom form elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
}

.form-helper {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* Custom checkbox and radio */
.custom-checkbox,
.custom-radio {
  display: flex;
  align-items: center;
}

.custom-checkbox input[type="checkbox"],
.custom-radio input[type="radio"] {
  width: 1rem;
  height: 1rem;
  color: #2563eb;
  border-color: var(--gray-300);
  border-radius: 0.25rem;
}

.custom-radio input[type="radio"] {
  border-radius: 9999px;
}

.custom-checkbox input[type="checkbox"]:focus,
.custom-radio input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.custom-checkbox label,
.custom-radio label {
  margin-left: 0.5rem;
  display: block;
  font-size: 0.875rem;
  color: var(--gray-700);
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  width: 2.75rem;
  border-radius: 9999px;
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

.toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.toggle-checkbox {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.toggle-switch {
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
  background-color: #e5e7eb;
  border-radius: 9999px;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

.toggle-checkbox:checked + .toggle-switch {
  background-color: #2563eb;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  left: 0.125rem;
  top: 0.125rem;
  background-color: white;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

.toggle-checkbox:checked + .toggle-switch::after {
  transform: translateX(1.25rem);
}

/* Custom file input */
.file-input {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.file-input::-webkit-file-upload-button {
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  transition: background-color 0.2s;
}

.file-input::-webkit-file-upload-button:hover {
  background-color: #dbeafe;
}

/* Custom select with icon */
.select-with-icon {
  position: relative;
}

.select-with-icon select {
  padding-left: 2.5rem;
}

.select-with-icon .select-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 0.25rem solid #bfdbfe;
  border-radius: 9999px;
  border-top-color: #2563eb;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Form Steps */
.form-step {
  animation: fadeIn 0.3s ease-in-out;
  display: none;
}

.form-step.active {
  display: block;
}

/* Summary sidebar */
.summary-group {
  border: 1px solid rgba(156, 163, 175, 0.2);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dark .summary-group {
  background: rgba(17, 24, 39, 0.4);
  border-color: rgba(75, 85, 99, 0.35);
}

.summary-group[open] {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.summary-heading {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  gap: 0.5rem;
}

.summary-heading::-webkit-details-marker {
  display: none;
}

.dark .summary-heading {
  color: var(--gray-200);
}

.summary-chevron {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
  color: var(--gray-500);
}

.summary-group[open] .summary-chevron {
  transform: rotate(90deg);
}

.summary-list {
  margin: 0;
  padding: 0 1.1rem 1rem;
  display: grid;
  gap: 0.85rem;
}

.summary-list div {
  display: grid;
  gap: 0.2rem;
}

.summary-list dt {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.dark .summary-list dt {
  color: var(--gray-400);
}

.summary-list dd {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gray-800);
  font-weight: 500;
}

.dark .summary-list dd {
  color: var(--gray-100);
}

.summary-muted {
  color: var(--gray-500) !important;
  font-weight: 400 !important;
}

.dark .summary-muted {
  color: var(--gray-400) !important;
}

.summary-group:not(:last-of-type) {
  margin-bottom: 0.5rem;
}

.summary-group:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

/* Progress Bar */
#progress-bar {
  transition: width 0.3s ease-in-out;
}

/* Stack Preset Buttons */
.stack-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  width: 100%;
  gap: 0.35rem;
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
  color: var(--gray-800);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.stack-preset-btn:hover {
  background-color: white;
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(43, 104, 193, 0.12);
  transform: translateY(-1px);
}

.stack-preset-btn.active {
  background-color: rgba(43, 104, 193, 0.08);
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(43, 104, 193, 0.14);
}

.stack-preset-btn span:first-child {
  font-weight: 600;
  color: var(--gray-800);
}

.stack-preset-btn span:last-child {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* Form Controls */
.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray-900);
  background-color: white;
  background-clip: padding-box;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(43, 104, 193, 0.25);
}

/* Checkbox and Radio Buttons */
input[type="checkbox"],
input[type="radio"] {
  margin-right: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

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

.btn-primary:hover {
  background-color: #1e4b8f;
  border-color: #1a4377;
}

.btn-outline {
  color: var(--primary);
  background-color: transparent;
  border-color: var(--primary);
}

.btn-outline:hover {
  color: white;
  background-color: var(--primary);
}

/* Form Helper Text */
.form-helper {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Character Counter */
.char-counter {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-align: right;
  margin-top: 0.25rem;
}

/* Self-Hosting Options */
#self-hosting-options {
  transition: all 0.3s ease-in-out;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark Mode Support */
.dark .form-control {
  background-color: var(--gray-800);
  border-color: var(--gray-700);
  color: var(--gray-100);
}

.dark .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

.dark .form-label {
  color: var(--gray-300);
}

.dark .form-helper {
  color: var(--gray-400);
}

.dark .stack-preset-btn {
  background-color: rgba(17, 24, 39, 0.65);
  border-color: var(--gray-700);
  color: var(--gray-100);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.dark .stack-preset-btn:hover {
  border-color: var(--primary);
  background-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.55);
}

.dark .stack-preset-btn.active {
  background-color: rgba(43, 104, 193, 0.25);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.6);
}

.dark .stack-preset-btn span:first-child {
  color: var(--gray-100);
}

.dark .stack-preset-btn span:last-child {
  color: var(--gray-400);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  h1 {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
  
  h2 {
    font-size: 1.5rem;
    line-height: 2rem;
  }
  
  h3 {
    font-size: 1.25rem;
    line-height: 1.75rem;
  }
  
  /* Adjust form elements for mobile */
  button, .btn, input, select, textarea {
    font-size: 1rem;
  }
  
  /* Improve touch targets */
  button, .btn, [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
  
  body {
    background-color: #111827;
    color: #f3f4f6;
  }
  
  .card, .bg-white {
    background-color: #1f2937;
    color: #f3f4f6;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  select,
  textarea {
    background-color: #374151;
    border-color: #4b5563;
    color: white;
  }
  
  select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239CA3AF' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  }
  
  .form-label {
    color: #d1d5db;
  }
  
  .form-helper {
    color: #9ca3af;
  }
  
  /* Dark mode specific styles for other elements */
  .btn-outline {
    border-color: #3b82f6;
    color: #60a5fa;
  }
  
  .btn-outline:hover {
    background-color: rgba(59, 130, 246, 0.1);
  }
  
  /* Adjust card hover effect in dark mode */
  .card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  }
  
  /* Custom scrollbar for dark mode */
  ::-webkit-scrollbar-track {
    background-color: #1f2937;
  }
  
  ::-webkit-scrollbar-thumb {
    background-color: #4b5563;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
  }
}
