/* Price calculator page */
.calc { padding: 40px 0 104px; }

.ptabs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 20px; scrollbar-width: thin; }
.ptab {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px;
  border: 2px solid var(--line); border-radius: var(--pill); background: var(--white);
  font-weight: 800; font-size: 1rem; cursor: pointer; white-space: nowrap;
}
.ptab:hover { border-color: var(--accent); }
@media (min-width: 961px) { .ptabs { flex-wrap: wrap; overflow: visible; } }
.ptab i { width: 40px; height: 30px; border-radius: 6px; background: var(--paper); display: block; overflow: hidden; }
.ptab i svg { width: 100%; height: 100%; }
.ptab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }

.stepper { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 28px; }
.stepper button {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--white);
  font-weight: 800; font-size: 1.0625rem; cursor: pointer; text-align: left;
}
.stepper b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid currentColor; font-size: 0.95rem; flex: none; }
.stepper button[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: var(--navy); }
.stepper button[aria-current="step"] b { background: var(--white); color: var(--accent-deep); border-color: var(--white); }
.stepper button:disabled { cursor: not-allowed; opacity: .5; }

.calc-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 32px; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 36px; }
.panel h2 { font-size: 2.25rem; }
.panel .sub { color: var(--muted); margin-top: 6px; font-size: 1.0625rem; }

/* Preview */
.preview { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 32px; overflow: hidden; }
.preview-art { aspect-ratio: 4 / 3; display: grid; place-items: center; }
.preview-art svg { width: 100%; height: 100%; }
.preview-specs { margin-top: 16px; border-top: 1px solid var(--line); }
.preview-specs div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.preview-specs dt { color: var(--muted); font-weight: 700; }
.preview-specs dd { margin: 0; font-weight: 700; text-align: right; }
.preview-link { display: inline-block; margin-top: 16px; font-weight: 800; color: var(--accent-deep); text-decoration: none; }
.preview-link:hover { text-decoration: underline; }

/* Business card live preview (visitkort only) */
.bc-stage { display: grid; justify-items: center; padding: 8px 0 20px; }
.bc {
  width: min(92%, 400px); aspect-ratio: 85 / 55; border-radius: 6px; padding: 7%;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 24px 48px -24px rgba(0,0,0,.45); transition: background .2s ease, color .2s ease;
}
.bc.front { transform: rotate(-3deg); }
.bc.back { transform: rotate(2deg) translateX(6%); margin-top: -4%; }
.bc-company { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.25rem, 3vw, 1.75rem); text-transform: uppercase; line-height: 1.1; overflow-wrap: anywhere; }
.bc-tag { font-size: 0.8rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; opacity: .85; }
.bc-name { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.1rem, 2.6vw, 1.5rem); text-transform: uppercase; overflow-wrap: anywhere; }
.bc-title { font-size: 0.95rem; opacity: .75; margin-top: 2px; }
.bc-lines { font-size: 0.85rem; display: grid; gap: 2px; overflow-wrap: anywhere; }
.bc-tools { display: grid; gap: 14px; }
.bc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bc-fields input { width: 100%; min-width: 0; padding: 11px 14px; font-size: 1rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--white); }
.bc-fields input:focus { outline: none; border-color: var(--accent); }
.themes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.themes .label { color: var(--muted); margin-right: 6px; }
.theme { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.theme[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent); }
.note { font-size: 0.9rem; color: var(--muted); }

/* Options */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.chips span { font-size: 0.9rem; font-weight: 700; padding: 6px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--pill); }
.opt { margin-top: 24px; }
.opt-label { display: block; font-weight: 800; margin-bottom: 10px; }
.opt-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { padding: 11px 18px; border: 2px solid var(--line); border-radius: var(--pill); background: var(--white); font-weight: 700; font-size: 1rem; cursor: pointer; }
.choice:hover { border-color: var(--accent); }
.choice[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--navy); }
.size-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.size-row .x { padding-bottom: 14px; font-weight: 800; color: var(--muted); }
.size-row .field input { font-weight: 800; font-size: 1.2rem; text-align: center; }
.size-hint { margin-top: 8px; font-size: 0.95rem; color: var(--muted); }

.qty-input { display: flex; align-items: stretch; border: 2px solid var(--line); border-radius: var(--pill); overflow: hidden; }
.qty-input:focus-within { border-color: var(--accent); }
.qty-input button { width: 60px; border: 0; background: var(--paper); font-size: 1.5rem; cursor: pointer; }
.qty-input button:hover { background: var(--paper-2); }
.qty-input input { flex: 1; min-width: 0; border: 0; padding: 14px; text-align: center; font-weight: 800; font-size: 1.4rem; background: var(--white); }
.qty-input input:focus { outline: none; }
.qty-input input[aria-invalid="true"] { color: var(--err); }
.qty-input input::-webkit-outer-spin-button, .qty-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input input[type=number] { -moz-appearance: textfield; }
.panel .picks { margin-top: 12px; }
.ladder { display: grid; gap: 6px; }
.rung-head, .rung { display: grid; grid-template-columns: 1.1fr 1fr 1fr; align-items: center; gap: 8px; padding-inline: 18px; }
.rung-head { padding-bottom: 2px; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.rung-head span:not(:first-child), .rung span { text-align: right; }
.rung { width: 100%; padding-block: 13px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--ink); font: inherit; font-size: 1.0625rem; cursor: pointer; }
.rung b { font-weight: 800; text-align: left; }
.rung span:last-child { font-weight: 800; }
.rung:hover { border-color: var(--accent); }
.rung[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--navy); }
.ladder-note { margin-top: 12px; font-size: 0.95rem; color: var(--muted); }
.ladder-note a { color: var(--accent-deep); font-weight: 700; }
.tiers { margin-top: 14px; font-size: 0.95rem; color: var(--muted); display: grid; gap: 2px; }
.panel .error { margin-top: 8px; }

.delivery-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.delivery-toggle .choice { border-radius: 12px; text-align: left; padding: 12px 16px; }
.delivery-toggle .choice small { display: block; font-weight: 600; opacity: .8; }

.breakdown { margin-top: 24px; border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 1.0625rem; }
.row b { font-weight: 800; white-space: nowrap; }
.row.save b { color: var(--ok); }
.row.total { border-bottom: 0; padding-top: 20px; align-items: baseline; }
.row.total span { font-weight: 800; font-size: 1.125rem; }
.row.total b { font-family: var(--f-display); font-weight: 600; font-size: 2.6rem; color: var(--accent-deep); }
.info { display: flex; gap: 12px; align-items: center; margin-top: 8px; padding: 14px 16px; background: var(--paper); border-radius: var(--radius); font-size: 1rem; }
.info i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.info.tip { background: var(--accent-soft); border: 1px solid #FFD3B0; }
.info.tip i { background: var(--accent); }
.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.actions .btn { flex: 1; min-width: 200px; }

/* Order step */
.order-summary { background: var(--navy); color: var(--white); border-radius: 14px; padding: 26px 30px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 24px 0; }
.order-summary .label { color: #A9B6C8; display: block; margin-bottom: 6px; }
.order-summary b { font-family: var(--f-display); font-weight: 500; font-size: 1.4rem; text-transform: uppercase; }
.order-summary small { display: block; color: #D3DBE7; margin-top: 4px; font-size: 0.95rem; }
.order-summary .total b { color: var(--accent); font-size: 2rem; font-weight: 600; }
.drop {
  display: grid; place-items: center; text-align: center; gap: 8px; padding: 36px 20px;
  border: 2px dashed var(--line); border-radius: 12px; background: var(--paper); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 36px; height: 36px; color: var(--accent); }
.drop b { font-size: 1.125rem; }
.drop span { color: var(--muted); font-size: 0.95rem; }
.drop.invalid { border-color: var(--err); background: #FDF1F1; }
.drop.has-file { border-style: solid; border-color: var(--ok); background: #F0FAF3; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 1rem; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check input[aria-invalid="true"] { outline: 2px solid var(--err); outline-offset: 2px; }
/* Order confirmation popup */
.done { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 18px; color: var(--ink); background: var(--white); box-shadow: 0 40px 80px -30px rgba(7,37,74,.6); overflow: auto; }
.done::backdrop { background: rgba(7,37,74,.72); backdrop-filter: blur(3px); }
.done[open] { animation: done-in .25s ease-out; }
@keyframes done-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .done[open] { animation: none; } }
.done-head { background: var(--navy); color: var(--white); padding: 36px 36px 30px; text-align: center; display: grid; justify-items: center; gap: 6px; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--navy); display: grid; place-items: center; margin-bottom: 8px; }
.done-icon svg { width: 34px; height: 34px; }
.done-head .eyebrow { color: var(--accent); margin: 0; }
.done-head .eyebrow::before { display: none; }
.done-head h2 { font-size: clamp(1.9rem, 5vw, 2.6rem); color: var(--white); }
.done-head p:last-child { color: #D3DBE7; font-size: 1.0625rem; max-width: 46ch; }
.done-sum { margin: 0; padding: 22px 36px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; border-bottom: 1px solid var(--line); }
.done-sum dt { color: var(--muted); font-weight: 700; }
.done-sum dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.done-sum dd.big { font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; }
.done-sub { padding: 22px 36px 6px; font-size: 1.25rem; }
.done-steps { list-style: none; counter-reset: s; margin: 0; padding: 0 36px; display: grid; gap: 12px; }
.done-steps li { counter-increment: s; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; }
.done-steps li::before { content: counter(s); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; display: grid; place-items: center; }
.done-steps span { color: var(--muted); }
.done-help { margin: 20px 36px 0; padding: 14px 16px; background: var(--paper); border-radius: var(--radius); }
.done-help a { font-weight: 800; color: var(--navy); }
.done-actions { display: flex; gap: 12px; flex-wrap: wrap; padding: 22px 36px 30px; }
@media (max-width: 520px) {
  .done-head { padding: 28px 22px 24px; }
  .done-sum, .done-sub, .done-actions { padding-left: 22px; padding-right: 22px; }
  .done-steps { padding: 0 22px; }
  .done-help { margin: 18px 22px 0; }
  .done-sum { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .done-sum dd { margin-bottom: 8px; }
  .done-actions .btn { flex: 1 1 100%; }
}
.status { white-space: pre-line; padding: 16px; border-radius: var(--radius); background: var(--paper); font-size: 1rem; }
.status:empty { display: none; }
.status.ok { background: #F0FAF3; border: 1px solid #A7DDB8; }

@media (min-width: 961px) and (min-height: 1040px) { .preview { position: sticky; top: 112px; } }
@media (max-width: 960px) { .calc-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .panel, .preview { padding: 24px 18px; }
  .bc-fields, .delivery-toggle { grid-template-columns: 1fr; }
  .stepper button { padding: 12px 14px; font-size: 0.95rem; }
  .row.total b { font-size: 2.1rem; }
  .size-row { grid-template-columns: 1fr 1fr; } .size-row .x { display: none; }
}
