/* MyMenoo · sezione Prezzi: calcolatore del Piano Pro.
   Solo token, toni e font della Home (style.css). A sinistra si compone il Pro, a destra
   la scheda inchiostro col totale (prende il posto della vecchia scheda Pro). */

.calc { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
.calc__panel { grid-column: 1 / span 7; display: grid; border-top: 1px solid var(--line); }
.calc__sum { grid-column: 8 / span 5; position: sticky; top: calc(var(--nav) + 24px); }

/* ---------- righe di scelta ---------- */
.calc__row { margin: 0; padding: 32px 0; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.calc__label { float: left; width: 100%; display: flex; align-items: center; gap: 12px; padding: 0; font: 800 26px/1.1 var(--f-sans); letter-spacing: -.035em; }
.calc__no { font: 400 13px/1 var(--f-mono); letter-spacing: .04em; color: var(--accent-text); }
.calc__soon { padding: 6px 10px 5px; border-radius: 999px; border: 1px solid var(--line); font: 400 12px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.calc__label + * { clear: both; }
.calc__hint { margin-top: 10px; max-width: 52ch; font-size: 16px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.calc__more { margin-top: 16px; font-size: 16px; color: var(--muted); }
.calc__more a { color: var(--ink); font-weight: 600; text-decoration-color: var(--accent); }

/* stepper dei locali */
.step { margin-top: 20px; display: flex; align-items: center; gap: 8px; }
.step__btn { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 4px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; transition: background-color 150ms var(--ease), transform 150ms var(--ease), opacity 150ms var(--ease); }
.step__btn .ico { width: 20px; height: 20px; stroke-width: 2; }
.step__btn:disabled { opacity: .3; cursor: default; }
.step__btn:not(:disabled):active { transform: scale(.94); transition-duration: 90ms; }
.step__val { width: 2.2ch; padding: 0; border: 0; background: none; color: var(--ink); text-align: center; font: 800 52px/1 var(--f-sans); letter-spacing: -.05em; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.step__val::-webkit-inner-spin-button, .step__val::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.step__unit { margin-left: 6px; font-family: var(--f-serif); font-style: italic; font-weight: 500; font-size: 24px; color: var(--accent-text); }

/* lingue: le 11 del Manager, l'italiano fisso */
.langs { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.lang { position: relative; display: inline-flex; }
.lang input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.lang span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 500; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease); }
.lang span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .45; transition: background-color 150ms var(--ease), opacity 150ms var(--ease); }
.lang input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.lang input:checked + span::before { background: var(--accent); border-color: var(--accent); opacity: 1; }
.lang input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.lang.is-fixed input { cursor: default; }
.lang.is-fixed span { background: transparent; border-style: dashed; color: var(--ink); }
.lang.is-fixed span::before { background: var(--accent); border-color: var(--accent); opacity: 1; }
.calc__all { margin-top: 16px; padding: 10px 0; min-height: 44px; border: 0; background: none; color: var(--ink); font: 600 15px/1 var(--f-sans); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line); cursor: pointer; transition: text-decoration-color 150ms var(--ease); }

/* interruttore Traduzione AI */
.switch { position: relative; margin-top: 20px; display: inline-flex; align-items: center; gap: 14px; min-height: 44px; cursor: pointer; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }
.switch__track { position: relative; width: 52px; height: 30px; border-radius: 999px; background: color-mix(in oklab, var(--ink), transparent 82%); transition: background-color 200ms var(--ease); flex: none; }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); box-shadow: 0 2px 6px -2px rgba(20, 18, 16, .4); transition: translate 220ms var(--ease); }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track .switch__thumb { translate: 22px 0; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.switch__text { font-size: 17px; font-weight: 600; }
.switch.is-off { cursor: default; }
.switch.is-off .switch__track { opacity: .45; }
.switch.is-off .switch__text { color: var(--muted); }

/* ---------- riepilogo: la scheda inchiostro ---------- */
.calc__sum { isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: 40px; border-radius: 8px; background: #141210; color: var(--ink); border: 1px solid rgba(242, 239, 233, .12); }
.calc__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(520px circle at var(--mx, 78%) var(--my, -10%), rgba(242, 239, 233, .07), transparent 62%); }
.calc__sum::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none; background: radial-gradient(360px circle at var(--mx, 78%) var(--my, -10%), rgba(240, 122, 69, .9), transparent 65%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.calc__top { display: grid; gap: 14px; }
.calc__kicker { display: flex; align-items: center; min-height: 24px; gap: 10px; font: 400 13px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.calc__name { font: 800 26px/1.1 var(--f-sans); letter-spacing: -.035em; }
.calc__price { margin-top: 24px; display: flex; align-items: baseline; gap: 12px; }
.calc__amount { font-family: var(--f-sans); font-weight: 800; font-size: clamp(56px, 4.6vw, 84px); line-height: .95; letter-spacing: -.05em; font-variant-numeric: tabular-nums; color: #F2EFE9; }
.calc__period { font-family: var(--f-serif); font-style: italic; font-size: 24px; color: var(--accent-text); }

/* conto letto come un piatto: voce, puntini, prezzo in mono */
.calc__lines { margin-top: 28px; border-top: 1px solid var(--line); display: grid; }
.calc__lines li { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.calc__what { display: grid; gap: 2px; font-weight: 700; font-size: 16px; line-height: 1.3; }
.calc__what small { font-weight: 400; font-size: 14px; color: var(--muted); }
.calc__dots { flex: 1; min-width: 16px; align-self: center; border-bottom: 1.5px dotted color-mix(in oklab, var(--ink), transparent 70%); translate: 0 -2px; }
.calc__cost { font: 400 15px/1 var(--f-mono); color: var(--accent-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc__lines li.is-soon .calc__cost { color: var(--muted); }

.calc__trial { margin-top: 28px; padding: 20px; border-radius: 6px; background: var(--surface); display: grid; gap: 16px; }
.calc__trial p { font-size: 15px; line-height: 1.5; color: var(--muted); }
.calc__trial strong { color: var(--ink); }
.calc__cta { justify-self: start; }
.calc__cta .ico { transition: translate 200ms var(--ease); }
.calc__fine { margin-top: 18px; font-size: 14px; line-height: 1.5; color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  .step__btn:not(:disabled):hover { background: color-mix(in oklab, var(--bg), var(--ink) 7%); }
  .lang input:not(:checked):not(:disabled):hover + span { border-color: var(--ink); }
  .calc__all:hover { text-decoration-color: var(--accent); }
  .calc__cta:hover .ico { translate: 3px 0; }
  .calc__sum:hover { box-shadow: 0 36px 64px -34px rgba(224, 87, 31, .55); }
}

/* senza JS i controlli non fanno nulla: si vedono, ma spenti */
html:not(.js) .calc__panel { pointer-events: none; }
html:not(.js) .step__btn, html:not(.js) .switch { display: none; }
html:not(.js) .calc__all { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .calc__panel, .calc__sum { grid-column: 1 / -1; }
  .calc__sum { position: static; margin-top: 40px; padding: 32px; }
}
@media (max-width: 639px) {
  .calc__row { padding: 26px 0; }
  .calc__label { font-size: 22px; flex-wrap: wrap; }
  .calc__sum { padding: 26px; margin-top: 32px; }
  .calc__amount { font-size: 52px; }
  .calc__cta { justify-self: stretch; }
  .lang span { padding: 0 14px; font-size: 15px; }
}

/* ---------- entrata (una volta) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .calc .calc__row, .js .calc .calc__sum { transition: opacity 600ms var(--ease-enter) calc(var(--i) * 120ms), translate 700ms var(--ease-enter) calc(var(--i) * 120ms), box-shadow 300ms var(--ease); }
  .js .calc:not(.is-in) .calc__row { opacity: 0; translate: 0 24px; }
  .js .calc:not(.is-in) .calc__sum { opacity: 0; translate: 0 40px; }
  .calc__lines li { animation: calc-line 320ms var(--ease-enter) backwards; }
}
@keyframes calc-line { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) {
  .calc__lines li { animation: none; }
  .step__btn:not(:disabled):active { transform: none; }
}
.calc__need { color: var(--ink); font-weight: 600; }

/* ---------- barra fissa col totale (solo sotto i 1024 px) ---------- */
.calc__bar { display: none; }
@media (max-width: 1023px) {
  .calc__bar {
    position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px 10px 18px;
    border-radius: 8px; background: #141210; color: var(--ink); border: 1px solid rgba(242, 239, 233, .12);
    box-shadow: 0 18px 40px -16px rgba(20, 18, 16, .6); text-decoration: none;
    translate: 0 calc(100% + 24px); opacity: 0;
    transition: translate 320ms var(--ease-enter), opacity 240ms var(--ease);
  }
  .calc__bar[hidden] { display: none; }
  .calc__bar.is-on { translate: 0 0; opacity: 1; }
  .calc__bar-txt { display: grid; gap: 4px; min-width: 0; flex: 1; }
  .calc__bar-k { font: 400 11px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .calc__bar-n { font: 700 15px/1.2 var(--f-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .calc__bar-p { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
  .calc__bar-p b { font: 800 28px/1 var(--f-sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: #F2EFE9; }
  .calc__bar-p i { font-family: var(--f-serif); font-style: italic; font-size: 17px; color: var(--accent-text); }
  .calc__bar-ico { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--accent); color: #141210; stroke-width: 2.2; transform: rotate(90deg); }
  .calc__bar:active { scale: .99; }
}
@media (prefers-reduced-motion: reduce) { .calc__bar { transition: none; } .calc__bar:active { scale: 1; } }
