:root {
  --primary-color: #ff6b35;
  --primary-dark: #e55a2b;
  --secondary-color: #004e89;
  --text-dark: #1a1a1a;
  --text-light: #666;
  --border-color: #ddd;
  --success-color: #28a745;
  --error-color: #dc3545;
  --bg-light: #f8f9fa;
  --white: #ffffff;
  --max-width: 680px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  padding: var(--spacing-sm);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

header {
  background-color: var(--secondary-color);
  color: var(--white);
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: center;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

header p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Content Page Navigation - Logo with dropdown */
.content-nav {
  padding: var(--spacing-sm) 0;
  background-color: transparent;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.content-nav .brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.content-nav .brand:hover {
  opacity: 0.7;
}

.nav-dropdown {
  position: relative;
}

.nav-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--secondary-color);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.nav-toggle:hover {
  opacity: 0.7;
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1001;
}

.nav-dropdown.open .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}

.nav-menu a:last-child {
  border-bottom: none;
}

.nav-menu a:first-child {
  border-radius: 6px 6px 0 0;
}

.nav-menu a:last-child {
  border-radius: 0 0 6px 6px;
}

.nav-menu a:hover {
  background-color: var(--bg-light);
}

.nav-menu a.primary {
  background-color: var(--primary-color);
  color: var(--white);
  font-weight: 600;
}

.nav-menu a.primary:hover {
  background-color: var(--primary-dark);
}

.nav-menu-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 0.25rem 0;
}

@media (min-width: 640px) {
  .content-nav {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .content-nav .brand {
    font-size: 1.5rem;
  }

  .nav-toggle {
    font-size: 1.125rem;
  }
}

.progress-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg) var(--spacing-md);
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--border-color);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.progress-dot.active {
  background-color: var(--primary-color);
  transform: scale(1.3);
}

.progress-dot.completed {
  background-color: var(--success-color);
}

main {
  padding: var(--spacing-lg);
}

.step {
  display: none;
  animation: fadeIn 0.4s ease;
}

.step-active {
  display: block;
}

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

.step-header {
  margin-bottom: var(--spacing-lg);
}

.step-header h2 {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: var(--spacing-xs);
}

.step-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: var(--spacing-md);
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
  color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

input.error,
select.error,
textarea.error {
  border-color: var(--error-color);
}

.error-message {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
  display: none;
}

.error-message.show {
  display: block;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
}

.radio-option {
  position: relative;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-label {
  display: block;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: var(--white);
}

.radio-option input[type="radio"]:checked + .radio-label {
  border-color: var(--primary-color);
  background-color: rgba(255, 107, 53, 0.05);
}

.radio-option input[type="radio"]:focus + .radio-label {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.savings-display {
  background: linear-gradient(135deg, var(--secondary-color), #006bb3);
  color: var(--white);
  padding: var(--spacing-xl) var(--spacing-lg);
  border-radius: 8px;
  margin-bottom: var(--spacing-lg);
}

.savings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-md);
}

.savings-item {
  text-align: center;
}

.savings-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: var(--spacing-xs);
}

.savings-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.savings-subtitle {
  text-align: center;
  margin-top: var(--spacing-md);
  font-size: 0.95rem;
  opacity: 0.85;
}

.button-group {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

.btn {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-dark);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--text-dark);
}

.success-screen {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
}

.success-icon {
  width: 80px;
  height: 80px;
  background-color: var(--success-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-lg);
  font-size: 3rem;
  color: var(--white);
}

.success-screen h2 {
  font-size: 1.75rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

.success-screen p {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: var(--spacing-xs);
}

footer {
  background-color: var(--bg-light);
  padding: var(--spacing-lg);
  text-align: center;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-light);
}

.loading {
  display: none;
  text-align: center;
  padding: var(--spacing-md);
}

.loading.show {
  display: block;
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

@media (min-width: 640px) {
  body {
    padding: var(--spacing-lg);
  }

  header h1 {
    font-size: 2rem;
  }

  .radio-group {
    grid-template-columns: 1fr 1fr;
  }

  .step-header h2 {
    font-size: 1.75rem;
  }

  .button-group {
    justify-content: flex-end;
  }

  .btn {
    flex: 0 0 auto;
    min-width: 140px;
  }
}

@media (min-width: 768px) {
  .container {
    margin-top: var(--spacing-xl);
  }

  main {
    padding: var(--spacing-xl);
  }

  .savings-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* NEW FEATURES: Landing Page, Input States, Animations */

/* Landing Page Styles */
.landing-page {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: transparent;
}

.landing-header {
  background-color: transparent;
  padding: var(--spacing-lg) var(--spacing-xl);
 }

.logo h1 {
  color: var(--secondary-color);
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
}

.landing-main {
  padding: 0 ;
}

.hero {
  background: linear-gradient(135deg, var(--secondary-color), #006bb3);
  color: var(--white);
  padding: var(--spacing-xl);
  border-radius: 12px;
  text-align: center;
  margin-bottom: var(--spacing-xl);
  box-shadow: 0 10px 30px rgba(0, 78, 137, 0.3);
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.125rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.95;
  line-height: 1.6;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  text-decoration: none;
  display: inline-block;
  margin-bottom: var(--spacing-md);
}

.btn-primary:active {
  transform: translateY(1px);
}

.hero-trust {
  font-size: 0.875rem;
  opacity: 0.85;
  margin-top: var(--spacing-md);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: var(--spacing-lg);
}

.benefits {
  margin-bottom: var(--spacing-xl);
}

.benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

.benefit-card {
  background-color: var(--white);
  padding: var(--spacing-lg);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.benefit-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
}

.benefit-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

.benefit-card p {
  color: var(--text-light);
  line-height: 1.6;
}

.how-it-works {
  margin-bottom: var(--spacing-xl);
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

.step-card {
  background-color: var(--white);
  padding: var(--spacing-lg);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  padding-top: var(--spacing-xl);
}

.step-number {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.step-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
  text-align: center;
}

.step-card p {
  color: var(--text-light);
  line-height: 1.6;
  text-align: center;
}

.cta-section {
  background: linear-gradient(135deg, var(--secondary-color), #006bb3);
  color: var(--white);
  padding: var(--spacing-xl);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 78, 137, 0.3);
  margin-bottom: var(--spacing-xl);
}

.cta-content {
  text-align: center;
}

.cta-section .cta-content h2,
.cta-section h2 {
  color: var(--white);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.cta-section .cta-content p,
.cta-section p {
  color: rgba(255,255,255,0.95);
  font-size: 1.125rem;
  margin-bottom: var(--spacing-md);
}

.resources {
  background-color: var(--white);
  padding: var(--spacing-xl);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
}

.resource-link {
  padding: 0.625rem 1.25rem;
  background-color: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.resource-link:hover {
  border-color: var(--primary-color);
  background-color: rgba(255, 107, 53, 0.05);
  transform: translateY(-2px);
}

.landing-footer {
  background-color: transparent;
  text-align: center;
  margin: var(--spacing-xl) 0 0;
  font-size: 0.875rem;
}

/* Enhanced Input States with Icons */
.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding-right: 2.5rem;
}

.input-prefix {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-weight: 500;
  pointer-events: none;
}

.input-wrapper input[type="number"] {
  padding-left: 2rem;
}

.input-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.input-wrapper.valid .input-icon::after {
  content: '✓';
  color: var(--success-color);
  font-weight: 700;
  font-size: 1.25rem;
}

.input-wrapper.invalid .input-icon::after {
  content: '✗';
  color: var(--error-color);
  font-weight: 700;
  font-size: 1.25rem;
}

.input-wrapper.valid input {
  border-color: var(--success-color);
}

.input-wrapper.invalid input {
  border-color: var(--error-color);
}

/* Field-level Error and Hint Messages */
.field-error {
  display: block;
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  min-height: 1.25rem;
}

.field-hint {
  display: block;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  font-style: italic;
}

.required-indicator {
  color: var(--error-color);
  font-weight: 700;
}

.step-context {
  color: var(--text-light);
  font-size: 0.95rem;
  font-style: italic;
}

/* Calculation Details Expandable */
.calculation-details {
  margin-top: var(--spacing-md);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: var(--spacing-sm);
}

.calculation-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: var(--spacing-sm);
  user-select: none;
  list-style: none;
}

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

.calculation-details summary::before {
  content: '▶ ';
  display: inline-block;
  transition: transform 0.3s ease;
}

.calculation-details[open] summary::before {
  transform: rotate(90deg);
}

.calculation-list {
  list-style: none;
  padding: var(--spacing-sm) var(--spacing-md);
  margin: 0;
}

.calculation-list li {
  padding: 0.25rem 0;
  opacity: 0.9;
}

.savings-comparison {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0.9;
}

/* Enhanced Success Screen with Animation */
.success-icon-animated {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--spacing-lg);
}

.checkmark {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: block;
  stroke-width: 3;
  stroke: var(--success-color);
  stroke-miterlimit: 10;
  box-shadow: inset 0 0 0 var(--success-color);
  animation: fillCircle 0.4s ease-in-out 0.4s forwards, scaleAnimation 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: var(--success-color);
  fill: none;
  animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: var(--success-color);
  stroke-width: 3;
  animation: strokeCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes strokeCircle {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes strokeCheck {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes fillCircle {
  100% {
    box-shadow: inset 0 0 0 50px var(--success-color);
  }
}

@keyframes scaleAnimation {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale(1.1);
  }
}

.success-details {
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
}

.next-steps {
  background-color: var(--bg-light);
  padding: var(--spacing-md);
  border-radius: 8px;
  margin: var(--spacing-md) 0;
}

.next-steps h3 {
  font-size: 1.125rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

.next-steps ol {
  padding-left: var(--spacing-lg);
  margin: 0;
}

.next-steps li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-light);
  line-height: 1.6;
}

.success-note {
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  margin-top: var(--spacing-md);
}

/* Progress Dots Animation */
.progress-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

.progress-dot.active {
  animation: none;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Button Active State */
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* Loading Message Progressive */
@keyframes fadeInOut {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

#loading-message {
  animation: fadeInOut 2s ease-in-out infinite;
}

/* Responsive Landing Page */
@media (min-width: 640px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .benefits-grid,
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .logo h1 {
    font-size: 2rem;
  }
}

@media (min-width: 768px) {
  .hero {
    padding: 4rem var(--spacing-xl);
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }
}

/* Content Page Spacing - Improves readability for long-form pages */
article {
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto;
}

article section {
  margin-bottom: var(--spacing-xl);
}

article section:last-child {
  padding-bottom: 0;
}

article h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--border-color);
}

article h2:first-of-type {
  margin-top: 0;
}

article h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}

article p {
  margin-bottom: var(--spacing-md);
  color: var(--text-dark);
  line-height: 1.8;
}

article ul,
article ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
  line-height: 1.8;
}

article li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-dark);
}

/* Sticky CTA - Mobile-first design */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(1px);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  padding: var(--spacing-sm);
  z-index: 1000;
  transform: translateY(0);
  transition: transform 0.3s ease;
  text-align: center;
}

.sticky-cta.hidden {
  transform: translateY(100%);
}

.sticky-cta .btn {
  width: 100%;
  margin: 0;
  text-decoration: none;
}

@media (min-width: 640px) {
  .sticky-cta {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .sticky-cta .btn {
    width: auto;
    min-width: 240px;
    max-width: 400px;
  }
}
