/* Modern minimalist design with white, gray, and leaf green colors */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  /* Updated gradient with animated colors: #E8FDFF, #D5F5DC, #C5E6E2 */
  background: linear-gradient(135deg, #e8fdff 0%, #d5f5dc 49%, #c5e6e2 100%);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #2d3748;
}

/* Added gradient animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.container {
  width: 100%;
  max-width: 700px;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 48px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

h1 {
  color: #1a202c;
  margin-bottom: 12px;
  font-size: 2em;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center; /* Center the title text */
}

h2 {
  color: #4a7c59;
  margin-bottom: 16px;
  font-size: 1.75em;
  font-weight: 600;
}

h3 {
  color: #2d3748;
  margin-bottom: 16px;
  margin-top: 24px;
  font-size: 1.125em;
  font-weight: 600;
  line-height: 1.5;
}

p {
  color: #4a5568;
  line-height: 1.7;
  margin-bottom: 20px;
  font-size: 1.0625em;
}

.subtitle {
  color: #718096;
  font-size: 1.0625em;
  margin-bottom: 32px;
  line-height: 1.6;
  text-align: center; /* Center the subtitle text */
}

.btn {
  display: block;
  background: #4a7c59;
  color: white;
  padding: 14px 32px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(74, 124, 89, 0.2);
  text-align: center;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.btn:hover {
  background: #3d6849;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.question {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.question:last-of-type {
  border-bottom: none;
}

.option {
  display: block;
  padding: 16px 18px;
  margin: 10px 0;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
}

.option:hover {
  border-color: #4a7c59;
  background: #f0f7f3;
  transform: translateX(4px);
}

.option input[type="radio"] {
  margin-right: 12px;
  accent-color: #4a7c59;
}

.option span {
  color: #2d3748;
  font-size: 1em;
}

.error {
  background: #fff5f5;
  color: #c53030;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 24px;
  border: 1px solid #feb2b2;
  font-size: 0.9375em;
}

.success {
  text-align: center;
}

.result {
  text-align: center;
}

/* Result page header with two columns: title info (left) and image (right) */
/* Updated grid-template-columns to 1.5fr 1fr for 60/40 split */
.result-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e2e8f0;
}

.result-top-content {
  display: flex;
  flex-direction: column;
}

.result-top-image {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.result-top-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Result body content at full width (single column) */
.result-body {
  width: 100%;
}

.result-description {
  margin-bottom: 24px;
}

.result-cta {
  margin-top: 32px;
}

.result-details {
  text-align: left;
  background: #f0f7f3;
  padding: 16px 24px 24px 24px; /* Reduced top padding from 24px to 16px to decrease space above heading */
  border-radius: 12px;
  margin: 0 0 12px 0;
  border: 1px solid #d4e8dc;
}

.result-details ul {
  list-style-position: inside;
  color: #4a5568;
}

.result-details li {
  margin: 10px 0;
  line-height: 1.6;
}

.email-form {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid #e2e8f0;
}

.email-form input[type="email"],
.email-form input[type="text"],
.email-form input[type="tel"],
.email-form select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease;
  background: #fafafa;
}

.email-form input[type="email"]:focus,
.email-form input[type="text"]:focus,
.email-form input[type="tel"]:focus,
.email-form select:focus {
  outline: none;
  border-color: #4a7c59;
  background: white;
}

.link {
  display: inline-block;
  margin-top: 24px;
  color: #4a7c59;
  text-decoration: none;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

.error-page {
  text-align: center;
}

form button[type="submit"] {
  width: 100%;
  margin-top: 24px;
}

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

.logo-text {
  font-size: 2.5em;
  font-weight: 700;
  color: #4a7c59;
  letter-spacing: -0.02em;
}

/* Removed box styling from logo container - now just centers the logo */
.logo-container {
  text-align: center;
  margin-bottom: 32px;
}

.logo-image {
  max-width: 160px;
  height: auto;
  display: inline-block;
}

/* Added styling for report request button */
.btn-report {
  display: inline-block;
  background: #000000;
  color: white;
  padding: 14px 32px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 24px 0;
}

.btn-report:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-report:active {
  transform: translateY(0);
}

/* Added form-row grid layout for two-column form fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  color: #2d3748;
  font-weight: 500;
  font-size: 0.9375em;
}

/* Progress bar container */
.progress-container {
  margin-bottom: 32px;
}

.progress-text {
  color: #718096;
  font-size: 0.9375em;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a7c59, #5a9c6f);
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* Options displayed as vertical list with rounded border boxes */
.question-options {
  margin: 32px 0;
}

.option-box {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  margin: 12px 0;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
}

.option-box:hover {
  border-color: #4a7c59;
  background: #f0f7f3;
}

.option-box input[type="radio"] {
  margin-right: 14px;
  accent-color: #4a7c59;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.option-text {
  color: #2d3748;
  font-size: 1em;
  line-height: 1.5;
}

/* Navigation buttons on same line: Previous (gray, left) and Next (green, right) */
/* Added align-items:stretch to ensure both buttons have exactly the same height */
.question-navigation {
  display: flex;
  align-items: stretch; /* Ensures both buttons stretch to same height */
  gap: 16px;
  margin-top: 32px;
}

/* Reset global form button styles that were affecting only the submit button */
.question-navigation .btn-nav {
  width: auto; /* Override global width:100% */
  margin-top: 0; /* Override global margin-top:24px */
}

.question-navigation button[type="submit"] {
  width: auto; /* Extra specificity to override global form button styles */
  margin-top: 0;
}

/* Updated padding to 12px 24px and min-height to 56px for consistent sizing */
.btn-nav {
  flex: 1 1 0%; /* Each button takes exactly 50% */
  min-width: 0; /* Prevent flex items from overflowing */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 24px; /* Uniform padding as specified */
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 56px; /* Consistent minimum height */
  box-sizing: border-box; /* Ensures padding is included in height calculation */
  line-height: 1.5; /* Consistent line-height for text */
}

/* Previous button with specified gray color #6B778C */
.btn-prev {
  background: #6b778c;
  color: white;
}

.btn-prev:hover:not(:disabled) {
  background: #5a6475;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 119, 140, 0.3);
}

/* Added disabled state styling to ensure same height as enabled buttons */
.btn-prev:disabled {
  background: #cbd5e0;
  color: #a0aec0;
  cursor: not-allowed;
  opacity: 0.6;
  /* Explicitly maintain same sizing as enabled state */
  padding: 12px 24px;
  min-height: 56px;
  box-sizing: border-box;
}

/* Next button with specified green color #649460 */
.btn-next {
  background: #649460;
  color: white;
  /* Explicitly set box-sizing to ensure consistent height calculation */
  box-sizing: border-box;
}

.btn-next:hover {
  background: #537a4f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(100, 148, 96, 0.3);
}

.btn-nav:active {
  transform: translateY(0);
}

/* Mobile responsive: stack buttons vertically at 100% width each */
@media (max-width: 640px) {
  .card {
    padding: 32px 24px;
  }

  .question-navigation {
    flex-direction: column;
    gap: 12px;
  }

  .btn-nav {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* Styled "Otros / Cuéntanos" field to match option-box appearance */
.otros-container {
  width: 100%;
  margin: 12px 0 32px 0; /* Same gap as options */
}

.otros-label {
  display: block;
  color: #2d3748;
  font-size: 1em;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.5;
}

.otros-textarea {
  width: 100%;
  padding: 16px 20px; /* Same padding as option-box */
  border: 1.5px solid #e2e8f0; /* Specified border */
  border-radius: 12px; /* Same as option-box */
  background: #f9fafb; /* Specified background */
  color: #0f172a; /* Specified text color */
  font-family: inherit;
  font-size: 1em;
  line-height: 1.5;
  min-height: 120px; /* Specified minimum height */
  resize: vertical; /* Only vertical resize */
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.otros-textarea::placeholder {
  color: #94a3b8; /* Medium gray placeholder */
}

.otros-textarea:focus {
  outline: none;
  border-color: #3f704d; /* Green border on focus */
  box-shadow: 0 0 0 3px rgba(63, 112, 77, 0.1); /* Green ring on focus */
  background: white;
}

/* Mobile: maintain 100% width and same vertical spacing */
@media (max-width: 640px) {
  .otros-container {
    width: 100%;
    margin: 12px 0 24px 0;
  }

  .otros-textarea {
    padding: 14px 16px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* Mobile: stack .result-top vertically (text first, then image) */
@media (max-width: 768px) {
  .result-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .result-top-image {
    width: 100%;
    height: auto; /* el contenedor se ajusta */
  }

  .result-top-image img {
    width: 100%;
    height: 600px; /* controla la altura en móvil */
    object-fit: cover; /* recorta la imagen sin deformar */
    border-radius: 12px;
  }
}

/* Added thank you page styles */
.thank-you-content {
  text-align: center;
  padding: 32px 0;
}

.thank-you-content h1 {
  color: #1a202c;
  font-size: 1.75em;
  margin-bottom: 16px;
  line-height: 1.4;
}

.thank-you-message {
  color: #4a5568;
  font-size: 1.125em;
  margin-bottom: 32px;
}

.btn-start {
  display: inline-block;
  background: #4a7c59;
  color: white;
  padding: 14px 32px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(74, 124, 89, 0.2);
}

.btn-start:hover {
  background: #3d6849;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.btn-start:active {
  transform: translateY(0);
}
