/*
 * Purchase wizard (/order/{domain}) - its own design from the accepted mockup CLAUDE/specs/makiety/Kreator-zakupu.html
 * (CLAUDE.md: the sales page and the wizard are the exception to "Bootstrap only"). Colours come from the site's
 * Bootstrap variables and --mgn-accent, so the light/dark switch (data-bs-theme) works without overrides.
 */
.order-app {
    --o-surface: var(--bs-main-bg);
    --o-soft: var(--bs-tertiary-bg);
    --o-ink: var(--bs-body-color);
    --o-ink-2: var(--bs-secondary-color);
    --o-line: var(--bs-border-color);
    --o-accent: var(--mgn-accent);
    --o-accent-ink: #fff;
    --o-accent-soft: color-mix(in srgb, var(--mgn-accent) 13%, var(--bs-main-bg));
    --o-good: var(--bs-success-text-emphasis);
    --o-bad: var(--bs-danger-text-emphasis);
    --o-taken: color-mix(in srgb, var(--bs-body-color) 8%, var(--bs-body-bg));
    background: var(--o-surface);
    border: 1px solid var(--o-line);
    border-radius: 14px;
    overflow: hidden;
    color: var(--o-ink);
}
[data-bs-theme=dark] .order-app { --o-accent-soft: color-mix(in srgb, var(--mgn-accent) 20%, var(--bs-main-bg)); }
.order-app h2 { font-size: 1.625rem; line-height: 1.2; margin: 0 0 6px; }
.order-app h3 { font-size: 1rem; font-weight: 600; margin: 0 0 10px; }
.order-small { font-size: .8125rem; }
.order-muted { color: var(--o-ink-2); }
.order-lead { color: var(--o-ink-2); margin: 0 0 20px; line-height: 1.55; max-width: 62ch; }

/* top bar with the steps */
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--o-line); }
.order-brand { font-weight: 700; }
.order-brand small { font-weight: 400; color: var(--o-ink-2); margin-left: 6px; }
.order-steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: .8125rem; color: var(--o-ink-2); flex-wrap: wrap; }
.order-steps li { display: flex; align-items: center; gap: 6px; }
.order-steps li + li::before { content: ""; width: 18px; height: 1px; background: var(--o-line); margin-right: 2px; }
.order-steps b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--o-line); font-weight: 600; font-size: .75rem; }
.order-steps .is-on { color: var(--o-ink); font-weight: 600; }
.order-steps .is-on b { background: var(--o-accent); border-color: var(--o-accent); color: var(--o-accent-ink); }
.order-steps .is-done { cursor: pointer; }
.order-steps .is-done b { background: var(--o-accent-soft); border-color: var(--o-accent-soft); color: var(--o-accent); }

/* screens: content + summary column */
.order-screen { display: none; }
.order-screen.is-on { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding: 28px 24px 32px; }
.order-card { background: var(--o-surface); border: 1px solid var(--o-line); border-radius: 12px; padding: 18px; }
.order-card + .order-card { margin-top: 16px; }
.order-side { align-self: start; position: sticky; top: 16px; }
.order-summary { align-self: start; position: sticky; top: 16px; }
.order-side .order-summary { position: static; }
@media (max-width: 1100px) {
    .order-screen.is-on { grid-template-columns: minmax(0, 1fr); }
    .order-summary, .order-side { position: static; }
}
@media (max-width: 640px) {
    .order-top { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
    .order-steps li:not(.is-on) span { display: none; }
    .order-steps li + li::before { width: 10px; }
    .order-screen.is-on { padding: 20px 16px 24px; }
    .order-app h2 { font-size: 1.375rem; }
    .cal-day small { display: none; }
}

/* bottom bar with the total and the next step - only where the summary sits below the content */
.order-bar { display: none; }
@media (max-width: 1100px) {
    .order-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020; box-shadow: 0 -6px 20px rgba(0, 0, 0, .12); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--o-surface); border-top: 1px solid var(--o-line); }
    .order-app { margin-bottom: 72px; }
    .order-bar .order-btn { width: auto; margin: 0; padding: 11px 16px; }
    .order-bar small { display: block; color: var(--o-ink-2); font-size: .75rem; }
    .order-bar b { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
}

/* messages */
.order-info, .order-alert { margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: .8125rem; }
.order-info { background: var(--o-accent-soft); }
.order-alert { background: var(--bs-danger-bg-subtle); color: var(--o-bad); }
.order-app .invalid-feedback { display: block; color: var(--o-bad); font-size: .8125rem; margin: 0; }

/* calendar */
.cal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-nav { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--o-line); background: var(--o-surface); color: var(--o-ink); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.cal-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 640px) { .cal-months { grid-template-columns: 1fr; } }
.cal-month h4 { margin: 0 0 8px; font-size: .875rem; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: .6875rem; color: var(--o-ink-2); text-align: center; padding-bottom: 4px; }
.cal-day { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--o-line); background: var(--o-surface); color: var(--o-ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: .8125rem; padding: 0; min-width: 0; }
.cal-day small { font-size: .6rem; color: var(--o-ink-2); white-space: nowrap; }
.cal-day:hover:not(:disabled) { border-color: var(--o-accent); }
.cal-day:focus-visible { outline: 2px solid var(--o-accent); outline-offset: 1px; }
.cal-day:disabled { cursor: default; }
.cal-day.is-past { color: var(--o-ink-2); background: none; border-color: transparent; opacity: .6; }
.cal-day.is-taken { background: var(--o-taken); border-color: transparent; color: var(--o-ink-2); text-decoration: line-through; }
.cal-day.is-blocked { background: repeating-linear-gradient(135deg, var(--o-taken) 0 5px, transparent 5px 10px); border-color: transparent; color: var(--o-ink-2); }
.cal-day.is-sel { background: var(--o-accent); border-color: var(--o-accent); color: var(--o-accent-ink); font-weight: 600; }
.cal-day.is-sel small { color: var(--o-accent-ink); opacity: .85; }
.cal-day.is-anchor { box-shadow: 0 0 0 2px var(--o-surface), 0 0 0 4px var(--o-accent); }
.cal-day.is-empty { visibility: hidden; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: .75rem; color: var(--o-ink-2); }
.cal-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; border: 1px solid var(--o-line); }
.cal-legend .l-free { background: var(--o-surface); }
.cal-legend .l-sel { background: var(--o-accent); border-color: var(--o-accent); }
.cal-legend .l-taken { background: var(--o-taken); border-color: transparent; }
.cal-legend .l-blocked { background: repeating-linear-gradient(135deg, var(--o-taken) 0 3px, transparent 3px 6px); }
.cal-picked { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--o-line); font-size: .8125rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cal-picked .chip { display: inline-flex; align-items: center; gap: 6px; background: var(--o-accent-soft); border-radius: 20px; padding: 4px 6px 4px 10px; }
.cal-picked .chip button { border: 0; background: none; color: var(--o-ink-2); cursor: pointer; font-size: .95rem; line-height: 1; padding: 0 4px; border-radius: 50%; }
.cal-picked .chip button:hover { color: var(--o-bad); }
.cal-picked .clear { border: 0; background: none; color: var(--o-ink-2); text-decoration: underline; cursor: pointer; font-size: .8125rem; margin-left: auto; }

/* summary */
.sum-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; font-size: .875rem; margin: 0; }
.sum-rows dt { color: var(--o-ink-2); font-weight: 400; white-space: nowrap; }
.sum-rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sum-rows .total { font-weight: 700; font-size: 1.125rem; color: var(--o-ink); padding-top: 8px; border-top: 1px solid var(--o-line); }
.sum-rows .disc { color: var(--o-good); }
.sum-rows .vat { font-size: .75rem; color: var(--o-ink-2); }
.forecast { margin-top: 16px; padding: 12px; border-radius: 10px; background: var(--o-soft); font-size: .8125rem; line-height: 1.55; }
.forecast b { font-size: .9375rem; }
.order-btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 13px 18px; margin-top: 16px; background: var(--o-accent); color: var(--o-accent-ink); font-weight: 600; cursor: pointer; text-decoration: none; }
.order-btn:hover { background: var(--mgn-accent-hover); color: var(--o-accent-ink); }
.order-btn:disabled { opacity: .4; cursor: default; }
.order-btn-ghost { background: none; color: var(--o-ink); border: 1px solid var(--o-line); margin-top: 8px; }
.order-btn-ghost:hover { background: var(--o-soft); color: var(--o-ink); }
.pay-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pay-methods span { border: 1px solid var(--o-line); border-radius: 8px; padding: 6px 10px; font-size: .75rem; font-weight: 600; }

/* the ad: drop zone, uploaded images */
.drop { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; border: 1.5px dashed var(--o-line); border-radius: 12px; padding: 28px 18px; cursor: pointer; background: var(--o-soft); }
.drop:hover, .drop.is-over { border-color: var(--o-accent); }
.drop.is-busy { opacity: .6; pointer-events: none; }
.drop-title { font-weight: 600; }
.drop-button { display: inline-block; padding: 9px 16px; border-radius: 10px; background: var(--o-accent); color: var(--o-accent-ink); font-weight: 600; font-size: .875rem; }
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.uploads:empty { display: none; }
@media (max-width: 640px) { .uploads { grid-template-columns: 1fr; } }
.upload { border: 1px solid var(--o-line); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: start; }
.upload.is-empty { border-style: dashed; }
.upload .thumb { width: 72px; height: 72px; border-radius: 6px; background: var(--o-soft); display: grid; place-items: center; overflow: hidden; }
.upload .thumb img { max-width: 100%; max-height: 100%; display: block; }
.upload h4 { margin: 0 0 2px; font-size: .875rem; font-weight: 600; }
.upload .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload .links { margin-top: 6px; display: flex; gap: 12px; }
.upload .links button { border: 0; background: none; padding: 0; color: var(--o-accent); font-size: .8125rem; cursor: pointer; text-decoration: underline; }
.upload .links button:disabled { opacity: .4; cursor: default; }
/* a video on its way (mockup Kreator-wideo.html): the share sent, then the server's conversion */
.upload .thumb { position: relative; }
.upload .thumb .len { position: absolute; right: 4px; bottom: 4px; font-size: 10px; line-height: 1; color: #fff; background: rgba(0, 0, 0, .6); border-radius: 4px; padding: 3px 4px; }
.bar { height: 6px; border-radius: 3px; background: var(--o-soft); overflow: hidden; margin: 8px 0 6px; }
.bar i { display: block; height: 100%; background: var(--o-accent); border-radius: 3px; transition: width .2s; }
.bar.is-wait i { width: 35%; animation: order-wait 1.4s ease-in-out infinite; }
@keyframes order-wait { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--o-line); border-top-color: var(--o-accent); animation: order-spin .8s linear infinite; }
@keyframes order-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bar.is-wait i, .spin { animation-duration: 3s; } }

/* fields */
.field { display: grid; gap: 6px; margin-top: 16px; }
.field.mt-0 { margin-top: 0; }
.field label, .field-label { font-size: .8125rem; font-weight: 600; }
.field .hint { font-size: .75rem; color: var(--o-ink-2); }
.input { width: 100%; border: 1px solid var(--o-line); border-radius: 8px; padding: 10px 12px; background: var(--o-surface); color: var(--o-ink); }
.input:focus { outline: 2px solid var(--o-accent); outline-offset: -1px; border-color: transparent; }
.input.is-invalid { border-color: var(--o-bad); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-zip { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } .row-zip { grid-template-columns: 110px 1fr; } }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--o-surface); box-shadow: 0 0 0 1px var(--o-line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--o-accent); }
.swatch-custom { position: relative; overflow: hidden; background: conic-gradient(#e33, #ec3, #3c5, #3ad, #63e, #e33); }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .8125rem; line-height: 1.5; margin-top: 12px; }
.check input { margin-top: 3px; flex-shrink: 0; }
.seg { display: inline-flex; border: 1px solid var(--o-line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--o-surface); color: var(--o-ink); padding: 6px 10px; font-size: .75rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--o-accent); color: var(--o-accent-ink); }
.seg-choice { margin-bottom: 4px; }
.seg-choice label { cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.seg-choice span { display: block; padding: 7px 14px; font-size: .8125rem; }
.seg-choice input:checked + span { background: var(--o-accent); color: var(--o-accent-ink); }
.seg-choice input:focus-visible + span { outline: 2px solid var(--o-accent); outline-offset: -2px; }
.video-fit { display: flex; align-items: center; gap: 12px; font-size: .875rem; }
.video-fit > span { min-width: 90px; }
.video-fit .seg-choice { margin-bottom: 0; }
/* the same buttons as the preview's computer / phone switch */
.video-fit .seg-choice label { display: block; margin: 0; font-weight: 400; }
.video-fit .seg-choice span { padding: 6px 10px; font-size: .75rem; line-height: 1.5; }

/* preview: the place on the site with the ad fitted, never cropped */
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.preview-head h3 { margin: 0; }
.preview { border-radius: 10px; background: #111; padding: 12px; display: grid; place-items: center; }
.preview-frame { position: relative; display: grid; place-items: center; width: 100%; overflow: hidden; border-radius: 4px; }
.preview-frame img { max-width: 100%; max-height: 100%; display: block; }
.preview-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-frame .label { position: absolute; top: 6px; left: 6px; font-size: 10px; line-height: 1; color: #fff; background: rgba(0, 0, 0, .55); border-radius: 20px; padding: 4px 7px; }
.preview-frame .empty { color: rgba(255, 255, 255, .6); font-size: .8125rem; padding: 12px; text-align: center; }

/* done page */
.done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--bs-success); color: #fff; display: grid; place-items: center; font-size: 28px; margin-bottom: 14px; }
.done-icon.is-wait { background: var(--o-accent-soft); color: var(--o-accent); }
.timeline { list-style: none; padding: 0; margin: 20px 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-bottom: 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--o-line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--o-line); background: var(--o-surface); display: grid; place-items: center; font-size: .8125rem; }
.timeline .is-done .dot { background: var(--bs-success); border-color: var(--bs-success); color: #fff; }
.timeline .is-now .dot { border-color: var(--o-accent); color: var(--o-accent); }
.timeline b { display: block; }
.timeline small { color: var(--o-ink-2); font-size: .8125rem; }
.done-wrap { max-width: 720px; margin: 0 auto; padding: 32px 24px; }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.done-actions .order-btn { width: auto; margin-top: 0; }
