    :root {
      /* Light Mode (Default) */
      --primary: #735274;  /* plum */
      --accent: #ffffff;   /* cream */
      --success: #40916c;
      --danger: #d00000;
      --warning: #f9c74f;
      --bg-primary: #ffffff;
      --bg-secondary: #ffffff;
      --text-primary: #3b2c3d;
      --text-secondary: #666;
      --border-color: #eee;
      --shadow-color: rgba(115, 82, 116, 0.2);
    }

    [data-theme="dark"] {
      /* Dark Mode */
      --primary: #735274;  /* keep plum */
      --accent: #f4f4f4;   /* light gray text */
      --success: #40916c;
      --danger: #b00020;
      --warning: #f9c74f;
      --bg-primary: #1c1c1c;
      --bg-secondary: #2a2a2a;
      --text-primary: #f4f4f4;
      --text-secondary: #b0b0b0;
      --border-color: #404040;
      --shadow-color: rgba(0, 0, 0, 0.3);
    }

    * {
      transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, border-color 0.3s ease-in-out;
    }

    body {
      font-family: 'Inter', sans-serif;
      background-color: transparent;
      color: var(--text-primary);
      margin: 0;
      padding: 0;
    }


    .container {
      max-width: 720px;
      margin: 40px auto;
      padding: 0 20px;
    }

    .content-header {
      margin-bottom: 30px;
      text-align: center;
    }

    .content-header h1 {
      color: var(--primary);
      margin: 0 0 10px 0;
      font-weight: 600;
      font-size: 2rem;
    }

    .breadcrumb {
      margin-bottom: 30px;
    }

    .breadcrumb a {
      color: var(--primary);
      text-decoration: none;
      font-weight: 500;
    }

    .breadcrumb a:hover {
      text-decoration: underline;
    }

    .form-container {
      background: var(--bg-secondary);
      padding: 40px;
      border-radius: 12px;
      box-shadow: 0 6px 24px var(--shadow-color);
    }

    /* Wizard Progress Bar */
    .wizard-progress {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 40px;
      padding: 0 20px;
    }

    .progress-step {
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      flex: 1;
    }

    .progress-step:not(:last-child)::after {
      content: '';
      position: absolute;
      top: 20px;
      left: calc(50% + 20px);
      width: calc(100% - 40px);
      height: 2px;
      background: var(--border-color);
      z-index: 1;
    }

    .progress-step.completed::after {
      background: var(--primary);
    }

    .step-circle {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--border-color);
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      font-size: 14px;
      z-index: 2;
      position: relative;
      transition: all 0.3s ease;
    }

    .progress-step.active .step-circle {
      background: var(--primary);
      color: white;
    }

    .progress-step.completed .step-circle {
      background: var(--success);
      color: white;
    }

    .step-label {
      margin-top: 8px;
      font-size: 12px;
      text-align: center;
      color: var(--text-secondary);
      font-weight: 500;
    }

    .progress-step.active .step-label {
      color: var(--primary);
      font-weight: 600;
    }

    /* Wizard Steps */
    .wizard-step {
      display: none;
    }

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

    .step-header {
      margin-bottom: 30px;
      text-align: center;
    }

    .step-title {
      font-size: 1.8rem;
      font-weight: 600;
      color: var(--primary);
      margin-bottom: 10px;
    }

    .step-description {
      color: var(--text-secondary);
      font-size: 1rem;
      line-height: 1.5;
    }

    /* Wizard Navigation */
    .wizard-navigation {
      display: flex;
      justify-content: space-between;
      margin-top: 40px;
      padding-top: 20px;
      border-top: 1px solid var(--border-color);
    }

    .btn-wizard {
      background-color: var(--primary);
      color: white;
      border: none;
      padding: 12px 24px;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 600;
      font-size: 1rem;
      font-family: inherit;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .btn-wizard:hover:not(:disabled) {
      background-color: #5e425d;
      transform: translateY(-1px);
    }

    .btn-wizard:disabled {
      background-color: #c0c0c0;
      color: #666;
      cursor: not-allowed;
      transform: none;
    }

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

    .btn-wizard.secondary:hover:not(:disabled) {
      background-color: var(--bg-primary);
      color: var(--primary);
      border-color: var(--primary);
    }

    /* Tooltips */
    .field-with-tooltip {
      position: relative;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .tooltip-icon {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: var(--primary);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 600;
      cursor: help;
      position: relative;
    }

    .tooltip-content {
      position: absolute;
      bottom: 125%;
      left: 50%;
      transform: translateX(-50%);
      background: var(--text-primary);
      color: var(--bg-secondary);
      padding: 10px 14px;
      border-radius: 6px;
      font-size: 13px;
      line-height: 1.4;
      white-space: normal;
      max-width: 400px;
      min-width: 200px;
      z-index: 10000;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      pointer-events: none;
    }

    .tooltip-content::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border: 5px solid transparent;
      border-top-color: var(--text-primary);
    }

    .tooltip-icon:hover .tooltip-content {
      opacity: 1;
      visibility: visible;
    }

    /* Required Field Indicators */
    .required-field {
      color: var(--danger);
      margin-left: 4px;
    }

    /* Step Cards */
    .step-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 25px;
      margin-bottom: 20px;
    }

    .card-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border-color);
    }

    .card-icon {
      font-size: 1.5rem;
    }

    .card-title {
      font-size: 1.2rem;
      font-weight: 600;
      color: var(--primary);
      margin: 0;
    }

    /* Collapsible Steps for Power Users */
    .step-header.collapsible {
      cursor: pointer;
      user-select: none;
      transition: all 0.2s;
    }

    .step-header.collapsible:hover {
      background: var(--bg-primary);
      padding: 10px;
      margin: -10px;
      border-radius: 6px;
    }

    .collapse-indicator {
      display: inline-block;
      transition: transform 0.2s;
      margin-left: 8px;
      font-size: 0.8rem;
      color: var(--text-secondary);
    }

    .step-content.collapsed {
      display: none !important;
    }

    .step-header.collapsed .collapse-indicator {
      transform: rotate(-90deg);
    }

    .form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      margin-bottom: 20px;
    }

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

    .form-group.full-width {
      grid-column: 1 / -1;
    }

    label {
      font-weight: 600;
      margin-bottom: 8px;
      color: var(--primary);
    }

    input, select {
      padding: 12px;
      border: 1px solid #ddd;
      border-radius: 6px;
      font-family: inherit;
      font-size: 1rem;
      width: 100%;
      box-sizing: border-box;
    }

    input:focus, select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(115, 82, 116, 0.2);
    }

    .btn {
      background-color: var(--primary);
      color: var(--accent);
      border: none;
      padding: 15px 30px;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 600;
      font-size: 1rem;
      font-family: inherit;
      transition: background-color 0.2s;
    }

    .btn:hover {
      background-color: #5e425d;
    }

    @media (max-width: 768px) {
      .container {
        margin: 16px auto;
        padding: 0 12px;
      }

      .content-header h1 {
        font-size: 1.4rem;
      }

      .form-container {
        padding: 20px 16px;
      }

      .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
      }

      .wizard-progress {
        padding: 0 4px;
        margin-bottom: 24px;
        gap: 4px;
      }

      .step-circle {
        width: 32px;
        height: 32px;
        font-size: 12px;
      }

      .step-label {
        font-size: 10px;
        margin-top: 4px;
      }

      .progress-step:not(:last-child)::after {
        top: 16px;
        left: calc(50% + 16px);
        width: calc(100% - 32px);
      }

      .step-title {
        font-size: 1.3rem;
      }

      .step-description {
        font-size: 0.9rem;
      }

      .wizard-navigation {
        margin-top: 24px;
        gap: 12px;
      }

      .btn-wizard {
        padding: 10px 18px;
        font-size: 0.9rem;
      }

      .thank-you-container {
        padding: 30px 20px;
      }

      .thank-you-container h1 {
        font-size: 24px;
      }

      .thank-you-container .message {
        font-size: 15px;
      }

      .success-icon {
        font-size: 60px;
      }
    }

    @media (max-width: 480px) {
      .step-label {
        display: none;
      }

      .wizard-progress {
        padding: 0;
      }

      .form-container {
        padding: 16px 12px;
      }
    }

    /* Loading Spinner Styles */
    .spinner-overlay {
      position: fixed;
      top: 0; 
      left: 0;
      width: 100vw; 
      height: 100vh;
      background: rgba(255, 255, 255, 0.7);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      display: none;
    }

    .spinner {
      border: 8px solid #e6e6e6;
      border-top: 8px solid var(--primary); /* EZ Rates Plum */
      border-radius: 50%;
      width: 60px;
      height: 60px;
      animation: spin 1s linear infinite;
    }

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

    /* Thank You Section Styles */
    #thank-you-section {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 40px 20px;
      min-height: auto;
    }

    .thank-you-container {
      background: var(--bg-secondary);
      border-radius: 16px;
      padding: 60px 40px;
      max-width: 600px;
      width: 100%;
      text-align: center;
      box-shadow: 0 20px 60px var(--shadow-color);
    }

    .success-icon {
      font-size: 80px;
      margin-bottom: 20px;
      animation: scaleIn 0.5s ease-out;
      color: var(--success);
    }

    @keyframes scaleIn {
      from {
        transform: scale(0);
      }
      to {
        transform: scale(1);
      }
    }

    .thank-you-container h1 {
      color: var(--primary);
      font-size: 32px;
      margin-bottom: 20px;
      font-weight: 600;
    }

    .thank-you-container .message {
      color: var(--text-secondary);
      font-size: 18px;
      line-height: 1.6;
      margin-bottom: 30px;
    }
    
    /* Section Headers */
    .section-header {
      grid-column: 1 / -1;
      font-size: 1.2rem;
      font-weight: 600;
      color: var(--primary);
      margin: 20px 0 10px 0;
      padding-bottom: 8px;
      border-bottom: 2px solid var(--primary);
    }
    
    /* Conditional Fields */
    .loan-type-fields {
      grid-column: 1 / -1;
      display: none;
    }
    
    .loan-type-fields.show {
      display: block;
    }
    
    .loan-type-fields .form-group {
      margin: 15px 0;
    }
    
    /* Checkbox styling */
    .form-group input[type="checkbox"] {
      width: auto;
      margin-right: 8px;
    }
    
    .checkbox-label {
      font-size: 0.9rem;
      color: var(--text-secondary);
    }

    /* ===== EMBED MODE STYLES ===== */
    body.embed-mode {
      background: transparent !important;
      margin: 0;
      padding: 0;
      min-height: auto;
    }

    body.embed-mode .container {
      max-width: 800px;
      margin: 0 auto;
      padding: 10px 20px;
    }

    body.embed-mode .branded-header {
      padding: 10px 0;
      margin-bottom: 5px;
    }

    body.embed-mode .content-header {
      padding: 15px 0 10px 0;
    }

    body.embed-mode .form-container {
      box-shadow: none;
      border: none;
      border-radius: 0;
    }

    body.embed-mode .powered-by {
      font-size: 0.7rem;
      margin-top: 10px;
      padding-top: 10px;
    }

    body.embed-mode #thank-you-section {
      min-height: auto !important;
    }

    body.embed-mode #thank-you-section .thank-you-container {
      padding: 30px 20px;
    }
