/* =========================================================
   /stones — reserve a stone
   ---------------------------------------------------------
   Testers found the old configurator hard to read: small grey
   mono labels on near-black, and a wall of options. This one is
   three short cards, each with its own mineral colour and icon,
   and type sized to be read rather than admired.
   ========================================================= */

.cfg-page {
  --cfg-surface: linear-gradient(160deg, rgba(38, 33, 29, 0.92), rgba(20, 17, 15, 0.94));
  --cfg-line: rgba(237, 231, 219, 0.1);
}

.cfg {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

@media (max-width: 960px) {
  .cfg {
    grid-template-columns: 1fr;
  }
}

.cfg__form {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  min-width: 0;
}

/* ---------------- cards ---------------- */

.cfg__card {
  --acc: var(--gold-200);
  --acc-2: var(--gold-400);
  position: relative;
  min-width: 0;
  margin: 0;
  padding: clamp(1.15rem, 2.6vw, 1.9rem);
  border: 1px solid var(--cfg-line);
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--acc) 12%, transparent), transparent 60%),
    var(--cfg-surface);
  box-shadow: 0 18px 50px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: cfg-rise 0.7s var(--ease-out) both;
}

.cfg__card:nth-child(2) { animation-delay: 0.08s; }
.cfg__card:nth-child(3) { animation-delay: 0.16s; }

/* A coloured edge down the left, so each step is recognisable at a glance. */
.cfg__card::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 1.4rem;
  bottom: 1.4rem;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--acc), var(--acc-2));
}

.cfg__card--gold   { --acc: #e8c872; --acc-2: #b38a24; }
.cfg__card--water  { --acc: #8fb8dc; --acc-2: #4d7599; }
.cfg__card--garnet { --acc: #e59384; --acc-2: #a8483d; }

@keyframes cfg-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.cfg__head {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  padding: 0;
  margin-bottom: 1.25rem;
  width: 100%;
  /* A floated legend drops into the fieldset's content box instead of
     sitting on its border. */
  float: left;
}

.cfg__head + * {
  clear: both;
}

.cfg__badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 14px;
  font-size: 1.3rem;
  color: #1a1410;
  background: linear-gradient(145deg, var(--acc), var(--acc-2));
  box-shadow: 0 8px 22px -10px var(--acc);
}

.cfg__head-txt {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.cfg__step {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acc);
}

.cfg__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.05;
  color: var(--bone-100);
}

.cfg__note {
  font-size: var(--step--1);
  color: var(--bone-300);
}

/* ---------------- who it is for ---------------- */

.cfg__kinds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 620px) {
  .cfg__kinds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cfg__kind {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 0.95rem 0.5rem;
  border: 1px solid var(--cfg-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--bone-200);
  text-align: center;
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease-out), color 0.3s;
}

.cfg__kind:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--acc) 45%, transparent);
}

.cfg__kind-ico {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  font-size: 1.15rem;
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 12%, transparent);
  transition: background 0.3s, color 0.3s, transform 0.4s var(--ease-out);
}

.cfg__kind-l {
  font-size: var(--step--1);
  line-height: 1.2;
}

.cfg__kind.is-on {
  border-color: var(--acc);
  background: color-mix(in srgb, var(--acc) 12%, transparent);
  color: var(--bone-100);
}

.cfg__kind.is-on .cfg__kind-ico {
  color: #1a1410;
  background: linear-gradient(145deg, var(--acc), var(--acc-2));
  transform: scale(1.08);
}

/* ---------------- fields ---------------- */

.cfg__field {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.cfg__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  color: var(--bone-200);
}

.cfg__label .ico {
  color: var(--acc);
}

.cfg__label em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.72em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-500);
  padding: 0.12em 0.55em;
  border: 1px solid var(--cfg-line);
  border-radius: 99px;
}

.cfg__field input,
.cfg__field textarea,
.cfg__slug {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(237, 231, 219, 0.14);
  border-radius: 12px;
  background: rgba(6, 5, 4, 0.45);
  color: var(--bone-100);
  font-family: var(--font-serif);
  font-size: var(--step-0);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.cfg__field textarea {
  resize: vertical;
  min-height: 5.5rem;
}

.cfg__field input::placeholder,
.cfg__field textarea::placeholder {
  color: var(--bone-500);
}

.cfg__field input:focus,
.cfg__field textarea:focus,
.cfg__slug:focus-within {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 16%, transparent);
  background: rgba(6, 5, 4, 0.6);
}

.cfg__slug {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0 0 0 1rem;
}

.cfg__slug-host {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--acc);
}

.cfg__slug input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem 0.85rem 0.1rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.cfg__slug input:focus {
  box-shadow: none;
  background: transparent;
}

.cfg__slug-state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  color: var(--bone-400);
  min-height: 1.4em;
}

.cfg__slug-state::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--bone-500);
  transition: background 0.3s, box-shadow 0.3s;
}

.cfg__slug-state.is-ok { color: #9ed8a6; }
.cfg__slug-state.is-ok::before { background: #6cc47a; box-shadow: 0 0 10px #6cc47a; }
.cfg__slug-state.is-taken { color: #f0a497; }
.cfg__slug-state.is-taken::before { background: #e0685a; box-shadow: 0 0 10px #e0685a; }
.cfg__slug-state.is-warn { color: var(--gold-200); }
.cfg__slug-state.is-warn::before { background: var(--gold-300); }

/* ---------------- delivery options ---------------- */

.cfg__opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 620px) {
  .cfg__opts {
    grid-template-columns: 1fr;
  }
}

.cfg__opt {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.8rem;
  row-gap: 0.55rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--cfg-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--bone-200);
  text-align: left;
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease-out);
}

.cfg__opt:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--acc) 45%, transparent);
}

.cfg__opt-ico {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 11px;
  font-size: 1.1rem;
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 12%, transparent);
  transition: background 0.3s, color 0.3s;
}

.cfg__opt-txt {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.cfg__opt-l {
  font-size: var(--step-0);
  line-height: 1.2;
  color: var(--bone-100);
}

.cfg__opt-n {
  font-size: var(--step--1);
  color: var(--bone-400);
}

.cfg__opt-p {
  grid-column: 1 / -1;
  justify-self: start;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  padding: 0.3em 0.75em;
  border-radius: 99px;
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 10%, transparent);
}

.cfg__opt-tick {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  font-size: 0.8rem;
  color: #1a1410;
  background: linear-gradient(145deg, var(--acc), var(--acc-2));
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}

.cfg__opt.is-on {
  border-color: var(--acc);
  background: color-mix(in srgb, var(--acc) 11%, transparent);
}

.cfg__opt.is-on .cfg__opt-ico {
  color: #1a1410;
  background: linear-gradient(145deg, var(--acc), var(--acc-2));
}

.cfg__opt.is-on .cfg__opt-tick {
  opacity: 1;
  transform: scale(1);
}

/* ---------------- lifetime checkbox ---------------- */

.cfg__check {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px dashed color-mix(in srgb, var(--acc) 40%, transparent);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

.cfg__check:hover {
  background: color-mix(in srgb, var(--acc) 6%, transparent);
}

.cfg__check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cfg__check-box {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1.5px solid var(--acc);
  border-radius: 7px;
  font-size: 0.9rem;
  color: transparent;
  transition: background 0.25s, color 0.25s;
}

.cfg__check input:checked ~ .cfg__check-box {
  color: #1a1410;
  background: linear-gradient(145deg, var(--acc), var(--acc-2));
}

.cfg__check input:checked ~ .cfg__check-ico {
  animation: cfg-spin 0.9s var(--ease-out);
}

.cfg__check input:focus-visible ~ .cfg__check-box {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 22%, transparent);
}

.cfg__check-ico {
  font-size: 1.5rem;
  color: var(--acc);
}

@keyframes cfg-spin {
  from { transform: rotate(-180deg) scale(0.6); }
  to   { transform: none; }
}

.cfg__check-txt {
  display: grid;
  gap: 0.2rem;
}

.cfg__check-txt strong {
  font-weight: 400;
  font-size: var(--step-0);
  color: var(--bone-100);
}

.cfg__check-txt strong b {
  font-weight: 400;
  font-family: var(--font-mono);
  font-size: 0.75em;
  color: var(--acc);
  margin-left: 0.3em;
}

.cfg__check-txt em {
  font-style: normal;
  font-size: var(--step--1);
  color: var(--bone-400);
}

/* ---------------- summary ---------------- */

.cfg__side {
  position: sticky;
  top: calc(var(--nav-h, 88px) + 1.25rem);
  min-width: 0;
}

@media (max-width: 960px) {
  .cfg__side {
    position: static;
  }
}

.cfg__sum {
  overflow: hidden;
  border: 1px solid rgba(232, 200, 114, 0.22);
  border-radius: 20px;
  background: var(--cfg-surface);
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  animation: cfg-rise 0.8s 0.1s var(--ease-out) both;
}

.cfg__shot {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.cfg__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: cfg-drift 14s ease-in-out infinite alternate;
}

@keyframes cfg-drift {
  to { transform: scale(1.12) translate(-2%, -1%); }
}

.cfg__shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(12, 10, 9, 0.92));
}

.cfg__shot figcaption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.9rem;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--bone-100);
}

.cfg__shot figcaption .ico {
  color: var(--gold-200);
}

.cfg__sum-body {
  padding: 1.25rem clamp(1.1rem, 2.4vw, 1.6rem) 1.5rem;
}

.cfg__sum-k {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-200);
}

.cfg__total {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4vw, 3.1rem);
  line-height: 1;
  color: var(--bone-100);
  font-variant-numeric: tabular-nums;
  margin-top: 0.35rem;
  background: linear-gradient(120deg, #fff4d6, #e8c872 55%, #c79a2e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cfg__breakdown {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  color: var(--bone-400);
  margin-top: 0.35rem;
}

.cfg__lines {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cfg-line);
}

.cfg__lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--step--1);
  color: var(--bone-300);
}

.cfg__lines li span:last-child {
  font-family: var(--font-mono);
  color: var(--bone-200);
  font-variant-numeric: tabular-nums;
}

.cfg__error {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: var(--step--1);
  color: #f6c3b9;
  background: rgba(181, 84, 74, 0.16);
  border: 1px solid rgba(229, 147, 132, 0.35);
}

.cfg__go {
  width: 100%;
  justify-content: center;
  margin-top: 1.25rem;
  border-radius: 12px;
  overflow: hidden;
}

.cfg__go[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.cfg__promise {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.cfg__promise li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: var(--step--1);
  color: var(--bone-300);
  line-height: 1.4;
}

.cfg__promise .ico {
  margin-top: 0.15em;
  color: #9ed8a6;
}

@media (prefers-reduced-motion: reduce) {
  .cfg__card,
  .cfg__sum,
  .cfg__shot img {
    animation: none;
  }
}
