/* =========================================================
   Omniwise AI Assessment — Wizard Styles v2
   Premium redesign: progress system, answer cards, navigation
   ========================================================= */

/* =========================================================
   Page shell
   ========================================================= */
.wizard-page {
  min-height: 100vh;
  background: var(--color-gray-50);
  display: flex;
  flex-direction: column;
}

/* =========================================================
   Premium Progress Bar
   ========================================================= */
.wiz-progress {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  padding: 0 24px;
  position: sticky;
  top: 64px;    /* sits below fixed navbar */
  z-index: 90;
}

.wiz-progress__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 0;
}

.wiz-progress__inner--simple {
  padding: 0;
}

/* Meta row: dimension name left, counter right */
.wiz-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.wiz-progress__dim-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-teal);
}

.wiz-progress__counter {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-gray-600);
}

/* Bar */
.wiz-progress__bar-wrap {
  height: 6px;
  background: var(--color-gray-200);
  border-radius: 3px;
  position: relative;
  margin-bottom: 12px;
}

.wiz-progress__bar {
  height: 100%;
  background: var(--color-teal);
  border-radius: 3px;
  transition: width 300ms ease;
}

.progress-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--color-white);
  border: 1.5px solid var(--color-gray-200);
  border-radius: 1px;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
}

.progress-marker.passed {
  border-color: var(--color-teal);
}

/* Dimension dots */
.wiz-progress__dots {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.wiz-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.wiz-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-gray-300);
  flex-shrink: 0;
  transition: background 200ms, transform 200ms;
}

.wiz-dot-wrap.is-done .wiz-dot {
  background: var(--color-teal);
}

.wiz-dot-wrap.is-current .wiz-dot {
  background: var(--color-navy);
  transform: scale(1.25);
  box-shadow: 0 0 0 3px rgba(10, 34, 64, 0.12);
}

.wiz-dot__label {
  font-size: 0.6875rem;
  color: var(--color-gray-400);
  text-align: center;
  line-height: 1.2;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiz-dot-wrap.is-done .wiz-dot__label,
.wiz-dot-wrap.is-current .wiz-dot__label {
  color: var(--color-navy);
  font-weight: 600;
}

/* =========================================================
   Wizard Main / Card
   ========================================================= */
.wizard-main {
  flex: 1;
  padding: 24px 16px 48px;
}

.wizard-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 40px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* Card header: dimension badge + sublabel */
.wizard-card__header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-gray-200);
}

.wizard-dim-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-teal-light);
  border: 1px solid rgba(46, 175, 160, 0.3);
  color: var(--color-teal);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.wizard-card__sublabel {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin-bottom: 0;
  line-height: 1.5;
}

.wizard-card__desc {
  font-size: 0.9375rem;
  color: var(--color-gray-600);
  margin-bottom: 0;
}

/* =========================================================
   Question block
   ========================================================= */
.wizard-q--block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wizard-q__text {
  font-size: clamp(1.1rem, 2.5vw, 1.375rem);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.4;
  max-width: 680px;
  margin: 0;
}

/* =========================================================
   Answer option cards — Premium redesign
   ========================================================= */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-options--horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: var(--color-white);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  text-align: left;
  width: 100%;
  position: relative;
  outline: none;
}

/* Hide native radio visually but keep it accessible */
.answer-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.answer-option:hover {
  border-color: var(--color-teal);
  background: var(--color-teal-light);
  box-shadow: var(--shadow-sm);
}

.answer-option:focus-within {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

.answer-option.selected {
  border-color: var(--color-teal);
  background: var(--color-teal-light);
  box-shadow: 0 0 0 3px rgba(46, 175, 160, 0.15);
}

/* Level number badge */
.answer-level {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.answer-level__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-gray-100);
  color: var(--color-gray-600);
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 150ms, color 150ms;
  font-variant-numeric: tabular-nums;
}

.answer-option.selected .answer-level__num {
  background: var(--color-teal);
  color: var(--color-white);
}

.answer-level__text {
  font-size: 0.9375rem;
  color: var(--color-gray-800);
  line-height: 1.5;
  flex: 1;
}

/* Check indicator (right side) */
.answer-option::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-gray-300);
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
  transition: border-color 150ms, background 150ms;
  margin-left: auto;
}

.answer-option.selected::after {
  border-color: var(--color-teal);
  background: var(--color-teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E") center/13px no-repeat;
}

/* Mousedown scale */
.answer-option:active {
  transform: scale(0.997);
}

/* Checkbox variants (signals step) */
.answer-option--check {
  align-items: center;
}

/* Horizontal layout variants */
.answer-options--horizontal .answer-option {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 200px;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
}

.answer-options--horizontal .answer-option::after {
  display: none;
}

/* Grid checkboxes */
.answer-options--check.answer-options--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Form selects */
.form-select {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--color-gray-800);
  background: var(--color-white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
}

.form-select:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(46, 175, 160, 0.15);
}

/* Textarea */
.form-textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--color-gray-800);
  background: var(--color-white);
  resize: vertical;
  transition: border-color 150ms, box-shadow 150ms;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(46, 175, 160, 0.15);
}

/* =========================================================
   Wizard Question block layout
   ========================================================= */
.wizard-q {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wizard-q__num {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-q__sublabel {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  line-height: 1.5;
}

/* =========================================================
   Navigation
   ========================================================= */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-gray-200);
  gap: 12px;
}

.wizard-nav__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Continue button disabled state via class */
.btn--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* =========================================================
   Saving indicator
   ========================================================= */
.saving-indicator {
  font-size: 0.8125rem;
  color: var(--color-gray-400);
  display: none;
  margin-right: auto;
}

.saving-indicator.visible  { display: block; }
.saving-indicator--error   { color: var(--color-error); }

/* =========================================================
   Profile step
   ========================================================= */
.wizard-card--profile .wizard-q {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-gray-100);
}

.wizard-card--profile .wizard-q:last-of-type {
  border-bottom: none;
}

/* =========================================================
   Signals step
   ========================================================= */
.wizard-q--block[hidden] { display: none; }

/* =========================================================
   Spinner
   ========================================================= */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-gray-200);
  border-top-color: var(--color-teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto;
}

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

/* =========================================================
   OTP / Verify page
   ========================================================= */
.verify-page {
  min-height: 100vh;
  background: var(--color-gray-50);
  display: flex;
  flex-direction: column;
}

.verify-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.verify-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.verify-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.verify-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.verify-subtitle {
  font-size: 0.9375rem;
  color: var(--color-gray-600);
  margin-bottom: 28px;
  line-height: 1.5;
}

.otp-input {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  width: 100%;
  max-width: 220px;
  margin: 0 auto 8px;
  padding: 14px;
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  transition: border-color 150ms;
  display: block;
}

.otp-input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(46, 175, 160, 0.15);
}

.verify-expiry {
  font-size: 0.8125rem;
  color: var(--color-gray-400);
  margin-bottom: 20px;
}

.verify-resend {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--color-gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-teal);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* =========================================================
   Responsive — BUG 3 FIX: no horizontal overflow at 375px
   ========================================================= */
@media (max-width: 767px) {
  /* Dots: hide labels on narrow screens */
  .wiz-dot__label {
    display: none;
  }

  .wiz-progress__inner {
    padding: 10px 0;
  }
}

@media (max-width: 600px) {
  .wizard-card {
    padding: 24px 20px;
    margin: 0;
    border-radius: var(--radius-md);
  }

  .wizard-main {
    padding: 16px 12px 40px;
    overflow-x: hidden;
  }

  .wizard-q__text {
    font-size: 1.0625rem;
  }

  .answer-option {
    padding: 14px 16px;
  }

  .answer-level__text {
    font-size: 0.875rem;
  }

  /* Continue full-width on mobile */
  .wizard-nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .wizard-nav__right {
    width: 100%;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .wizard-nav__right .btn--primary,
  .wizard-nav__right .btn--lg {
    width: 100%;
    justify-content: center;
  }

  /* Horizontal answer options: wrap to 2 col */
  .answer-options--horizontal {
    flex-wrap: wrap;
  }

  .answer-options--horizontal .answer-option {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  /* Grid check options: single col */
  .answer-options--check.answer-options--grid {
    grid-template-columns: 1fr;
  }

  /* Verify card */
  .verify-card {
    padding: 32px 24px;
  }
}

@media (max-width: 400px) {
  .wiz-progress {
    padding: 0 12px;
  }

  .wizard-main {
    padding: 12px 8px 32px;
  }

  .wizard-card {
    padding: 20px 16px;
  }
}

/* =========================================================
   Country Search Dropdown — BUG 1
   ========================================================= */
.cs-wrap {
  position: relative;
  width: 100%;
}

.cs-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: 1rem;
  color: var(--color-gray-800);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms, box-shadow 150ms;
}

.cs-trigger:hover,
.cs-trigger:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(46, 175, 160, 0.15);
  outline: none;
}

.cs-trigger[aria-expanded="true"] {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(46, 175, 160, 0.15);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.cs-flag {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  min-width: 24px;
}

.cs-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-name--placeholder {
  color: var(--color-gray-400);
}

.cs-chevron {
  flex-shrink: 0;
  color: var(--color-gray-400);
  transition: transform 200ms;
}

.cs-trigger[aria-expanded="true"] .cs-chevron {
  transform: rotate(180deg);
}

.cs-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-white);
  border: 1.5px solid var(--color-teal);
  border-top: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 200;
  overflow: hidden;
}

.cs-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-gray-100);
}

.cs-search-row svg {
  flex-shrink: 0;
  color: var(--color-gray-400);
}

.cs-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9375rem;
  color: var(--color-gray-800);
  background: transparent;
}

/* Override .form-group input[type="text"] from main.css (higher specificity needed) */
.cs-panel .cs-search-row input.cs-search-input {
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
  width: 100%;
  display: block;
  font-size: 0.9375rem;
  color: var(--color-gray-800);
}

.cs-panel .cs-search-row input.cs-search-input:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

.cs-search-input::placeholder {
  color: var(--color-gray-400);
}

.cs-list {
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cs-group-hdr {
  padding: 6px 12px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gray-400);
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-100);
  position: sticky;
  top: 0;
}

.cs-group-hdr:first-child {
  border-top: none;
}

.cs-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 100ms;
  font-size: 0.9375rem;
  color: var(--color-gray-800);
}

.cs-opt:hover,
.cs-opt--focused {
  background: var(--color-teal-light);
}

.cs-opt--selected {
  background: var(--color-teal-light);
  font-weight: 600;
  color: var(--color-teal);
}

.cs-opt--pinned {
  font-weight: 600;
}

.cs-opt__flag {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  min-width: 22px;
}

.cs-opt__name {
  flex: 1;
}

.cs-empty {
  padding: 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-gray-400);
}

/* Text input for non-CA/US countries (A2 field) */
.form-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--color-gray-800);
  background: var(--color-white);
  transition: border-color 150ms, box-shadow 150ms;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(46, 175, 160, 0.15);
}

.form-input::placeholder {
  color: var(--color-gray-400);
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .wiz-progress__bar,
  .answer-option,
  .wiz-dot,
  .btn {
    transition: none !important;
  }
}
