/* ===== CSS VARIABLES ===== */
:root {
  /* HeadEV Color Palette */
  --color-green: #7ed36b;
  --color-green-dark: #5fa34d;
  --color-black: #0c141b;
  --color-gray-deep: #25313a;
  --color-white: #e2e6e9;
  --color-surface: #24313b;
  --color-surface-strong: #1f2b34;
  --color-border: rgba(126, 211, 107, 0.25);
  --color-glow: rgba(126, 211, 107, 0.22);
  --color-white-pure: #ffffff;
  
  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(21, 31, 40, 0.1);
  --shadow-md: 0 4px 12px rgba(21, 31, 40, 0.15);
  --shadow-lg: 0 8px 24px rgba(21, 31, 40, 0.2);
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: radial-gradient(circle at top, #121b23, #0b1218 55%, #081015 100%);
  color: var(--color-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(126, 211, 107, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== HEADER ===== */
.header {
  background: var(--color-black);
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--color-gray-deep);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.logo-text {
  color: var(--color-white);
}

.logo-accent {
  color: var(--color-green);
  margin: 0 -2px;
}

.nav {
  display: flex;
  gap: var(--spacing-md);
}

.nav-link {
  color: var(--color-white);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  padding: var(--spacing-xs) 0;
}

.nav-link:hover {
  color: var(--color-green);
}

/* ===== PAGE HEADER ===== */
/* ===== HERO ===== */
.hero {
  position: relative;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-lg) var(--spacing-sm) var(--spacing-md);
  z-index: 1;
}

/* Compact hero in iframe mode */
body.iframe-mode .hero {
  padding: 1rem var(--spacing-sm) 1rem;
  margin-bottom: 1rem;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(126, 211, 107, 0.18), transparent 60%);
  filter: blur(10px);
  opacity: 0.8;
  pointer-events: none;
}

.hero-card {
  position: relative;
  padding: var(--spacing-lg) var(--spacing-lg);
  border-radius: 22px;
  border: 1px solid rgba(126, 211, 107, 0.18);
  background: linear-gradient(140deg, rgba(28, 40, 50, 0.95), rgba(18, 27, 35, 0.9));
  box-shadow: 0 18px 45px rgba(8, 16, 21, 0.5);
  text-align: center;
}

.hero-logo {
  margin-bottom: var(--spacing-md);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-img {
  height: 60px;
  width: auto;
  max-width: 280px;
}

.hero-tag {
  display: inline-flex;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(126, 211, 107, 0.2);
  color: #c8f2bf;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--spacing-sm);
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #e5eef3;
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.01em;
}

.hero-title-sub {
  font-size: 1.3rem;
  font-weight: 600;
  color: #e5eef3;
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-green);
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
}

.hero-description {
  font-size: 0.95rem;
  color: rgba(226, 230, 233, 0.7);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-actions {
  margin-top: var(--spacing-lg);
  display: flex;
  justify-content: center;
}

.legal-note-footer,
.consent-footer {
  margin: 0.75rem 0 1.1rem;
  padding: 0 1rem;
}

.legal-note-footer-inner,
.consent-footer-inner {
  max-width: 980px;
  margin: 0 auto;
  color: rgba(226, 230, 233, 0.52);
  font-size: 0.74rem;
  line-height: 1.42;
  text-align: center;
}

.legal-note-footer a,
.consent-footer a {
  color: rgba(180, 233, 170, 0.74);
  text-decoration: underline;
  text-decoration-color: rgba(180, 233, 170, 0.33);
  text-underline-offset: 2px;
  font-weight: 500;
}

.legal-note-footer a:hover,
.consent-footer a:hover {
  color: rgba(209, 247, 201, 0.9);
  text-decoration-color: rgba(209, 247, 201, 0.6);
}

.btn-start {
  position: relative;
  overflow: hidden;
  padding: 0.85rem 2.4rem;
}

.btn-start-text {
  position: relative;
  z-index: 1;
}

.btn-start-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45), transparent 60%);
  animation: pulseGlow 2.8s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes pulseGlow {
  0% {
    transform: scale(0.75);
    opacity: 0.35;
  }
  50% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(0.75);
    opacity: 0.35;
  }
}

/* ===== CONTAINER ===== */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ===== MAIN ===== */
.main {
  flex: 1;
  padding: var(--spacing-lg) 0;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
  margin-bottom: var(--spacing-lg);
  display: none;
}

.progress-container.active {
  display: block;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.progress-step {
  flex: 1;
  opacity: 0.5;
  transition: opacity var(--transition-normal);
}

.progress-step.active,
.progress-step.completed {
  opacity: 1;
}

.step-badge {
  background: rgba(18, 27, 35, 0.6);
  color: rgba(226, 230, 233, 0.65);
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  font-weight: 500;
}

.progress-step.active .step-badge {
  background: rgba(126, 211, 107, 0.2);
  color: #c8f2bf;
  border: 1px solid var(--color-border);
  box-shadow: 0 0 0 1px rgba(126, 211, 107, 0.15);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-green), #9be391);
  width: 0%;
  transition: width 0.4s ease;
}

/* ===== FORM WRAPPER ===== */
.form-wrapper {
  max-width: 860px;
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid rgba(126, 211, 107, 0.15);
  box-shadow: 0 18px 40px rgba(8, 16, 21, 0.5), 0 0 20px var(--color-glow);
  overflow: visible;
  min-height: fit-content;
}

.is-hidden {
  display: none;
}

/* ===== START TRANSITION ===== */
.start-transition {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.2s ease;
}

.start-transition.active {
  opacity: 1;
  pointer-events: auto;
}

.start-transition::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, #121b23, #0b1218 55%, #081015 100%);
  opacity: 1;
}

.start-image {
  position: relative;
  width: min(60vw, 320px);
  height: auto;
  z-index: 1;
  transform: scale(0.3);
  opacity: 0.85;
}

.start-transition.active .start-image {
  animation: boltExpand 3s ease-out forwards;
}

.pulse-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(126, 211, 107, 0.65);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(126, 211, 107, 0.35);
  animation: pulseExpand 3s ease-out forwards;
  opacity: 0.8;
}

@keyframes boltExpand {
  0% {
    transform: scale(0.3);
    opacity: 0.85;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* ===== FORM STEPS ===== */
.form-step {
  display: none;
  padding: var(--spacing-lg);
  animation: fadeIn var(--transition-normal);
  min-height: fit-content;
}

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

/* Ensure step 4 (result) has proper spacing */
.form-step#step-4 {
  padding: var(--spacing-md) var(--spacing-lg);
}

/* ===== STEP CONTENT ===== */
.step-content {
  max-width: 100%;
  margin: 0 auto;
}

.step-title {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-lg);
  color: #eef6f9;
  font-weight: 600;
}

.step-help-text {
  margin: -0.8rem 0 1rem;
  color: rgba(226, 230, 233, 0.72);
  font-size: 0.9rem;
}

/* ===== FORM ROW ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(226, 230, 233, 0.8);
  margin-bottom: var(--spacing-xs);
}

.form-help-text {
  margin: -0.2rem 0 0.55rem;
  color: rgba(226, 230, 233, 0.6);
  font-size: 0.8rem;
  line-height: 1.35;
}

/* Input with icon/prefix */
.input-with-icon {
  display: flex;
  align-items: stretch;
  background: var(--color-surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.input-with-icon:focus-within {
  background: #202e38;
  border-color: rgba(126, 211, 107, 0.55);
  box-shadow: 0 0 0 3px rgba(126, 211, 107, 0.12);
}

.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-green);
  background: rgba(126, 211, 107, 0.08);
  border-right: 1px solid rgba(126, 211, 107, 0.15);
  flex-shrink: 0;
  min-width: 50px;
  letter-spacing: 0.5px;
}

.input-with-prefix {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.75rem 0.85rem;
  flex: 1;
  min-width: 0;
}

.input-with-prefix:focus {
  outline: none;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Hide number input spinners */
.input-with-prefix::-webkit-outer-spin-button,
.input-with-prefix::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-with-prefix[type=number] {
  -moz-appearance: textfield;
}

.form-input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: var(--color-surface-strong);
  color: #ffffff;
  transition: all 0.3s ease;
  font-family: var(--font-primary);
}

.form-input::placeholder {
  color: rgba(226, 230, 233, 0.45);
}

.input-with-prefix::placeholder {
  color: rgba(226, 230, 233, 0.4);
}

.form-input:focus {
  outline: none;
  background: #202e38;
  border-color: rgba(126, 211, 107, 0.55);
  box-shadow: 0 0 0 3px rgba(126, 211, 107, 0.12);
}

.form-input::placeholder {
  color: rgba(226, 230, 233, 0.4);
}

.form-input:not(:placeholder-shown) {
  background: #1a242c;
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8f0f5;
}

/* Autofill handling for modern browsers */
.form-input:-webkit-autofill {
  -webkit-text-fill-color: #e8f0f5;
  box-shadow: 0 0 0 1000px #1a242c inset;
  border-color: rgba(255, 255, 255, 0.12);
}

/* Input with prefix: autofill */
.input-with-prefix:-webkit-autofill {
  box-shadow: 0 0 0 1000px transparent inset;
}

/* Input with icon: has content */
.input-with-icon:has(.input-with-prefix:not(:placeholder-shown)) {
  background: #1a242c;
  border-color: rgba(255, 255, 255, 0.12);
}

.form-input.error {
  border-color: rgba(255, 120, 120, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 120, 120, 0.18);
  background: #241c1f;
}

/* Error state for input with icon */
.input-with-icon:has(.form-input.error) {
  border-color: rgba(255, 120, 120, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 120, 120, 0.18);
  background: #241c1f;
}

.input-with-icon:has(.form-input.error) .input-icon {
  color: rgba(255, 120, 120, 0.8);
  background: rgba(255, 120, 120, 0.12);
  border-right-color: rgba(255, 120, 120, 0.3);
}

.form-error {
  display: block;
  margin-top: 0.45rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 120, 120, 0.12);
  color: #ffb6b6;
  font-size: 0.8rem;
  line-height: 1.3;
}

.form-error:empty {
  display: none;
}

/* ===== RADIO BUTTONS SIMPLE ===== */
.radio-group-vertical {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.radio-option-simple {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.9rem var(--spacing-md);
  background: var(--color-surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.radio-option-simple:hover {
  background: #1b2730;
}

.radio-option-simple input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: var(--spacing-md);
  cursor: pointer;
  accent-color: var(--color-green);
}

.radio-option-simple:has(input[type="radio"]:checked) {
  background: rgba(126, 211, 107, 0.16);
  border-color: rgba(126, 211, 107, 0.35);
  box-shadow: 0 0 0 2px rgba(126, 211, 107, 0.08);
}

.radio-label {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
}

.step3-question-locked {
  opacity: 0.62;
}

.step3-question-locked .radio-option-simple {
  cursor: not-allowed;
}

.step3-question-locked .radio-option-simple:hover {
  background: var(--color-surface-strong);
}

.step3-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.25rem;
  color: rgba(226, 230, 233, 0.82);
  font-size: 0.9rem;
}

.step3-retry {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

/* ===== CALC INFO ===== */
.calc-info {
  background: rgba(126, 211, 107, 0.12);
  border: 1px solid rgba(126, 211, 107, 0.3);
  border-radius: 10px;
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.calc-info p {
  color: #e5e7eb;
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.progress-calc {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-calc-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-green), #9be391);
  width: 0%;
  transition: width 0.3s ease;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 0.75rem var(--spacing-lg);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  min-width: 120px;
}

.btn-primary {
  background: linear-gradient(90deg, #8fe28a, #72c95f);
  color: #0e1a12;
  box-shadow: 0 10px 20px rgba(114, 201, 95, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(90deg, #9df09a, #7fd86c);
  transform: translateY(-1px);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: #d9e4ea;
  border: 1px solid rgba(217, 228, 234, 0.25);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-white-pure);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.form-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
  justify-content: space-between;
}

/* Center single button in results step */
#step-4 .form-actions {
  justify-content: center;
}

/* ===== RESULT CONTAINER ===== */
.result-container {
  text-align: center;
  padding: var(--spacing-md) var(--spacing-lg);
  min-height: fit-content;
}

.result-icon {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-sm);
  line-height: 1;
}

.result-title {
  font-size: 1.75rem;
  color: var(--color-white);
  margin-bottom: var(--spacing-sm);
  font-weight: bold;
  line-height: 1.3;
}

.result-description {
  font-size: 1rem;
  color: var(--color-white);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.result-highlight {
  color: var(--color-green);
  font-weight: 700;
}

.result-details {
  background: #121b23;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0;
  text-align: left;
}

.result-details h3 {
  color: var(--color-green);
  margin-bottom: var(--spacing-md);
  font-size: 1.25rem;
}

.result-details ul {
  list-style: none;
}

.result-details li {
  padding: var(--spacing-xs) 0;
  color: var(--color-white);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.result-details li::before {
  content: "⚡";
  color: var(--color-green);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.result-cta {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.result-info {
  background: rgba(126, 211, 107, 0.1);
  border: 1px solid rgba(126, 211, 107, 0.35);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-top: var(--spacing-md);
  color: var(--color-white);
  font-size: 0.9rem;
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  animation: fadeInUp 0.5s ease-out, pulse 2s ease-in-out infinite;
  pointer-events: none;
}

.scroll-indicator-content {
  background: rgba(126, 211, 107, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(126, 211, 107, 0.3);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-green);
  font-size: 0.85rem;
  font-weight: 500;
}

.scroll-arrow {
  font-size: 1.2rem;
  animation: bounce 1.5s ease-in-out infinite;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

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

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-black);
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--color-gray-deep);
  text-align: center;
  color: var(--color-white);
  opacity: 0.8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav {
    display: none;
  }
  
  .hero-title {
    font-size: 1.85rem;
  }
  
  .hero-subtitle {
    font-size: 0.98rem;
  }

  .hero-description {
    font-size: 0.92rem;
  }

  .btn-start {
    width: 100%;
  }
  
  .step-title {
    font-size: 1.15rem;
  }
  
  .form-step {
    padding: var(--spacing-md);
  }
  
  .form-actions {
    flex-direction: column-reverse;
  }
  
  .btn {
    width: 100%;
  }
  
  .progress-steps {
    gap: var(--spacing-xs);
    flex-wrap: wrap;
    justify-content: center;
  }

  .progress-step {
    flex: 1 1 45%;
    min-width: 140px;
  }

  .step-badge {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }
  
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }
  
  .step-label {
    font-size: 0.75rem;
  }
  
  .result-title {
    font-size: 1.35rem;
  }
  
  .result-icon {
    font-size: 2.5rem;
  }
  
  .result-description {
    font-size: 0.95rem;
  }
  
  .result-container {
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .result-details {
    padding: var(--spacing-sm);
  }
  
  .scroll-indicator {
    bottom: 15px;
  }
  
  .scroll-indicator-content {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  .container {
    padding: 0 var(--spacing-xs);
  }
  
  .hero-title {
    font-size: 1.6rem;
  }

  .progress-steps {
    gap: 0.35rem;
  }

  .progress-step {
    flex: 1 1 48%;
    min-width: 120px;
  }

  .step-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }

  .hero-card {
    padding: var(--spacing-md);
    border-radius: 16px;
  }

  .hero-description {
    font-size: 0.9rem;
  }
  
  .radio-icon {
    font-size: 1.5rem;
  }
}

/* ===== LOADING STATE ===== */
.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ===== IFRAME MODE ===== */
body.iframe-mode {
  min-height: auto;
  height: 100%;
  background: radial-gradient(circle at top, #121b23, #0b1218 55%, #081015 100%);
  overflow-y: auto;
}

.main-iframe {
  padding: 1rem 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Hide header and footer when in iframe */
body.iframe-mode .header,
body.iframe-mode .footer {
  display: none;
}

/* Adjust container for iframe */
body.iframe-mode .container {
  max-width: 1140px; /* Bootstrap xl container width */
  padding: 0 1rem;
}

/* En pantallas pequeñas, ocupar todo el ancho */
@media (max-width: 1199px) {
  body.iframe-mode .container {
    max-width: 960px; /* Bootstrap lg container width */
  }
}

@media (max-width: 991px) {
  body.iframe-mode .container {
    max-width: 720px; /* Bootstrap md container width */
  }
}

@media (max-width: 767px) {
  body.iframe-mode .container {
    max-width: 100%; /* Full width on mobile */
    padding: 0 0.75rem;
  }
}

/* Adjust form wrapper for iframe */
body.iframe-mode .form-wrapper {
  max-width: 100%;
  margin: 0;
  box-shadow: 0 12px 30px rgba(8, 16, 21, 0.4), 0 0 15px var(--color-glow);
}

@media (max-width: 767px) {
  body.iframe-mode .form-wrapper {
    border-radius: 12px;
  }
}

/* Compact intro for iframe */
body.iframe-mode .intro-title {
  font-size: 2rem;
}

body.iframe-mode .intro-subtitle {
  font-size: 1.1rem;
}

/* Compact hero card in iframe */
body.iframe-mode .hero-card {
  padding: 1.25rem 1rem;
}

body.iframe-mode .hero-logo {
  margin-bottom: 0.75rem;
}

body.iframe-mode .hero-logo-img {
  height: 45px;
}

body.iframe-mode .hero-title-sub {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

body.iframe-mode .hero-subtitle {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

body.iframe-mode .hero-description {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

body.iframe-mode .hero-actions {
  margin-top: 1rem;
}

/* Adjust progress bar spacing */
body.iframe-mode .progress-container {
  margin-bottom: 1rem;
}

/* Compact form steps in iframe */
body.iframe-mode .form-step {
  padding: 1rem;
}

body.iframe-mode .step-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

body.iframe-mode .form-group {
  margin-bottom: 1rem;
}

body.iframe-mode .form-row {
  margin-bottom: 0.75rem;
  gap: 1rem;
}

body.iframe-mode .form-actions {
  margin-top: 1.25rem;
}

body.iframe-mode .result-container {
  padding: 1rem;
}

/* ===== ERROR MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(21, 31, 40, 0.85);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
}

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

@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content {
  background: var(--color-dark-gray);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.3s ease;
  border: 1px solid rgba(119, 187, 102, 0.2);
}

.modal-header {
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
  border-bottom: 1px solid rgba(226, 230, 233, 0.1);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.modal-icon {
  font-size: 2rem;
  line-height: 1;
}

.modal-header h3 {
  margin: 0;
  color: var(--color-white);
  font-size: 1.4rem;
  font-weight: 600;
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-body p {
  margin: 0;
  color: #e5e7eb;
  font-size: 1rem;
  line-height: 1.6;
}

.modal-footer {
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
}

.modal-footer .btn-primary {
  min-width: 140px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .modal-content {
    margin: var(--spacing-md);
    max-width: calc(100% - 2rem);
  }
  
  .modal-header h3 {
    font-size: 1.2rem;
  }
  
  .modal-icon {
    font-size: 1.5rem;
  }
  
  .modal-body p {
    font-size: 0.95rem;
  }
  
  /* Extra compact for mobile iframe */
  body.iframe-mode .hero-card {
    padding: 1rem 0.75rem;
  }
  
  body.iframe-mode .hero-logo-img {
    height: 40px;
  }
  
  body.iframe-mode .hero-title-sub {
    font-size: 1rem;
  }
  
  body.iframe-mode .hero-subtitle {
    font-size: 0.9rem;
  }
  
  body.iframe-mode .hero-description {
    font-size: 0.8rem;
  }
  
  body.iframe-mode .form-step {
    padding: 0.75rem;
  }
  
  body.iframe-mode .step-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  body.iframe-mode .form-group {
    margin-bottom: 0.75rem;
  }
  
  body.iframe-mode .form-row {
    gap: 0.75rem;
    margin-bottom: 0.5rem;
  }
  
  body.iframe-mode .progress-container {
    margin-bottom: 0.75rem;
  }
  
  body.iframe-mode .progress-steps {
    gap: 0.25rem;
  }
  
  body.iframe-mode .step-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
  }
  
  body.iframe-mode .main-iframe {
    padding: 0.5rem 0;
  }
  
  body.iframe-mode .hero {
    padding: 0.5rem var(--spacing-sm) 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  body.iframe-mode .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
  }
  
  body.iframe-mode .form-input,
  body.iframe-mode .input-with-prefix {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
  
  body.iframe-mode .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }
  
  body.iframe-mode .form-actions {
    margin-top: 1rem;
    gap: 0.75rem;
  }
  
  body.iframe-mode .radio-option-simple {
    padding: 0.75rem 1rem;
  }
  
  body.iframe-mode .result-details {
    padding: 0.75rem;
    margin: 0.75rem 0;
  }
}

@media (max-width: 480px) {
  body.iframe-mode .hero-card {
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
  }
  
  body.iframe-mode .hero-logo-img {
    height: 35px;
  }
  
  body.iframe-mode .hero-title-sub {
    font-size: 0.95rem;
  }
  
  body.iframe-mode .hero-subtitle {
    font-size: 0.85rem;
  }
  
  body.iframe-mode .hero-description {
    font-size: 0.75rem;
  }
  
  body.iframe-mode .form-step {
    padding: 0.5rem;
  }
  
  body.iframe-mode .step-title {
    font-size: 0.95rem;
  }
  
  body.iframe-mode .container {
    padding: 0 0.5rem;
  }
}
