/* ==========================================================================
   CSS Resets & Variables
   ========================================================================== */
   :root {
    --primary-color: #4f46e5;       /* Indigo */
    --primary-hover: #4338ca;
    --text-main: #111827;           /* Slate 900 */
    --text-muted: #6b7280;          /* Slate 500 */
    --bg-input: transparent;
    --border-color: #cbd5e1;
    --border-focus: #4f46e5;
    --error-color: #ef4444;
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html, body {
    height: 100%;
    width: 100%;
  }
  
  body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: #f8fafc;
    /* Soft AI generated background layered with a heavy frosted white overlay for readability */
    background-image: linear-gradient(rgba(248, 250, 252, 0.85), rgba(248, 250, 252, 0.95)), url('https://offertabs.s3.amazonaws.com/offer/qoi769/site/media/6a178e1fe24319.61996121.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }
  
  /* ==========================================================================
     Utility Classes
     ========================================================================== */
  .hidden {
    display: none !important;
  }
  
  /* ==========================================================================
     Layout & Progress Bar
     ========================================================================== */
  .progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.05);
    z-index: 100;
  }
  
  .progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
    /* This centers the content vertically */
    justify-content: center; 
  }
  
  /* ==========================================================================
     Form Steps & Animations
     ========================================================================== */
  .form-wrapper {
    width: 100%;
    margin: auto 0; /* Helps vertically center in combination with justify-content */
  }
  
  .step-container {
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  
  @keyframes slideUpFade {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* ==========================================================================
     Typography & Question Headers
     ========================================================================== */
  .question-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 16px;
  }
  
  .step-number {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 16px;
    display: flex;
    align-items: center;
  }
  
  .step-container h2 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
  }
  
  .question-subtext {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-left: calc(1.5rem + 16px);
    margin-bottom: 32px;
  }
  
  .highlight-text {
    color: var(--primary-color);
  }
  
  /* ==========================================================================
     Inputs & Controls
     ========================================================================== */
  .input-wrapper {
    margin-left: calc(1.5rem + 16px);
    margin-bottom: 32px;
    position: relative;
  }
  
  input[type="text"],
  input[type="email"] {
    width: 100%;
    font-family: var(--font-body);
    font-size: 2rem;
    color: var(--primary-color);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color);
    padding: 8px 0;
    outline: none;
    border-radius: 0;
    transition: all 0.3s ease;
  }
  
  input::placeholder {
    color: rgba(107, 114, 128, 0.4);
  }
  
  input:focus {
    border-bottom-color: var(--border-focus);
  }
  
  /* Form Validation Error Hint */
  input:invalid:not(:placeholder-shown) {
    border-bottom-color: var(--error-color);
  }
  
  /* Buttons */
  .btn-next {
    margin-left: calc(1.5rem + 16px);
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
  }
  
  .btn-next svg {
    margin-left: 8px;
  }
  
  .btn-next:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  }
  
  .btn-next .hint {
    margin-left: 16px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
  }
  
  .btn-next .hint strong {
    font-weight: 600;
  }
  
  /* ==========================================================================
     Option Grid (Radio equivalent)
     ========================================================================== */
  .options-grid {
    margin-left: calc(1.5rem + 16px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
  }
  
  .option-btn {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
  }
  
  .option-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 16px;
    transition: all 0.2s ease;
  }
  
  .option-btn:hover {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
  }
  
  .option-btn:hover .option-key {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
  }
  
  /* ==========================================================================
     State Panels (Loading, Success, Errors)
     ========================================================================== */
  .state-panel {
    text-align: center;
    margin: auto 0;
  }
  
  .state-panel h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
  }
  
  .state-panel p {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.6;
  }
  
  .success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    margin-bottom: 24px;
  }
  
  .loading-spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(79, 70, 229, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 24px;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  .error-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-left: 4px solid var(--error-color);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    z-index: 1000;
    animation: slideUpFade 0.3s ease forwards;
  }
  
  /* ==========================================================================
     Footer / SDK Slot
     ========================================================================== */
  #wbx-powered-by-slot {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    width: 100%;
  }
  
  /* ==========================================================================
     Responsive Adjustments
     ========================================================================== */
  @media (max-width: 600px) {
    .step-container h2 {
      font-size: 1.75rem;
    }
    
    .question-subtext,
    .input-wrapper,
    .btn-next,
    .options-grid {
      margin-left: 0;
    }
    
    .step-number {
      font-size: 1.25rem;
      margin-right: 12px;
    }
    
    input[type="text"],
    input[type="email"] {
      font-size: 1.5rem;
    }
    
    .btn-next .hint {
      display: none; /* Hide 'Press Enter' hint on mobile */
    }
  }