/*
 * kaira.top — Match with Kaira · Editorial Career OS
 * Modal / bottom-sheet + result breakdown. Shares tokens from ../styles.css.
 */

/* ---- Floating trigger ---- */
.match-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 45;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.match-fab:hover {
  background: var(--text-primary);
  color: var(--bg-paper);
}

/* ---- Backdrop / panel ---- */
.match-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(17, 17, 17, 0.35);
  opacity: 0;
  transition: opacity 260ms ease;
}

.match-backdrop.show { opacity: 1; }

.match-panel {
  position: fixed;
  z-index: 60;
  top: 50%;
  left: 50%;
  width: min(820px, 94vw);
  max-height: 88vh;
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-paper);
  transition: transform 280ms ease, opacity 280ms ease;
}

.match-panel.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* standalone page inner */
.match-page-inner {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}

/* ---- Head ---- */
.match-head {
  position: relative;
  margin-bottom: 1.5rem;
}

.match-eyebrow {
  margin: 0;
  color: var(--c-orange);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.match-title {
  margin: 0.6rem 2.5rem 0 0;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.match-sub {
  margin: 0.8rem 0 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 36rem;
}

.match-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.match-close:hover {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

/* ---- Form ---- */
.match-form { margin-top: 1.5rem; }

.match-field { margin-bottom: 1rem; }

.match-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.match-field input,
.match-field textarea,
.match-field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.match-field textarea { resize: vertical; line-height: 1.5; }

.match-field input:focus,
.match-field textarea:focus,
.match-field select:focus {
  border-color: var(--text-primary);
}

.match-adv {
  margin: 0.5rem 0 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0;
}

.match-adv-sum {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  list-style: none;
}

.match-adv-sum::-webkit-details-marker { display: none; }
.match-adv-sum::before { content: "+ "; }
.match-adv[open] .match-adv-sum::before { content: "– "; }

.match-adv .match-field { margin-top: 0.9rem; }

.match-actions { margin-top: 1.2rem; }

.match-submit {
  min-height: 3rem;
  padding: 0.6rem 1.4rem;
}

.match-privacy {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

/* ---- Analyzing ---- */
.match-steps { margin: 2rem 0; }

.match-step {
  margin: 0.4rem 0;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
}

/* ---- Result ---- */
.match-score-block {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.match-score {
  font-size: clamp(4.5rem, 14vw, 8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.match-level {
  margin: 0.5rem 0 0;
  color: var(--c-orange);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.match-disclaimer {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
  max-width: 36rem;
}

.match-dims {
  display: grid;
  gap: 0;
  margin: 1.5rem 0;
}

.match-dim {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.match-dim-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.match-dim-name {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.match-dim-val {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.match-dim-line {
  margin-top: 0.45rem;
  height: 2px;
  background: var(--line);
}

.match-dim-line span {
  display: block;
  height: 100%;
  background: var(--c-orange);
}

.match-section {
  margin: 1.8rem 0 0.9rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.match-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.match-li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.55;
}

.match-li-num {
  color: var(--c-orange);
  font-weight: 700;
  font-size: 0.8rem;
}

.match-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.match-chip {
  padding: 0.32rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.match-chip-link {
  color: var(--c-blue);
  border-color: var(--c-blue);
}

.match-evidence {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.match-ev-card {
  padding: 0.95rem 1rem;
  background: var(--bg-white);
}

.match-ev-type {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.match-ev-title {
  margin: 0.4rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.match-ev-note {
  margin: 0.4rem 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.match-ev-skill {
  margin: 0.5rem 0 0;
  color: var(--c-orange);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-gaps {
  display: grid;
  gap: 0.6rem;
}

.match-gap {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
}

.match-gap-label {
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
}

.match-gap-note {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.match-weeks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.match-week {
  padding: 0.9rem 1rem;
  background: var(--bg-white);
}

.match-week-name {
  margin: 0 0 0.35rem;
  color: var(--c-blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.match-week p:last-child {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.match-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.match-copy {
  margin-top: 0.9rem;
}

.match-again {
  display: block;
  margin: 1.2rem auto 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ---- Mobile: full-screen sheet ---- */
@media (max-width: 767px) {
  .match-panel {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    transform: translateY(102%);
  }

  .match-panel.show {
    transform: translateY(0);
  }

  .match-evidence,
  .match-weeks {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .match-panel,
  .match-backdrop {
    transition: none;
  }
}
