/* Base styles for The Documented Patient site */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  color: #111827;
  background-color: #f9fafb;
  line-height: 1.6;
  /* Allow the page to scroll normally and use full height */
  min-height: 100vh;
  overflow-y: auto;
}

/* Brand colors & reusable variables */
:root {
  /* Primary brand purple used across headings and buttons */
  --brand-1: #8E63C7;
  /* Secondary brand orange for highlights */
  --brand-2: #FFA04C;
  /* Dark card background and text colours for contrast */
  --dark-card-bg: #1F2937;
  --dark-card-text: #F9FAFB;
}

/* Utility wrapper for layout */
.wrap {
  width: 90%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* Header */
.header {
  /* Avoid sticky positioning so the header doesn't restrict scrolling on small viewports */
  position: relative;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.headbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Navigation container */
.headbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Navigation links */
.headbar nav a {
  margin-left: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  font-size: 0.9rem;
  background: #EDE9FE;
  transition: background-color 0.2s, color 0.2s;
}

/* Primary call to action button in nav */
.headbar nav a.cta {
  background: var(--brand-1);
  color: #ffffff;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-weight: 700;
}

.headbar nav a:hover {
  background: #D8B4FE;
  color: #4B0082;
}

/* Hero section */
.hero {
  /* Soft gradient for hero background */
  background: linear-gradient(135deg, #f5f3ff, #edf2ff);
  /* Reduce vertical padding so the hero banner doesn't dominate the page */
  padding: 1rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: flex-start;
}

.h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  margin-top: 0;
  font-weight: 800;
}

.purple { color: #8E63C7; }
/* Use CSS variables for brand colours */
.orange { color: var(--brand-2); }
.red { color: #DC2626; }

mark {
  background: #FEF3C7;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
}

.lede {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.btn.primary {
  background: #8E63C7;
  color: #ffffff;
  font-weight: 600;
}

.btn.primary:hover {
  background: #6B3FAA;
}

.btn:hover {
  opacity: 0.9;
}

/* Band sections */
.band {
  padding: 2.5rem 0;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

.sub {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  color: #6B7280;
}

/* Cards & grids */
.card {
  background: #F3F4F6;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

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

/* Hero card styling: keeps the right-hand panel legible */
/* Dark hero card for high contrast */
.hero-card {
  background: var(--dark-card-bg);
  padding: 1rem;
  border-radius: 6px;
  /* Light shadow to separate from background */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
  color: var(--dark-card-text);
  font-size: 0.9rem;
  line-height: 1.4;
}
.hero-card p {
  color: var(--dark-card-text);
}
.hero-card strong {
  color: var(--dark-card-text);
}
.hero-card a { color: var(--dark-card-text); text-decoration: underline; }
.hero-card strong { color: var(--dark-card-text); }

.hero-card .kicker {
  color: var(--brand-1);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.kicker {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--brand-1);
  margin-bottom: 0.25rem;
}

/* Form elements */
textarea, input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  background: #ffffff;
  resize: vertical;
  font-family: 'Inter', sans-serif;
}

label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  display: block;
  color: #374151;
}

.section-label {
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  /* Use brand colours to make section labels stand out */
  color: var(--brand-1);
  text-transform: uppercase;
}

/* Form rows for builder */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-row > div {
  flex: 1;
  min-width: 200px;
}

/* Hero summary container */
#hero-summary-container {
  border: 1px dashed #D1D5DB;
  padding: 1rem;
  border-radius: 4px;
  background: #F9FAFB;
  white-space: pre-wrap;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #374151;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .headbar nav a {
    margin-left: 0;
  }
  .headbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
}