/* ============================================================
   DESK TO DIVA — tools layer
   Styles for the three interactive tools:
     .finder  — shade & style finder quiz      (finder.html)
     .sizer   — coin-calibrated nail sizer     (size-guide.html)
     .looks   — pin & compare tray             (custom.html, shop.html)

   Loaded only on the pages that use them. Uses the existing tokens
   from style.css — no new colours, no new type.
   ============================================================ */

/* ---------- shared: a tool shell ---------- */
.tool {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: clamp(1.15rem, 4vw, 2rem);
}
.tool__step {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.tool__count {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-ink);
  white-space: nowrap;
}
.tool__q { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.3rem); margin: 0 0 0.3rem; }
.tool__hint { font-size: 0.86rem; color: var(--muted-ink); margin: 0 0 1.3rem; }
.tool__nav { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.tool__back {
  background: none;
  border: 0;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted-ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tool__back:disabled { opacity: 0.35; cursor: default; text-decoration: none; }
.tool__skip { margin-left: auto; }

/* ---------- answer tiles ---------- */
/* Same contract as .opt: a hidden input inside a <label>. */
.tiles { display: grid; gap: 0.7rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tiles--art { grid-template-columns: 1fr 1fr; }
@media (min-width: 620px) { .tiles--art { grid-template-columns: repeat(3, 1fr); } }

.tile { position: relative; display: block; }
.tile input { position: absolute; opacity: 0; width: 0; height: 0; }
.tile__box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: 100%;
  padding: 0.95rem 1rem;
  border: 1.5px solid var(--line-field);
  border-radius: var(--r);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.tile__box:hover { border-color: var(--rose); transform: translateY(-3px); box-shadow: var(--sh-2); }
.tile input:checked + .tile__box {
  border-color: var(--hot);
  box-shadow: 0 0 0 1.5px var(--hot), var(--sh-2);
  background: var(--blush);
}
.tile input:focus-visible + .tile__box { outline: 3px solid var(--hot); outline-offset: 3px; }
.tile__box strong { display: block; color: var(--plum); font-size: 0.98rem; line-height: 1.25; }
.tile__box small { display: block; font-size: 0.78rem; color: var(--muted-ink); line-height: 1.45; margin-top: 2px; }

/* art tiles stack the drawing above the label */
.tiles--art .tile__box { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.6rem 0.6rem 0.8rem; }
.tile__art {
  border-radius: var(--r-sm);
  background: linear-gradient(160deg, var(--blush) 0%, var(--cream) 100%);
  padding: 0.35rem 0.2rem 0;
  overflow: hidden;
}
.tile__art svg { width: 100%; height: auto; }
.tiles--art .tile__box strong { text-align: center; font-size: 0.86rem; }

/* ---------- progress ---------- */
.tool__bar { height: 4px; border-radius: 4px; background: var(--blush-2); overflow: hidden; margin-bottom: 1.4rem; }
.tool__bar i { display: block; height: 100%; width: 0; background: var(--grad-rose); transition: width var(--t) var(--ease); }

/* ---------- finder result ---------- */
.result { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .result { grid-template-columns: 1fr 1.1fr; align-items: start; } }
.result__why { margin: 1rem 0 0; padding: 0; list-style: none; }
.result__why li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 0.55rem;
  color: var(--plum-soft);
}
.result__why li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.5em;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--hot);
}
.result__spec { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.9rem 0 0; }
.result__match { display: flex; gap: 0.9rem; align-items: center; margin-top: 1rem; }
.result__match img { width: 92px; height: 92px; border-radius: var(--r-sm); object-fit: cover; flex: none; }

/* ---------- sizer ---------- */
.sizer__coin {
  display: grid;
  place-items: center;
  padding: 1.4rem 0.5rem;
  background: linear-gradient(160deg, var(--blush) 0%, var(--cream) 100%);
  border-radius: var(--r);
  border: 1px solid var(--line);
}
.sizer__disc {
  border-radius: 50%;
  background: var(--grad-gold);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55), var(--sh-2);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #6b5510;
  letter-spacing: 0.06em;
}
/* Native range input: styled lightly, never replaced — it is the only
   control here that a screen reader and a keyboard both already understand. */
.sizer__range { width: 100%; margin: 1.1rem 0 0.2rem; accent-color: var(--hot); }

/* the caliper: two rails the finger sits between */
.caliper {
  position: relative;
  height: 190px;
  margin: 1rem 0 0.4rem;
  border-radius: var(--r);
  background:
    repeating-linear-gradient(90deg, rgba(91, 31, 53, 0.07) 0 1px, transparent 1px 100%) 0 0 / 10px 100%,
    linear-gradient(160deg, var(--blush) 0%, var(--cream) 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: none;          /* we handle the drag ourselves */
  user-select: none;
  -webkit-user-select: none;
}
.caliper__jaw {
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: var(--hot);
  cursor: ew-resize;
}
.caliper__jaw::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 46px;          /* 46px ≈ comfortable thumb target */
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--hot);
  box-shadow: var(--sh-2);
}
.caliper__jaw::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  z-index: 1;
  width: 13px; height: 13px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid #fff;
  border-left: 0; border-bottom: 0;
}
.caliper__jaw--l { cursor: default; }
.caliper__jaw--l::after, .caliper__jaw--l::before { display: none; }
.caliper__span {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(200, 48, 107, 0.1);
  border-left: 1px dashed var(--hot);
  border-right: 1px dashed var(--hot);
}
.caliper__read {
  position: absolute;
  left: 50%; bottom: 0.6rem;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.86);
  padding: 0.1rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}
.caliper__jaw:focus-visible { outline: 3px solid var(--hot); outline-offset: 4px; }

.sizer__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; margin-top: 1rem; }
.sizer__cell {
  text-align: center;
  padding: 0.45rem 0.2rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.78rem;
  cursor: pointer;
}
.sizer__cell.is-now { border-color: var(--hot); box-shadow: 0 0 0 1.5px var(--hot); }
.sizer__cell.is-done { background: var(--blush); }
.sizer__cell b { display: block; font-size: 0.92rem; color: var(--plum); }
.sizer__cell span { display: block; font-size: 0.68rem; color: var(--muted-ink); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- looks tray ---------- */
.looks { margin-top: 1rem; }
.looks__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.look {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: linear-gradient(160deg, var(--blush) 0%, var(--cream) 100%);
  padding: 0.3rem 0.3rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.look:hover { border-color: var(--hot); transform: translateY(-2px); }
.look svg { width: 100%; height: auto; }
.look b { display: block; font-size: 0.68rem; color: var(--plum); line-height: 1.25; }
.look span { display: block; font-size: 0.63rem; color: var(--muted-ink); }
.look__x {
  position: absolute;
  top: -7px; right: -7px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--plum);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.look--empty {
  display: grid;
  place-items: center;
  min-height: 92px;
  border-style: dashed;
  color: var(--muted-ink);
  font-size: 0.7rem;
  cursor: default;
  background: none;
}
.look--empty:hover { border-color: var(--line); transform: none; }

@media (prefers-reduced-motion: reduce) {
  .tile__box:hover, .look:hover { transform: none; }
  .tool__bar i { transition: none; }
}
