/* Branding Guidelines Implementation */

:root {
  /* Color Palette */
  /* Primary */
  --color-terra-cotta: #CC6B49;
  --color-sage-green: #7A9B76;

  /* Neutrals */
  --color-warm-cream: #FBF7F0;
  --color-deep-charcoal: #2B2B2B;
  --color-warm-grey: #8B7D6B;
  --color-soft-divider: #E8DED0;

  /* Functional */
  --color-moss-green: #5B7553;
  --color-amber-clay: #D4915E;
  --color-rust-red: #B85C4F;
  --color-dusty-lavender: #9B8BA3;

  /* Typography */
  --font-primary: 'DM Sans', Inter, sans-serif;
  --font-mono: 'JetBrains Mono', 'Berkeley Mono', monospace;
  --font-accent: 'Comme', sans-serif;

  /* Spacing & Layout */
  --spacing-unit: 8px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;

  /* Shadows */
  --shadow-card: 0 2px 12px rgba(139, 125, 107, 0.08);
  --shadow-button: 0 4px 12px rgba(204, 107, 73, 0.2);
  --shadow-focus: 0 0 0 4px rgba(122, 155, 118, 0.12);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-warm-cream);
  color: var(--color-deep-charcoal);
  line-height: 1.65;
  /* 1.6-1.7 */
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 500;
  color: var(--color-deep-charcoal);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: calc(var(--spacing-unit) * 2);
}

a {
  color: var(--color-terra-cotta);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #B35A3A;
  /* Darker Terra Cotta */
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 6);
  /* 48px */
}

/* Components */

/* Cards */
.card {
  background: white;
  /* or #FBF7F0, but white provides better contrast on cream bg */
  border: 1.5px solid var(--color-soft-divider);
  border-radius: var(--border-radius-lg);
  padding: calc(var(--spacing-unit) * 4);
  /* 32px */
  box-shadow: var(--shadow-card);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

/* Buttons */
button,
.button,
input[type="submit"] {
  display: inline-block;
  font-family: var(--font-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  border: none;
}

/* Primary Button */
button,
.button,
input[type="submit"] {
  background-color: var(--color-terra-cotta);
  color: var(--color-warm-cream);
  border-radius: var(--border-radius-md);
  padding: 14px 28px;
  box-shadow: var(--shadow-button);
  font-size: 1.1rem;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
  background-color: #B35A3A;
  color: var(--color-warm-cream);
  transform: translateY(-1px);
}

/* Secondary Button */
.button.secondary {
  background-color: transparent;
  border: 2px solid var(--color-terra-cotta);
  color: var(--color-terra-cotta);
  box-shadow: none;
}

.button.secondary:hover {
  background-color: var(--color-warm-cream);
  transform: none;
}

/* Forms */
.form-group {
  margin-bottom: calc(var(--spacing-unit) * 3);
}

label {
  display: block;
  margin-bottom: calc(var(--spacing-unit) * 1);
  font-weight: 500;
  color: var(--color-deep-charcoal);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: white;
  border: 2px solid var(--color-soft-divider);
  border-radius: var(--border-radius-md);
  padding: 14px 18px;
  font-size: 17px;
  font-family: var(--font-primary);
  color: var(--color-deep-charcoal);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-sage-green);
  box-shadow: var(--shadow-focus);
}

/* Alerts */
.alert {
  padding: calc(var(--spacing-unit) * 2);
  border-radius: var(--border-radius-sm);
  margin-bottom: calc(var(--spacing-unit) * 2);
  border-left-width: 4px;
  border-left-style: solid;
}

.alert-success {
  background-color: rgba(91, 117, 83, 0.1);
  border-left-color: var(--color-moss-green);
  color: var(--color-moss-green);
}

.alert-warning {
  background-color: rgba(212, 145, 94, 0.1);
  border-left-color: var(--color-amber-clay);
  color: var(--color-amber-clay);
}

.alert-error {
  background-color: rgba(184, 92, 79, 0.1);
  border-left-color: var(--color-rust-red);
  color: var(--color-rust-red);
}

.alert-info {
  background-color: rgba(155, 139, 163, 0.1);
  border-left-color: var(--color-dusty-lavender);
  color: var(--color-deep-charcoal);
  /* Better readability than lavender text */
}

/* Utilities */

/* Icon Sizing */
.h-4 {
  height: 16px;
}

.w-4 {
  width: 16px;
}

.h-5 {
  height: 20px;
}

.w-5 {
  width: 20px;
}

.h-6 {
  height: 24px;
}

.w-6 {
  width: 24px;
}

.h-8 {
  height: 32px;
}

.w-8 {
  width: 32px;
}

.text-mono {
  font-family: var(--font-mono);
}

.text-accent {
  font-family: var(--font-accent);
}

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

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(204, 107, 73, 0.2);
  border-top: 3px solid var(--color-terra-cotta);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto calc(var(--spacing-unit) * 2);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Phase Selection Cards */
.phase-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: calc(var(--spacing-unit) * 3);
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.phase-card-label {
  display: block;
  cursor: pointer;
  height: 100%;
}

.phase-card-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.phase-card {
  height: 100%;
  background: white;
  border: 2px solid var(--color-soft-divider);
  border-radius: var(--border-radius-lg);
  padding: calc(var(--spacing-unit) * 3);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.phase-card:hover {
  border-color: var(--color-warm-grey);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.phase-card-input:checked+.phase-card {
  border-color: var(--color-terra-cotta);
  background-color: rgba(204, 107, 73, 0.03);
  box-shadow: 0 0 0 2px rgba(204, 107, 73, 0.1);
}

.phase-card-input:focus+.phase-card {
  box-shadow: var(--shadow-focus);
}

.phase-icon {
  font-size: 2rem;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--color-terra-cotta);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.phase-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: calc(var(--spacing-unit) * 1);
  color: var(--color-deep-charcoal);
}

.phase-description {
  font-size: 0.95rem;
  color: var(--color-warm-grey);
  line-height: 1.5;
}

/* Duration Selector */
.duration-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: calc(var(--spacing-unit) * 2);
}

.duration-card {
  display: block;
  cursor: pointer;
  position: relative;
  height: 100%;
}

.duration-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.duration-content {
  background: white;
  border: 2px solid var(--color-soft-divider);
  border-radius: var(--border-radius-md);
  padding: calc(var(--spacing-unit) * 2);
  height: 100%;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.duration-card:hover .duration-content {
  border-color: var(--color-warm-grey);
  transform: translateY(-1px);
}

.duration-radio:checked+.duration-content {
  border-color: var(--color-terra-cotta);
  background-color: rgba(204, 107, 73, 0.03);
  box-shadow: 0 0 0 2px rgba(204, 107, 73, 0.1);
}

.duration-radio:focus+.duration-content {
  box-shadow: var(--shadow-focus);
}

.duration-time {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-deep-charcoal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 4px;
}

.duration-description {
  font-size: 0.9rem;
  color: var(--color-warm-grey);
  line-height: 1.4;
  width: 100%;
}

.custom-duration-input {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 1rem;
  width: 100%;
  border: 1px solid var(--color-soft-divider);
  border-radius: var(--border-radius-sm);
}

.custom-duration-input:focus {
  border-color: var(--color-terra-cotta);
  outline: none;
}

.duration-check-icon {
  color: var(--color-sage-green);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.duration-radio:checked+.duration-content .duration-check-icon {
  opacity: 1;
}

/* Generic Selection Cards */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: calc(var(--spacing-unit) * 2);
  margin-top: 0.5rem;
}

.selection-card {
  display: block;
  cursor: pointer;
  position: relative;
  height: 100%;
}

.selection-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.selection-content {
  background: white;
  border: 2px solid var(--color-soft-divider);
  border-radius: var(--border-radius-md);
  padding: calc(var(--spacing-unit) * 2);
  height: 100%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--color-deep-charcoal);
}

.selection-card:hover .selection-content {
  border-color: var(--color-warm-grey);
  transform: translateY(-1px);
}

.selection-radio:checked+.selection-content {
  border-color: var(--color-terra-cotta);
  background-color: rgba(204, 107, 73, 0.03);
  box-shadow: 0 0 0 2px rgba(204, 107, 73, 0.1);
  color: var(--color-terra-cotta);
}

.selection-radio:focus+.selection-content {
  box-shadow: var(--shadow-focus);
}

.selection-icon {
  color: var(--color-terra-cotta);
  display: flex;
  align-items: center;
}

/* Header */
.site-header {
  padding: calc(var(--spacing-unit) * 2) 0;
  background-color: var(--color-warm-cream);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-image {
  height: 28px;
  width: auto;
  transition: opacity 0.2s ease;
}

.logo:hover .logo-image {
  opacity: 0.8;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 2);
}

.nav-link {
  font-weight: 500;
  color: var(--color-deep-charcoal);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--color-terra-cotta);
  background-color: rgba(204, 107, 73, 0.05);
}

.button-small {
  padding: 10px 20px;
  font-size: 1rem;
}

.button-outline {
  background-color: transparent;
  border: 1.5px solid var(--color-terra-cotta);
  color: var(--color-terra-cotta);
  padding: 8px 18px;
  border-radius: var(--border-radius-md);
  font-weight: 500;
}

.button-outline:hover {
  background-color: rgba(204, 107, 73, 0.05);
  transform: translateY(-1px);
}

/* Homepage Specific Styles */

/* Hero Section */
/* Hero Section */
.hero-section {
  padding: calc(var(--spacing-unit) * 8) 0;
  width: 100%;
}

.hero-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 calc(var(--spacing-unit) * 3);
  /* 24px padding for mobile edges */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--spacing-unit) * 6);
  align-items: center;
}

.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--color-deep-charcoal);
}

.text-highlight {
  color: var(--color-moss-green);
  display: block;
}

.hero-content .subheadline {
  font-size: 1.25rem;
  color: var(--color-deep-charcoal);
  /* Darker for better contrast */
  margin-bottom: calc(var(--spacing-unit) * 4);
  max-width: 100%;
  opacity: 0.9;
}

.hero-visual img {
  width: 100%;
  height: auto;
  max-width: 500px;
  display: block;
  margin: 0 auto;
}

/* Problem Section */
.section-title {
  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 6);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: calc(var(--spacing-unit) * 4);
}

.problem-card {
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: var(--border-radius-lg);
  border: 1.5px solid var(--color-soft-divider);
}

/* Solution Section */
.solution-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: calc(var(--spacing-unit) * 4);
  position: relative;
}

.solution-step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  background: var(--color-terra-cotta);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto calc(var(--spacing-unit) * 2);
  font-weight: bold;
}

/* Features Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: calc(var(--spacing-unit) * 4);
}

.feature-card {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  align-items: flex-start;
}

/* Personas Section */
.personas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--spacing-unit) * 3);
}

.persona-card {
  background: var(--color-warm-cream);
  border: 1.5px solid var(--color-soft-divider);
  border-radius: var(--border-radius-lg);
  padding: calc(var(--spacing-unit) * 4);
}

/* Comparison Section */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--spacing-unit) * 4);
}

.comparison-column {
  padding: calc(var(--spacing-unit) * 4);
  border-radius: var(--border-radius-lg);
}

.comparison-prevent {
  background-color: rgba(184, 92, 79, 0.05);
  border-left: 4px solid var(--color-rust-red);
}

.comparison-generate {
  background-color: rgba(91, 117, 83, 0.05);
  border-left: 4px solid var(--color-moss-green);
}

/* Methodology Section */
.methodology-section {
  background-color: rgba(139, 125, 107, 0.05);
  padding: calc(var(--spacing-unit) * 8) 0;
  text-align: center;
}

.methodology-principles {
  display: flex;
  justify-content: center;
  gap: calc(var(--spacing-unit) * 4);
  flex-wrap: wrap;
  margin-top: calc(var(--spacing-unit) * 4);
}

/* Final CTA Section */
.final-cta-section {
  background-color: var(--color-terra-cotta);
  color: var(--color-warm-cream);
  text-align: center;
  padding: calc(var(--spacing-unit) * 10) 0;
}

.final-cta-section h2 {
  color: var(--color-warm-cream);
}

.button-inverted {
  background-color: var(--color-warm-cream);
  color: var(--color-terra-cotta);
}

.button-inverted:hover {
  background-color: white;
  transform: translateY(-1px);
}

/* Footer */
.site-footer {
  background-color: var(--color-deep-charcoal);
  color: var(--color-warm-cream);
  padding: calc(var(--spacing-unit) * 8) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: calc(var(--spacing-unit) * 4);
}

.footer-links a {
  color: var(--color-warm-grey);
  display: block;
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.footer-links a:hover {
  color: var(--color-warm-cream);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 6);
  /* Increased from 4 to 6 (48px) */
}

/* ... existing styles ... */

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .hero-container {
    gap: calc(var(--spacing-unit) * 4);
  }

  .hero-content h1 {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: calc(var(--spacing-unit) * 3);
    /* Smaller padding on mobile */
  }

  .hero-container,
  .features-grid,
  .personas-grid,
  .comparison-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-section {
    padding-top: calc(var(--spacing-unit) * 4);
    padding-bottom: calc(var(--spacing-unit) * 6);
  }

  .hero-visual {
    margin-top: calc(var(--spacing-unit) * 4);
    /* Ensure image doesn't overflow on very small screens */
    width: 100%;
  }
}

@media (max-width: 375px) {
  .hero-content h1 {
    font-size: 2rem;
    /* Smaller font for very small screens */
  }

  .hero-container {
    padding: 0 calc(var(--spacing-unit) * 2);
    /* 16px padding */
  }
}

/* Dashboard Styles */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(var(--spacing-unit) * 6);
}

.dashboard-header h1 {
  margin-bottom: 0;
}

.scripts-list {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
  max-width: 800px;
}

.script-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease;
}

.script-card-link:hover {
  transform: translateY(-2px);
}

.script-card {
  background: white;
  border: 1.5px solid var(--color-soft-divider);
  border-radius: var(--border-radius-lg);
  padding: calc(var(--spacing-unit) * 3);
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--spacing-unit) * 3);
  transition: all 0.2s ease;
  cursor: pointer;
}

.script-card:hover {
  border-color: var(--color-terra-cotta);
  box-shadow: 0 4px 16px rgba(139, 125, 107, 0.12);
}

.script-card-content {
  flex: 1;
}

.script-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-deep-charcoal);
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.script-meta {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  font-size: 0.95rem;
  color: var(--color-warm-grey);
}

.script-type,
.script-date,
.script-duration {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 1);
}

.script-icon {
  width: 16px;
  height: 16px;
  color: var(--color-warm-grey);
}

.script-card-arrow {
  color: var(--color-warm-grey);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.script-card:hover .script-card-arrow {
  color: var(--color-terra-cotta);
  transform: translateX(4px);
}

.empty-state {
  text-align: center;
  padding: calc(var(--spacing-unit) * 8) calc(var(--spacing-unit) * 4);
  background: white;
  border: 1.5px solid var(--color-soft-divider);
  border-radius: var(--border-radius-lg);
  max-width: 600px;
  margin: 0 auto;
}

.empty-state p {
  color: var(--color-warm-grey);
  font-size: 1.1rem;
  margin-bottom: calc(var(--spacing-unit) * 3);
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--spacing-unit) * 2);
  }

  .script-meta {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1);
  }

  .script-card {
    padding: calc(var(--spacing-unit) * 2);
  }
}

/* Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid var(--color-soft-divider);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-card);
  z-index: 10;
  min-width: 280px;
  overflow: hidden;
  padding: 0;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  padding: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: none;
  border-radius: 0;
  color: var(--color-deep-charcoal);
  transition: background-color 0.2s ease;
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.5;
}

/* Reset global button styles */
button.dropdown-item {
  background-color: transparent;
  color: var(--color-deep-charcoal);
  box-shadow: none;
  transform: none;
  margin: 0;
}

button.dropdown-item:hover {
  background-color: rgba(204, 107, 73, 0.12);
  transform: none;
  box-shadow: none;
  color: var(--color-deep-charcoal);
}

.dropdown-item+.dropdown-item {
  border-top: 1px solid var(--color-soft-divider);
}

.dropdown-item-icon {
  margin-top: 3px;
  color: var(--color-terra-cotta);
  flex-shrink: 0;
}

.dropdown-item-title {
  display: block;
  color: var(--color-deep-charcoal);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.dropdown-item-description {
  display: block;
  color: var(--color-warm-grey);
  font-size: 0.85rem;
  line-height: 1.3;
  font-weight: normal;
}
