/**
 * Find My Quote - premium editorial UI (Outfit + DM Serif)
 * Scoped under .fmq - does not affect rest of site.
 */

.fmq {
  --fmq-sand: #c9a87c;
  --fmq-sand-dim: rgba(196, 165, 116, 0.35);
  --fmq-paper: #faf8f5;
  --fmq-ink: #e8e4dc;
  --fmq-ink-soft: #9a958c;
  --fmq-panel: rgba(22, 22, 28, 0.94);
  --fmq-panel-edge: rgba(255, 255, 255, 0.07);
  --fmq-font: "Outfit", system-ui, -apple-system, sans-serif;
  --fmq-serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  max-width: 56rem;
  margin: 0 auto;
  padding-bottom: 2rem;
  font-family: var(--fmq-font);
}

.fmq-hero {
  text-align: center;
  padding: 0 1rem 2.5rem;
}

.fmq-hero__kicker {
  margin: 0 0 1rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fmq-sand);
}

.fmq-hero__title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--fmq-paper);
}

.fmq-hero__title em {
  font-family: var(--fmq-serif);
  font-style: italic;
  font-weight: 400;
  color: #fff;
}

.fmq-hero__lede {
  margin: 1rem auto 0;
  max-width: 32rem;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--fmq-ink-soft);
}

.fmq-hero__related a {
  color: var(--fmq-sand);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.fmq-hero__related a:hover {
  color: #f0e0c8;
}

.fmq-hero__related a:focus-visible {
  outline: 2px solid var(--fmq-sand);
  outline-offset: 3px;
  border-radius: 0.2rem;
}

/* Canvas: bento board */
.fmq-canvas {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0;
  margin: 0 0.75rem;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--fmq-panel-edge);
  background: linear-gradient(165deg, rgba(30, 30, 36, 0.6) 0%, rgba(12, 12, 16, 0.85) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 40px 100px rgba(0, 0, 0, 0.45);
}

@media (max-width: 720px) {
  .fmq-canvas {
    grid-template-columns: 1fr;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .fmq-rail {
    display: none;
  }

  .fmq-hint {
    display: none;
  }
}

/* Vertical rhythm rail */
.fmq-rail {
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  border-right: 1px solid var(--fmq-panel-edge);
  padding: 1.5rem 0;
}

.fmq-rail__line {
  position: absolute;
  left: 50%;
  top: 12%;
  bottom: 12%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    transparent,
    var(--fmq-sand-dim) 12%,
    var(--fmq-sand-dim) 88%,
    transparent
  );
}

.fmq-rail__ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.fmq-rail__ticks li {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1), background 0.35s ease, box-shadow 0.35s ease;
}

.fmq-rail__ticks li.is-done {
  background: var(--fmq-sand);
  border-color: rgba(196, 165, 116, 0.6);
  box-shadow: 0 0 14px rgba(196, 165, 116, 0.35);
}

.fmq-rail__ticks li.is-active {
  transform: scale(1.45);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}

.fmq-board {
  padding: 1.75rem 1.5rem 2rem;
  min-height: 22rem;
}

@media (min-width: 721px) {
  .fmq-board {
    padding: 2rem 2.25rem 2.25rem;
  }
}

.fmq-board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.fmq-progress {
  flex: 1;
  min-width: 0;
}

.fmq-progress__bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.fmq-progress__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--fmq-sand), #f0e6d8);
  transition: width 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.fmq-progress__frac {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fmq-ink-soft);
}

.fmq-progress__frac strong {
  color: var(--fmq-paper);
  font-weight: 600;
}

.fmq-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.fmq-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2.5;
}

.fmq-ring__value {
  fill: none;
  stroke: var(--fmq-sand);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Panels */
.fmq-panel[hidden] {
  display: none !important;
}

.fmq-stepContent {
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.4, 0, 1, 1);
}

.fmq-stepContent.is-leaving {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.fmq-stepContent.is-arriving {
  animation: fmqStepArrive 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.fmq-stepMeta {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fmq-sand);
}

.fmq-q {
  margin: 0 0 1.75rem;
  font-size: clamp(1.35rem, 3.8vw, 2rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--fmq-paper);
  max-width: 40rem;
}

.fmq-choices {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fmq-choice {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
  padding: 1rem 1.1rem;
  margin: 0;
  border: 1px solid var(--fmq-panel-edge);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--fmq-ink);
  font-family: var(--fmq-font);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
  animation: fmqChoiceIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.fmq-choice:nth-child(1) { animation-delay: 0.04s; }
.fmq-choice:nth-child(2) { animation-delay: 0.1s; }
.fmq-choice:nth-child(3) { animation-delay: 0.16s; }

@keyframes fmqChoiceIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fmq-choice::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--fmq-sand);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.fmq-choice:hover,
.fmq-choice:focus-visible {
  border-color: rgba(196, 165, 116, 0.45);
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}

.fmq-choice:hover::before,
.fmq-choice:focus-visible::before {
  transform: scaleY(1);
}

.fmq-choice:focus {
  outline: none;
}

.fmq-choice:focus-visible {
  outline: 2px solid var(--fmq-sand);
  outline-offset: 2px;
}

.fmq-choice__key {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--fmq-ink-soft);
}

.fmq-choice__label {
  line-height: 1.35;
}

.fmq-choice__arrow {
  color: var(--fmq-ink-soft);
  font-size: 1.1rem;
  transition: transform 0.25s ease, color 0.25s ease;
}

.fmq-choice:hover .fmq-choice__arrow {
  transform: translateX(4px);
  color: var(--fmq-sand);
}

.fmq-choice.is-pressed {
  transform: scale(0.99);
}

.fmq-hint {
  margin: 1.5rem 0 0;
  font-size: 0.8rem;
  color: var(--fmq-ink-soft);
  letter-spacing: 0.02em;
}

.fmq-hint kbd {
  display: inline-block;
  padding: 0.12rem 0.38rem;
  margin: 0 0.1rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--fmq-font);
  font-weight: 600;
  color: var(--fmq-paper);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--fmq-panel-edge);
}

/* Loading */
.fmq-sync {
  text-align: center;
  padding: 3rem 1.5rem;
}

.fmq-sync__waves {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  height: 40px;
  margin-bottom: 1.5rem;
}

.fmq-sync__waves span {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--fmq-sand), rgba(196, 165, 116, 0.2));
  transform-origin: bottom;
  animation: fmqWave 1.1s ease-in-out infinite;
}

.fmq-sync__waves span:nth-child(2) { animation-delay: 0.12s; }
.fmq-sync__waves span:nth-child(3) { animation-delay: 0.24s; }

@keyframes fmqWave {
  0%, 100% { transform: scaleY(0.35); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

.fmq-sync__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fmq-paper);
  letter-spacing: -0.02em;
}

.fmq-sync__sub {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--fmq-ink-soft);
}

/* Result */
.fmq-outcome {
  max-width: 38rem;
  margin: 0 auto;
  padding: 0.5rem 0 1rem;
  animation: fmqOutcome 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fmqOutcome {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fmq-outcome__label {
  margin: 0 0 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--fmq-sand);
}

.fmq-outcome__quote {
  margin: 0;
  font-family: var(--fmq-serif);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  color: #fff;
}

.fmq-outcome__quote-link {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease;
}

.fmq-outcome__quote-link:hover {
  color: #fff;
}

.fmq-outcome__quote-link:focus-visible {
  outline: 2px solid var(--fmq-sand);
  outline-offset: 4px;
  border-radius: 0.2rem;
}

.fmq-outcome__author-link {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: 0.55rem;
  margin: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 0.5rem;
  outline-offset: 3px;
}

.fmq-outcome__author-link:focus-visible {
  outline: 2px solid var(--fmq-sand);
}

.fmq-outcome__byline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: 0.55rem;
  margin: 1.15rem 0 0;
}

.fmq-outcome__byline .fmq-outcome__thumb,
.fmq-outcome__byline .author-thumb {
  flex-shrink: 0;
  align-self: center;
}

.fmq-outcome__byline .fmq-outcome__cite {
  min-width: 0;
  flex: 1 1 0%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fmq-outcome__thumb.fmq-outcome__thumb {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.fmq-outcome__thumb.author-thumb--placeholder {
  background: linear-gradient(135deg, rgba(196, 165, 116, 0.35), rgba(90, 82, 72, 0.5));
}

.fmq-outcome__thumb .author-thumb__initials {
  color: rgba(255, 250, 242, 0.95);
}

.fmq-outcome__cite {
  display: block;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fmq-ink-soft);
}

.fmq-outcome__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.75rem;
}

.fmq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 1.15rem;
  border-radius: 999px;
  font-family: var(--fmq-font);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.fmq-btn--solid {
  background: var(--fmq-sand);
  color: #1a1814;
  border-color: rgba(255, 255, 255, 0.1);
}

.fmq-btn--solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(196, 165, 116, 0.25);
}

.fmq-btn--line {
  background: transparent;
  color: var(--fmq-ink);
  border-color: var(--fmq-panel-edge);
}

.fmq-btn--line:hover {
  border-color: var(--fmq-sand-dim);
  color: var(--fmq-paper);
}

.fmq-outcome__again {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px dashed var(--fmq-panel-edge);
  background: transparent;
  color: var(--fmq-ink-soft);
  font-family: var(--fmq-font);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.fmq-outcome__again:hover {
  color: var(--fmq-paper);
  border-color: var(--fmq-sand-dim);
  background: rgba(255, 255, 255, 0.03);
}

@media (prefers-reduced-motion: reduce) {
  .fmq-stepContent.is-arriving,
  .fmq-choice,
  .fmq-outcome,
  .fmq-sync__waves span,
  .fmq-rail__ticks li {
    animation: none !important;
  }

  .fmq-stepContent.is-leaving {
    opacity: 1;
    transform: none;
  }

  .fmq-ring__value,
  .fmq-progress__bar span,
  .fmq-choice {
    transition: none;
  }
}
