/* Explore55Plus Quiz Styles */
:root {
  --navy: #04004D;
  --purple: #9D98EC;
  --purple-light: #F6F7FF;
  --purple-border: #D5D3E5;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg: #FAFAFA;
  --white: #fff;
  --green: #2ECC71;
  --red: #E74C3C;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.quiz-container {
  max-width: 680px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(4, 0, 77, 0.06);
}

/* Header */
.quiz-header {
  background: var(--navy);
  padding: 16px 32px;
  border-bottom: 3px solid var(--purple);
}

.logo {
  font-family: 'Asap', sans-serif;
  font-weight: 700;
  font-size: 18pt;
  color: var(--white);
}

.logo .accent {
  color: var(--purple);
}

.header-logo {
  width: 112px;
  display: block;
}

/* Progress */
.progress-bar {
  height: 4px;
  background: #E8E7F0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--navy), var(--purple));
  transition: width 0.4s ease;
}

.progress-text {
  font-family: 'Asap', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 32px;
}

/* Steps */
.step {
  display: none;
  padding: 24px 32px 40px;
  animation: fadeIn 0.3s ease;
}

.step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  font-family: 'Asap', sans-serif;
  font-weight: 700;
  font-size: 24pt;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 28px;
}

/* Question groups */
.question-group {
  margin-bottom: 24px;
}

.question-label {
  display: block;
  font-family: 'Asap', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 8px;
}

.req {
  color: var(--purple);
}

.helper-text {
  font-size: 12px;
  color: var(--text-muted);
  margin: -4px 0 8px;
}

/* Radio cards */
.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 1.5px solid #E8E7F0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.radio-card:hover {
  border-color: var(--purple);
  background: var(--purple-light);
}

.radio-card input {
  margin-right: 12px;
  accent-color: var(--purple);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.radio-card input:checked + span {
  color: var(--navy);
  font-weight: 500;
}

.radio-card:has(input:checked) {
  border-color: var(--purple);
  background: var(--purple-light);
}

/* Checkbox grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.checkbox-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1.5px solid #E8E7F0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.checkbox-item:hover {
  border-color: var(--purple);
  background: var(--purple-light);
}

.checkbox-item input {
  margin-right: 8px;
  accent-color: var(--purple);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.checkbox-item:has(input:checked) {
  border-color: var(--purple);
  background: var(--purple-light);
}

/* Pill selectors */
.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 8px 16px;
  border: 1.5px solid #E8E7F0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.pill:hover {
  border-color: var(--purple);
}

.pill input {
  display: none;
}

.pill:has(input:checked) {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E8E7F0;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s;
  background: var(--white);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(157, 152, 236, 0.15);
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Multi-select dropdown */
.multi-select-wrapper {
  position: relative;
  border: 1.5px solid #E8E7F0;
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--white);
  cursor: text;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 46px;
  transition: border-color 0.2s;
}

.multi-select-wrapper:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(157, 152, 236, 0.15);
}

.multi-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.multi-select-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--purple-light);
  border: 1px solid var(--purple-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
}

.multi-select-tag .remove-tag {
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1;
  margin-left: 2px;
}

.multi-select-tag .remove-tag:hover {
  color: var(--red);
}

.multi-select-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 4px !important;
  font-size: 14px;
  flex: 1;
  min-width: 120px;
  background: transparent;
}

.multi-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  background: var(--white);
  border: 1.5px solid var(--purple);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(4, 0, 77, 0.1);
}

.multi-select-dropdown.open {
  display: block;
}

.multi-select-option {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.1s;
}

.multi-select-option:hover,
.multi-select-option.highlighted {
  background: var(--purple-light);
  color: var(--navy);
}

.multi-select-option.selected {
  color: var(--purple);
  font-weight: 500;
}

.multi-select-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Inline groups */
.inline-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.inline-group > .question-group {
  flex: 1;
  min-width: 180px;
}

/* Contact form */
.contact-form {
  background: var(--purple-light);
  border: 1px solid var(--purple-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.trust-text {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Navigation buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #F0F0EE;
}

.btn {
  font-family: 'Asap', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-next, .btn-submit {
  background: var(--navy);
  color: var(--white);
}

.btn-next:hover, .btn-submit:hover {
  background: #06006B;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(4, 0, 77, 0.2);
}

.btn-back {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #E8E7F0;
}

.btn-back:hover {
  color: var(--navy);
  border-color: var(--purple-border);
}

.btn-submit {
  background: linear-gradient(135deg, var(--navy), #1a1080);
  font-size: 16px;
  padding: 14px 36px;
}

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

/* Loading state */
.btn-submit.loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.btn-submit.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Validation */
.field-error {
  border-color: var(--red) !important;
}

.error-msg {
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
}

.loading-text {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* Matching Animation Screen */
.matching-screen {
  text-align: center;
  padding: 60px 20px;
}

.matching-icon {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

.matching-emoji {
  font-size: 48px;
  position: relative;
  z-index: 1;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  animation: pulse 1.5s ease-out infinite;
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

.matching-counter {
  margin: 20px 0 8px;
}

.counter-number {
  font-family: 'Asap', sans-serif;
  font-weight: 700;
  font-size: 42px;
  color: var(--navy);
  display: block;
  line-height: 1.1;
  transition: color 0.3s;
}

.counter-number.final {
  color: var(--purple);
}

.counter-label {
  font-size: 13px;
  color: var(--text-muted);
}

.matching-progress {
  width: 280px;
  height: 6px;
  background: #E8E7F0;
  border-radius: 3px;
  margin: 24px auto 16px;
  overflow: hidden;
}

.matching-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--navy), var(--purple));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.matching-status {
  font-size: 13px;
  color: var(--text-muted);
  min-height: 20px;
}

/* Match Banner */
.match-banner {
  text-align: center;
  margin-bottom: 24px;
}

.match-count {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

/* Guide Preview Card */
.guide-preview {
  margin-bottom: 24px;
}

.guide-preview-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--purple-light), #EEEDFA);
  border: 1px solid var(--purple-border);
  border-radius: 12px;
  padding: 20px;
}

.guide-preview-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.guide-preview-inner strong {
  font-family: 'Asap', sans-serif;
  color: var(--navy);
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.guide-preview-inner p {
  font-size: 12px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.4;
}

/* Mail option */
.mail-option {
  border: none !important;
  padding: 4px 0 !important;
  font-weight: 500;
}

.mail-option:hover {
  background: none !important;
}

/* Thank You Page */
.thank-you {
  padding: 48px 32px;
  text-align: center;
}

.thank-you-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.thank-you h1 {
  margin-bottom: 12px;
}

.thank-you .subtitle {
  max-width: 480px;
  margin: 0 auto 32px;
  font-size: 15px;
}

.info-card {
  background: var(--purple-light);
  border: 1px solid var(--purple-border);
  border-radius: 12px;
  padding: 24px 28px;
  text-align: left;
  max-width: 480px;
  margin: 0 auto 24px;
}

.info-card h3 {
  font-family: 'Asap', sans-serif;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  font-size: 14px;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card li {
  padding: 6px 0 6px 24px;
  position: relative;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.info-card li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.closing-text {
  font-size: 14px;
  color: var(--text-muted);
}

.closing-text a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}

.closing-text a:hover {
  color: var(--purple);
}

/* Responsive */
@media (max-width: 600px) {
  .step, .thank-you {
    padding: 20px 20px 32px;
  }

  .progress-text {
    padding: 8px 20px;
  }

  .quiz-header {
    padding: 14px 20px;
  }

  h1 {
    font-size: 20pt;
  }

  .checkbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .inline-group {
    flex-direction: column;
    gap: 0;
  }

  .contact-form {
    padding: 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .btn-submit {
    padding: 12px 24px;
    font-size: 14px;
  }

  .price-slider-wrapper {
    padding: 0 4px;
  }
}

/* State checkbox icon in dropdown */
.state-checkbox {
  margin-right: 8px;
  font-size: 16px;
  vertical-align: middle;
  color: var(--purple-border);
}

.multi-select-option.selected .state-checkbox {
  color: var(--purple);
}

/* Price slider */
.price-slider-wrapper {
  padding: 8px 0;
}

.price-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--purple), var(--navy));
  outline: none;
  cursor: pointer;
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--navy);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(4, 0, 77, 0.2);
  transition: transform 0.15s;
}

.price-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.price-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--navy);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(4, 0, 77, 0.2);
}

.price-slider-label {
  text-align: center;
  margin-top: 10px;
  font-family: 'Asap', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
}

/* Amenity ranking buckets */
.amenity-buckets {
  margin-top: 20px;
  padding: 16px;
  background: var(--purple-light);
  border: 1.5px solid var(--purple-border);
  border-radius: 10px;
}

.bucket-helper {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.45;
}

.bucket-helper strong {
  color: var(--navy);
}

.bucket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bucket {
  background: var(--white);
  border: 1.5px solid var(--purple-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bucket-must {
  border-color: var(--purple);
}

.bucket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--navy);
  color: var(--white);
}

.bucket-nice .bucket-header {
  background: #6F6BB0;
}

.bucket-title {
  font-family: 'Asap', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.bucket-count {
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}

.bucket-chips {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
  flex: 1;
}

.bucket-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin: auto 0;
  padding: 8px 4px;
  line-height: 1.4;
}

.bucket-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 4px 6px 10px;
  background: var(--purple-light);
  border: 1px solid var(--purple-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--navy);
  animation: chip-in 0.18s ease-out;
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bucket-chip-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bucket-chip-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.bucket-chip-btn {
  border: none;
  background: transparent;
  color: var(--navy);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.bucket-chip-btn:hover {
  background: var(--purple);
  color: var(--white);
}

.bucket-chip-btn.remove {
  color: var(--text-muted);
  font-size: 16px;
}

.bucket-chip-btn.remove:hover {
  background: var(--red);
  color: var(--white);
}

@media (max-width: 600px) {
  .bucket-grid {
    grid-template-columns: 1fr;
  }
}
