/* ============================================
   MIST 2026 Feedback Survey
   Matches main site design language (info hub)
   ============================================ */

:root {
  --orange: #FF8200;
  --orange-dark: #E67400;
  --orange-light: #fff3e6;
  --navy: #1a1a2e;
  --navy-light: #2a2a4a;
  --off-white: #f8f6f3;
  --white: #fff;
  --gray-100: #f3f3f3;
  --gray-200: #e5e5e5;
  --gray-400: #999;
  --gray-600: #666;
  --gray-800: #333;
  --success: #2d8a4e;
  --success-bg: #eaf7ef;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --error: #d94040;
  --error-bg: #fde8e8;
  --info: #4a90d9;
  --info-bg: #eef4fb;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.15);
  z-index: 200;
}
.progress-bar {
  height: 100%;
  background: var(--orange);
  width: 0%;
  transition: width .4s ease;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: 1.25rem;
  background: var(--navy);
}
.loading-logo {
  height: 48px;
  width: auto;
}
.spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  color: rgba(255,255,255,.6);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

/* ===== BREADCRUMB BAR ===== */
.breadcrumb-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 3px; /* below progress bar */
  z-index: 100;
}
.breadcrumb-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 16px 6px;
}
.bc-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}
.bc-step {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-400);
  padding: 6px 12px;
  flex-shrink: 0;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}
.bc-step.bc-done {
  color: var(--success);
  cursor: pointer;
  border: 1px solid var(--gray-200);
  background: var(--white);
}
.bc-step.bc-done:hover {
  background: var(--success-bg);
  border-color: var(--success);
}
.bc-step.bc-done:active {
  transform: scale(0.96);
}
.bc-step.bc-active {
  color: var(--orange);
  background: var(--orange-light);
  border: 1px solid var(--orange);
  padding: 6px 12px;
}
.bc-step.bc-future {
  opacity: 0.5;
}
.bc-sep {
  width: 12px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--gray-400);
  flex-shrink: 0;
  line-height: 1;
}
.bc-time {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--gray-400);
  padding: 2px 0 4px;
  text-align: right;
}

/* ===== LAYOUT ===== */
.survey-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ===== STEPS ===== */
.step { display: none; }
.step.active { display: block; animation: fadeIn .3s ease; }

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

/* ===== SITE HEADER (matches info hub) ===== */
.site-header {
  background: var(--navy);
  padding: 40px 0 48px;
  text-align: center;
  margin-bottom: 0;
}
.site-header img {
  height: 48px;
  margin-bottom: 16px;
}
.site-header h1 {
  color: var(--white);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.site-header .subtitle {
  color: var(--orange);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.site-header .sub-subtitle {
  color: rgba(255,255,255,.55);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .site-header { padding: 20px 0 24px; }
  .site-header img { height: 36px; margin-bottom: 10px; }
  .site-header h1 { font-size: 1.35rem; }
  .site-header .subtitle { font-size: 0.9rem; }
}

/* ===== STEP HEADER ===== */
.step-head {
  padding: 32px 0 24px;
}
.step-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-head h2 i { color: var(--orange); font-size: 1.4rem; }
.step-head p {
  color: var(--gray-600);
  font-size: 0.95rem;
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 24px;
  margin-bottom: 16px;
}
.card-intro {
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.6;
}
.card-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--gray-800);
}
.card-label.required::after {
  content: " *";
  color: var(--error);
  font-weight: 400;
}

/* ===== ROLE BUTTONS ===== */
.role-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.role-btn {
  padding: 14px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
.role-btn:hover {
  border-color: var(--orange);
  background: var(--orange-light);
}
.role-btn.active {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--white);
}

/* ===== NAME SEARCH ===== */
.search-wrap {
  position: relative;
}
.search-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--gray-800);
  outline: none;
  transition: border-color .2s;
  background: var(--white);
}
.search-input:focus {
  border-color: var(--orange);
}
.search-list {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.search-list.open { display: block; }
.search-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  transition: background .15s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.highlighted {
  background: var(--orange-light);
}
.search-item .grade-tag {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-left: 6px;
}

/* "Not listed" option in dropdown */
.search-item-custom {
  color: var(--orange);
  font-weight: 600;
  font-family: var(--font-display);
  border-top: 1px solid var(--gray-200);
}
.search-item-custom:hover {
  background: var(--orange-light);
}

/* Custom name entry */
.custom-name-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.custom-name-wrap .search-input {
  flex: 1;
  min-width: 160px;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  min-height: 40px;
}

.selected-name {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--success-bg);
  border-left: 4px solid var(--success);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.selected-name .clear-btn {
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 4px;
  opacity: .5;
  line-height: 1;
}
.selected-name .clear-btn:hover { opacity: 1; }

.alert-msg {
  margin-top: 12px;
  padding: 14px 18px;
  background: var(--warning-bg);
  border-left: 4px solid var(--warning);
  color: var(--gray-800);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ===== PILL SCALE (1-10 or 1-5) ===== */
.pill-scale {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pill {
  flex: 1;
  min-width: 38px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pill:hover {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--gray-800);
}
.pill.selected {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

/* NPS color coding */
.nps .pill.selected[data-value="1"],
.nps .pill.selected[data-value="2"],
.nps .pill.selected[data-value="3"],
.nps .pill.selected[data-value="4"],
.nps .pill.selected[data-value="5"],
.nps .pill.selected[data-value="6"] {
  background: var(--error);
  border-color: var(--error);
}
.nps .pill.selected[data-value="7"],
.nps .pill.selected[data-value="8"] {
  background: var(--warning);
  border-color: var(--warning);
}
.nps .pill.selected[data-value="9"],
.nps .pill.selected[data-value="10"] {
  background: var(--success);
  border-color: var(--success);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--gray-400);
}

.nps-card {
  border-left: 4px solid var(--orange);
}

/* ===== TEXT INPUTS ===== */
.text-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--gray-800);
  outline: none;
  transition: border-color .2s;
  background: var(--white);
  resize: none;
  overflow: hidden;
  min-height: 44px;
  line-height: 1.5;
  display: block;
}
.text-input:focus {
  border-color: var(--orange);
}
.text-input::placeholder {
  color: var(--gray-400);
}

/* ===== PROMPT CARD ===== */
.prompt-card {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
.prompt-row {
  margin-bottom: 14px;
}
.prompt-row:last-child { margin-bottom: 0; }
.prompt-starter {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--orange);
  margin-bottom: 6px;
}

/* ===== TRUST BADGE ===== */
.trust-badge {
  background: var(--info-bg);
  border-left: 4px solid var(--info);
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--gray-800);
  margin-top: 12px;
  line-height: 1.5;
}

/* ===== TAG SELECT ===== */
.tag-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-btn {
  padding: 8px 14px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.tag-btn:hover {
  border-color: var(--orange);
  background: var(--orange-light);
}
.tag-btn.active {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--white);
}
.tag-other-wrap {
  margin-top: 10px;
}
.tag-other-wrap .search-input {
  font-size: 16px;
}

/* ===== RETURN BUTTONS ===== */
.return-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.return-btn {
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.return-btn:hover {
  border-color: var(--orange);
  background: var(--orange-light);
}
.return-btn.active {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--white);
}

/* ===== COACH PHOTO ===== */
.coach-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.coach-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange-light);
  color: var(--orange);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

/* ===== REVIEW STEP ===== */
.review-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 20px;
  margin-bottom: 16px;
}
.review-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.review-edit-btn {
  background: none;
  border: 1px solid var(--orange);
  color: var(--orange);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 3px 10px;
  cursor: pointer;
  transition: all .15s;
}
.review-edit-btn:hover {
  background: var(--orange);
  color: var(--white);
}
.review-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-400);
}
.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}
.review-row:last-child { border-bottom: none; }
.review-row-text {
  flex-direction: column;
  align-items: stretch;
}
.review-label {
  font-size: 0.88rem;
  color: var(--gray-600);
  flex-shrink: 0;
}
.review-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
}
.review-rating {
  background: var(--orange-light);
  color: var(--orange);
  padding: 2px 10px;
  min-width: 28px;
  text-align: center;
}
.review-edit-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--gray-800);
  outline: none;
  margin-top: 4px;
  transition: border-color .2s;
}
.review-edit-input:focus { border-color: var(--orange); }
.review-edit-input::placeholder { color: var(--gray-400); }

/* ===== COACH CARDS ===== */
.coach-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 20px;
  margin-bottom: 12px;
  transition: opacity .2s;
}
.coach-card.skipped {
  opacity: .4;
}
.coach-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.coach-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  flex: 1;
}
.skip-btn {
  background: none;
  border: 1px solid var(--gray-200);
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--gray-400);
  cursor: pointer;
  transition: all .15s;
}
.skip-btn:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}
.skip-btn.active {
  background: var(--gray-100);
  color: var(--gray-600);
  border-color: var(--gray-400);
}

/* Star rating */
.stars {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
}
.star {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gray-200);
  cursor: pointer;
  transition: all .1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.star:hover { transform: scale(1.15); }
.star.filled { color: var(--orange); }
.star.hovered { color: #FFB347; }

/* Coach feedback fields */
.coach-feedback {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}
.coach-feedback.show { display: block; animation: fadeIn .25s ease; }
.coach-feedback .text-input {
  margin-bottom: 8px;
  font-size: 0.88rem;
  padding: 8px 12px;
}
.coach-feedback .text-input:last-child { margin-bottom: 0; }

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 16px;
}
.btn {
  padding: 12px 28px;
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover:not(:disabled) {
  background: var(--orange-dark);
}
.btn-back {
  background: none;
  color: var(--gray-600);
  padding-left: 0;
}
.btn-back:hover { color: var(--gray-800); }
.btn-submit {
  background: var(--success);
  color: var(--white);
}
.btn-submit:hover:not(:disabled) {
  background: #257040;
}
.btn-submit:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ===== THANK YOU ===== */
.thankyou {
  text-align: center;
  padding: 80px 20px;
}
.thankyou-icon {
  margin-bottom: 24px;
  animation: popIn .5s ease;
}
@keyframes popIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.thankyou h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}
.thankyou p {
  color: var(--gray-600);
  font-size: 1rem;
}

/* ===== RESUME BANNER ===== */
.resume-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--info-bg);
  border-left: 4px solid var(--info);
  margin: 24px 0 0;
  font-size: 0.88rem;
  color: var(--gray-800);
  transition: opacity .3s;
}
.resume-banner i { color: var(--info); font-size: 1.1rem; flex-shrink: 0; }
.resume-banner span { flex: 1; }
.resume-restart {
  background: none;
  border: 1px solid var(--gray-400);
  padding: 4px 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
}
.resume-restart:hover { border-color: var(--gray-600); color: var(--gray-800); }

/* ===== SUBMIT ERROR ===== */
.submit-error {
  background: var(--error-bg);
  border-left: 4px solid var(--error);
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}
.submit-error i { color: var(--error); flex-shrink: 0; }

/* ===== VALIDATION ===== */
.card.invalid {
  border-color: var(--error);
  animation: shake .35s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ===== SUBMITTING OVERLAY ===== */
.submitting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248,246,243,.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  gap: 1rem;
}
.submitting-overlay .spinner {
  border-color: var(--gray-200);
  border-top-color: var(--orange);
}
.submitting-overlay p {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--gray-600);
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .survey-wrap { padding: 0 16px 48px; }
  .step-head { padding: 24px 0 16px; }
  .card { padding: 16px; }
  .pill { min-width: 28px; height: 40px; font-size: 0.82rem; }
  .pill-scale { gap: 3px; }
  .btn { padding: 12px 20px; font-size: 0.9rem; min-height: 44px; }
  .star { width: 40px; height: 40px; font-size: 1.3rem; }
  .coach-card { padding: 16px; }
  .coach-feedback .text-input { font-size: 16px; }
  .search-list { max-height: 200px; }
  .nav { padding: 20px 0 12px; }
  /* Single-line scrolling breadcrumbs on mobile */
  .bc-steps {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .bc-steps::-webkit-scrollbar { display: none; }
  .bc-step { font-size: 0.78rem; padding: 5px 10px; }
  .resume-banner { font-size: 0.82rem; gap: 8px; }
}

/* ===== SAFE AREA (notch devices) ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .survey-wrap { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
}
