/* KiFF pricing page. Loaded only on pricing.html, after style.css. */

@media (max-width: 759px) {
  /* leave room under the footer for the price bar */
  body { padding-bottom: calc(var(--tabbar) + 7.2rem + env(safe-area-inset-bottom, 0px)); }
}

.calc { display: grid; gap: 1.25rem; padding-bottom: 1.5rem; }

.panel {
  padding: 1.25rem 1.1rem 1.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
}
.panel-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--white);
}

.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.field label, .seg legend {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--dim);
  font-size: 0.88rem;
  padding: 0;
}
.inp {
  display: flex;
  align-items: center;
  background: #000;
  border: 1px solid var(--line);
}
.inp:focus-within { border-color: var(--gold); }
.inp input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0.75rem 0.5rem 0.75rem 0.7rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--gold);
  background: none;
  border: 0;
  border-radius: 0;
  outline: none;
  -moz-appearance: textfield;
}
.inp input::-webkit-outer-spin-button,
.inp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inp span { padding-right: 0.65rem; color: var(--dim); font-size: 0.8rem; }

.range { margin: 0.55rem 0 1.3rem; color: var(--dim); font-size: 0.82rem; }
.range.bad { color: var(--orange); }

.seg { margin: 0 0 1.3rem; padding: 0; border: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.seg legend { width: 100%; float: left; }
.seg label { flex: 1 1 6rem; max-width: 11rem; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: block;
  padding: 0.8rem 0.4rem;
  text-align: center;
  color: var(--dim);
  background: #000;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}
.seg input:checked + span {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 0 12px rgba(214, 168, 74, 0.2);
}
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.field.wide { margin: 0 0 1.3rem; }
.field.wide .inp { max-width: 12rem; }
.hint { margin: 0.45rem 0 0; color: var(--dim); font-size: 0.82rem; max-width: 44ch; }

.note {
  margin: 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--line);
  color: var(--dim);
  font-size: 0.88rem;
  line-height: 1.55;
}
.note + .note { margin-top: 0.9rem; }
.note b { color: var(--gold); font-weight: 400; }
.note.warn { border-left-color: var(--orange); }
.note.warn b.hd { color: var(--orange); }
.note.good { border-left-color: var(--gold); }
.note.good b.hd { color: var(--gold); }
.note .hd { font-weight: 400; }
.note button.link {
  padding: 0;
  font: inherit;
  color: var(--gold);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}
.note .strong { color: var(--white); }

/* Result: a bar above the tab bar on phones, a sticky card on wide screens */
.result {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  z-index: 9;
  background: #0f0b09;
  border-top: 1px solid var(--gold);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.7);
}
.result-in {
  width: min(100% - 2rem, 62rem);
  margin-inline: auto;
  padding: 0.65rem 0 0.7rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "lab btn" "price btn" "sub van";
  column-gap: 1rem;
  align-items: center;
}
.result .lab { grid-area: lab; color: var(--dim); font-family: var(--display); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; }
.result .price {
  grid-area: price;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(214, 168, 74, 0.35);
}
.result .price.off { color: var(--orange); font-size: 1.1rem; text-shadow: none; }
.result .psub { grid-area: sub; margin: 0; max-width: none; color: var(--dim); font-size: 0.76rem; line-height: 1.4; }
.result .psub b { color: var(--white); font-weight: 400; }
.result .psub .save { color: var(--gold); }
.result .btn { grid-area: btn; padding: 0.85rem 1rem; }

.fine { padding: 0 0 2rem; }
.fine p { margin: 0; max-width: 58ch; color: var(--dim); font-size: 0.85rem; }

@media (max-width: 380px) {
  .result .btn { padding: 0.8rem 0.7rem; font-size: 0.7rem; }
  .result .price { font-size: 1.6rem; }
}

@media (min-width: 760px) {
  .calc { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; padding-bottom: 2rem; gap: 1.5rem; }
  .panel { padding: 1.5rem 1.5rem 1.7rem; }
  .result {
    position: sticky;
    top: 1.25rem;
    bottom: auto;
    background: var(--panel);
    border: 1px solid rgba(214, 168, 74, 0.4);
    box-shadow: none;
  }
  .result-in {
    width: auto;
    margin: 0;
    padding: 1.25rem;
    display: block;
  }
  .result .price { margin: 0.3rem 0 0.2rem; font-size: 2.4rem; }
  .result .psub { margin-bottom: 1.1rem; font-size: 0.85rem; min-height: 2.6em; }
  .result .btn { width: 100%; }
}

.seg .hint { flex: 0 0 100%; order: 3; margin-top: 0.1rem; }

/* Home page: the result sits under the form, not in a bar over the page */
.more { display: inline-block; margin-top: 1.1rem; font-size: 0.88rem; }
.result--inline .result-in { padding: 1rem 1.1rem 1.1rem; }
@media (max-width: 759px) {
  body.home { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
  .result--inline {
    position: static;
    background: var(--panel);
    border: 1px solid rgba(214, 168, 74, 0.4);
    box-shadow: none;
  }
  .result--inline .result-in { width: auto; margin: 0; }
}

.vol { margin: 0.7rem 0 1.1rem; color: var(--gold); font-family: var(--display); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.04em; }
.vol:empty { display: none; }

.result-in .btn--ghost { grid-area: van; padding: 0.5rem 0.7rem; font-size: 0.66rem; margin-top: 0.35rem !important; display: block; width: 100%; margin-top: 0.6rem; text-align: center; background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.result-in .btn--ghost[hidden] { display: none; }
.result-in .btn--ghost:hover { background: var(--gold); color: #140b03; }
@media (min-width: 760px) {
  .result-in .btn--ghost { padding: 0.8rem 0.7rem; font-size: 0.75rem; margin-top: 0.6rem !important; }
}
