/* ═══════════════════════════════════════════════
   Vayo Companion Tools — companion-tools.css
   Uses site CSS tokens from styles.css
   ═══════════════════════════════════════════════ */

/* Section heading */
.ct-heading {
  margin-bottom: 8px;
}

.ct-heading-kicker {
  font-size: 0.74rem;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 10px;
}

.ct-heading h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 12px;
}

.ct-heading-subtitle {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 640px;
  margin: 0 0 10px;
}

.ct-privacy-note {
  font-size: 0.82rem;
  color: var(--muted-2);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 0 36px;
  padding: 10px 14px;
  background: rgba(52, 95, 84, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(52, 95, 84, 0.1);
}

/* ── Layout ── */

.ct-wrapper {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

.ct-tools-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.ct-wizard-col {
  min-height: 320px;
}

.ct-wizard-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--muted-2);
  font-size: 0.92rem;
  text-align: center;
  background: rgba(255,255,255,0.5);
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  padding: 40px 24px;
}

/* ── Tool cards ── */

.ct-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: box-shadow 0.18s, border-color 0.18s, background 0.18s;
  text-align: left;
  width: 100%;
  appearance: none;
  font: inherit;
  color: var(--ink);
}

.ct-card:hover {
  box-shadow: 0 4px 18px rgba(22, 35, 32, 0.08);
  border-color: var(--line-strong);
}

.ct-card.ct-active {
  background: var(--green-soft);
  border-color: rgba(52, 95, 84, 0.3);
  box-shadow: 0 4px 18px rgba(52, 95, 84, 0.12);
}

.ct-card-name {
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--ink);
}

.ct-card.ct-active .ct-card-name {
  color: var(--green-dark);
}

.ct-card-subtitle {
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 8px;
}

.ct-card-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted-2);
  background: rgba(24, 33, 31, 0.05);
  border-radius: 999px;
  padding: 3px 9px;
}

.ct-card.ct-active .ct-card-badge {
  background: rgba(52, 95, 84, 0.12);
  color: var(--green-dark);
}

/* Back button (mobile only) */
.ct-back-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.16s;
}

.ct-back-btn:hover {
  background: var(--bg);
  color: var(--ink);
}

/* ── Wizard ── */

.ct-wizard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 28px 24px;
}

.ct-wizard-header {
  margin-bottom: 20px;
}

.ct-progress {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ct-progress-bar {
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  margin-bottom: 16px;
  overflow: hidden;
}

.ct-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ct-step-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}

.ct-disclaimer {
  margin: 12px 0 20px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 0.84rem;
  color: #92400e;
  line-height: 1.55;
}

/* ── Fields ── */

.ct-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.ct-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ct-field label,
.ct-field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.ct-field-hint {
  font-size: 0.8rem;
  color: var(--muted-2);
  margin-top: 2px;
  line-height: 1.5;
}

.ct-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-input-suffix {
  font-size: 0.88rem;
  color: var(--muted-2);
  white-space: nowrap;
}

.ct-field input[type="number"],
.ct-field input[type="text"],
.ct-field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft, #fbfaf6);
  border-radius: 12px;
  padding: 10px 13px;
  font: inherit;
  font-size: 0.93rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  -moz-appearance: textfield;
}

.ct-field input[type="number"]::-webkit-inner-spin-button,
.ct-field input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.6;
}

.ct-field input:focus,
.ct-field select:focus {
  border-color: rgba(52, 95, 84, 0.5);
  box-shadow: 0 0 0 3px rgba(52, 95, 84, 0.1);
}

.ct-field select {
  appearance: auto;
  cursor: pointer;
}

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

.ct-radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
  font-size: 0.9rem;
  color: var(--ink);
  user-select: none;
}

.ct-radio-option:hover {
  background: var(--bg);
  border-color: var(--line-strong);
}

.ct-radio-option input[type="radio"] {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.ct-radio-option.ct-selected {
  background: var(--green-soft);
  border-color: rgba(52, 95, 84, 0.3);
}

/* Checkbox group */
.ct-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ct-checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
  font-size: 0.9rem;
  color: var(--ink);
  user-select: none;
}

.ct-checkbox-option:hover {
  background: var(--bg);
  border-color: var(--line-strong);
}

.ct-checkbox-option input[type="checkbox"] {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.ct-checkbox-option.ct-selected {
  background: var(--green-soft);
  border-color: rgba(52, 95, 84, 0.3);
}

/* Validation error */
.ct-field-error {
  font-size: 0.8rem;
  color: #b42318;
  margin-top: 2px;
}

/* ── Navigation buttons ── */

.ct-btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ct-btn {
  appearance: none;
  border-radius: 999px;
  padding: 10px 20px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition: opacity 0.18s, background 0.18s;
  white-space: nowrap;
  border: none;
}

.ct-btn-primary {
  background: linear-gradient(180deg, #5f9d79, #4e8f6e);
  color: #f7fbf8;
  box-shadow: 0 4px 14px rgba(78, 143, 110, 0.2);
}

.ct-btn-primary:hover { opacity: 0.88; }

.ct-btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.ct-btn-secondary:hover {
  background: var(--bg);
  color: var(--ink);
}

.ct-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Outdoor context component ── */

.ct-outdoor-box {
  background: rgba(52, 95, 84, 0.04);
  border: 1px solid rgba(52, 95, 84, 0.15);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}

.ct-outdoor-box-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.ct-outdoor-box-body {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.55;
}

.ct-outdoor-location-note {
  font-size: 0.79rem;
  color: var(--muted-2);
  margin-top: 8px;
  line-height: 1.5;
}

.ct-outdoor-loading {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 10px 0;
  font-style: italic;
}

.ct-outdoor-success {
  background: var(--green-soft);
  border: 1px solid rgba(52, 95, 84, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
}

.ct-outdoor-success-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-dark);
  margin: 0 0 4px;
}

.ct-outdoor-success-meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.ct-outdoor-note-text {
  font-size: 0.79rem;
  color: var(--muted-2);
  font-style: italic;
  margin-top: 6px;
}

.ct-outdoor-manual {
  margin-top: 14px;
}

.ct-outdoor-manual-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}

.ct-outdoor-skip {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ct-outdoor-skipped {
  background: rgba(24, 33, 31, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
}

.ct-aqi-hint {
  font-size: 0.78rem;
  color: var(--muted-2);
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(24, 33, 31, 0.03);
  border-radius: 8px;
  line-height: 1.6;
}

/* ── Result card ── */

.ct-result {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ct-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ct-result-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.ct-badge-low,
.ct-badge-suitable,
.ct-badge-helping {
  background: var(--green-soft);
  color: var(--green-dark);
}

.ct-badge-medium,
.ct-badge-borderline,
.ct-badge-maybe,
.ct-badge-possible {
  background: #fef9c3;
  color: #854d0e;
}

.ct-badge-high,
.ct-badge-undersized,
.ct-badge-likely,
.ct-badge-indoor,
.ct-badge-outdoor,
.ct-badge-info {
  background: #fee2e2;
  color: #991b1b;
}

.ct-badge-none {
  background: rgba(24, 33, 31, 0.07);
  color: var(--muted);
}

.ct-result-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ct-result-section {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.ct-result-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  margin: 0 0 6px;
}

.ct-result-section p {
  font-size: 0.93rem;
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
}

.ct-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 4px;
}

.ct-save-status {
  font-size: 0.82rem;
  color: var(--muted-2);
  margin-top: 8px;
  min-height: 1.2em;
}

.ct-save-status.saving { color: var(--muted-2); }
.ct-save-status.saved { color: #24724f; }
.ct-save-status.error { color: #b42318; }

.ct-try-next-block {
  padding: 14px 16px;
  background: var(--green-soft);
  border-radius: 12px;
  border: 1px solid rgba(52, 95, 84, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ct-try-next-label {
  font-size: 0.82rem;
  color: var(--green-dark);
  font-weight: 600;
}

.ct-try-next-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--green-dark);
}

/* Contact form inside result */
.ct-contact-form {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 8px;
}

.ct-contact-form-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}

.ct-contact-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* ── Responsive ── */

@media (max-width: 820px) {
  .ct-wrapper {
    grid-template-columns: 260px 1fr;
  }
}

@media (max-width: 680px) {
  .ct-wrapper {
    grid-template-columns: 1fr;
  }

  .ct-tools-col {
    position: static;
  }

  .ct-tools-col.ct-hidden {
    display: none;
  }

  .ct-wizard-col.ct-hidden {
    display: none;
  }

  .ct-back-btn {
    display: flex;
  }

  .ct-wizard {
    padding: 20px 16px 18px;
  }
}
