/* /kassa: summary left, Stripe's payment form right (below on mobile).
   Landing tokens (landing-clone.css) so the page reads as the same product. */
:root {
  --ink: #080928;
  --paper: #fffdf1;
  --red: #a82b31;
  --red-dark: #8c2228;
  --line: #dedbcc;
  --panel: #f9e6e2;
  --muted: #5d5d73;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { overflow-x: clip; }
body {
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: "Poppins", "Rubik", system-ui, sans-serif; margin: 0; letter-spacing: -0.01em; }
a { color: inherit; }
button { font-family: inherit; }
[hidden] { display: none !important; }

.kassa { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; min-height: 100dvh; }

/* ── Left: order summary ─────────────────────────────────── */
.kassa-summary { background: var(--panel); padding: 40px 32px; display: flex; justify-content: flex-end; }
.kassa-summary__inner { width: 100%; max-width: 440px; }
.kassa-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.kassa-logo img { display: block; }
.kassa-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 500; text-decoration: none;
  background: var(--paper); border-radius: 999px; padding: 8px 14px 8px 10px;
}
.kassa-back:hover { background: #fff; }

.order-card {
  background: var(--paper); border-radius: 18px; padding: 22px 22px 18px;
  box-shadow: 0 1px 0 rgba(8, 9, 40, 0.04), 0 10px 30px rgba(8, 9, 40, 0.06);
}
.order-card__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.order-card h1 { font-size: 24px; line-height: 1.2; }
.order-card__head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.order-card__price { font-family: "Poppins", sans-serif; font-size: 22px; white-space: nowrap; }
.order-card__list { list-style: none; margin: 18px 0 16px; padding: 0; display: grid; gap: 12px; }
.order-card__list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.ico { flex: none; width: 22px; height: 22px; margin-top: 0; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.order-card__foot {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.order-card__valid { margin: 0; font-size: 14px; color: var(--muted); }
.order-card__valid b { color: var(--ink); font-weight: 500; }
.order-card__guarantee { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.4; color: var(--muted); }
.order-card__guarantee b { color: var(--ink); font-weight: 600; }

/* Language ("which course") picker, the counterpart of Lara's "Vaihda kurssi" */
.lang-pick { flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 16px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.pill b { font-weight: 600; }
.pill svg { transition: transform 150ms ease-out; }
.pill[aria-expanded="true"] svg { transform: rotate(180deg); }
.pill:hover { background: #fff; }
.lang-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(8, 9, 40, 0.16);
}
.lang-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 9px; background: none; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer;
}
.lang-menu button span { display: grid; gap: 1px; }
.lang-menu button b { font-weight: 600; }
.lang-menu button small { font-size: 12px; color: var(--muted); }
.lang-menu button:hover, .lang-menu button:focus-visible { background: #f6f1e4; outline: none; }
.lang-menu button[aria-selected="true"]::after {
  content: ""; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a82b31' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Discount code row */
.promo { margin-top: 14px; }
.promo__row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; background: transparent;
  border: 1.5px dashed rgba(8, 9, 40, 0.28); border-radius: 14px; font-size: 15px; color: var(--ink); cursor: pointer; text-align: left;
}
.promo__row:hover { background: rgba(255, 253, 241, 0.6); }
.promo__text { flex: 1; }
.promo__cta { color: var(--red); font-weight: 600; white-space: nowrap; }
.promo__form { display: flex; gap: 8px; margin-top: 10px; }
.promo__form input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; font: inherit; font-size: 16px; text-transform: uppercase; color: var(--ink);
}
.promo__form input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(8, 9, 40, 0.1); }
.promo__apply {
  height: 46px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--ink); color: var(--paper);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.promo__apply:disabled { opacity: 0.6; cursor: progress; }
.promo__msg { margin: 8px 2px 0; font-size: 14px; color: var(--muted); }
.promo__msg.is-ok { color: #1d6b3a; font-weight: 500; }
.promo__msg.is-bad { color: var(--red-dark); font-weight: 500; }
.promo__msg button { margin-left: 8px; padding: 0; border: 0; background: none; font-size: 14px; color: var(--red); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.order-total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 24px; padding-top: 22px; border-top: 1px solid rgba(8, 9, 40, 0.14);
}
.order-total > span { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 18px; }
.order-total__sum { display: flex; align-items: baseline; gap: 10px; }
.order-total__sum s { font-size: 16px; color: var(--muted); }
.order-total strong { font-family: "Poppins", sans-serif; font-size: 32px; }
.order-total__note { margin: 4px 0 0; text-align: right; font-size: 13px; color: var(--muted); }

/* ── Right: payment ──────────────────────────────────────── */
.kassa-pay { padding: 40px 32px; display: flex; justify-content: flex-start; }
.kassa-pay__inner { width: 100%; max-width: 440px; }
.pay-title { font-size: 22px; margin-bottom: 16px; }
#checkout { min-height: 180px; }

.skeleton { display: grid; gap: 14px; }
.skeleton i { display: block; height: 52px; border-radius: 12px; background: #f1ead6; animation: kassa-pulse 1.3s ease-in-out infinite; }
.skeleton i:nth-child(2) { height: 150px; }
.skeleton .skeleton__btn { height: 54px; border-radius: 999px; margin-top: 6px; }
@keyframes kassa-pulse { 50% { opacity: 0.55; } }

.pay-error { padding: 18px; border-radius: 14px; background: #fbe9e7; }
.pay-error p { margin: 0 0 12px; font-size: 15px; color: var(--red-dark); font-weight: 500; line-height: 1.45; }

.btn-pay {
  display: flex; align-items: center; justify-content: center; height: 52px; padding: 0 28px; border: 0;
  border-radius: 999px; background: var(--red); color: #fffdf1; font-size: 16px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background-color 120ms ease-out, transform 120ms ease-out;
}
.btn-pay:hover { background: var(--red-dark); }
.btn-pay:active { transform: scale(0.98); }
.btn-pay:focus-visible, .btn-ghost:focus-visible, .pill:focus-visible, .promo__row:focus-visible, .promo__apply:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn-pay--link { margin-top: 18px; width: 100%; }

.panel--done h2 { font-size: 22px; margin-bottom: 14px; }
.panel--done p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--muted); }

.trust { margin-top: 26px; text-align: center; }
.trust__line { margin: 0; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--red-dark); }
.trust__sub { margin: 6px auto 14px; max-width: 360px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.legal { margin: 0 auto 16px; max-width: 360px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.legal a { color: var(--muted); text-underline-offset: 2px; }
.legal a:hover { color: var(--ink); }
.btn-ghost {
  appearance: none; background: transparent; border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 11px 22px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.btn-ghost:hover { background: rgba(8, 9, 40, 0.05); }

.kassa-foot { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.kassa-foot a { font-size: 13px; color: var(--muted); text-decoration: none; }
.kassa-foot a:hover { text-decoration: underline; }

/* ── Mobile sticky bar: total + "Jatka maksuun" ───────────── */
.sticky-bar { display: none; }
.method-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.method-chips li {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 32px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.method-chips img { display: block; width: auto; height: auto; max-width: 34px; max-height: 18px; }
.method-chips .chip--klarna { background: #ffb3c7; border-color: #ffb3c7; }
.method-chips .chip--klarna img { max-height: 15px; }
.method-chips--inline { margin-top: 14px; }

@media (max-width: 860px) {
  .kassa { grid-template-columns: 1fr; }
  .kassa-summary { padding: 20px 18px 24px; justify-content: stretch; }
  .kassa-top { margin-bottom: 18px; }
  .order-card { padding: 18px 18px 14px; }
  .order-card h1 { font-size: 21px; }
  .order-total { margin-top: 18px; padding-top: 16px; }
  .order-total strong { font-size: 26px; }
  .kassa-pay { padding: 26px 18px 150px; justify-content: stretch; }
  .order-card__foot { flex-wrap: wrap; }

  .sticky-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--paper);
    border-radius: 20px 20px 0 0; box-shadow: 0 -8px 28px rgba(8, 9, 40, 0.14);
    transition: transform 200ms ease-out;
  }
  .sticky-bar__row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
  .sticky-bar__sum { display: grid; line-height: 1.15; }
  .sticky-bar__sum span { font-size: 13px; color: var(--muted); }
  .sticky-bar__sum strong { font-family: "Poppins", sans-serif; font-size: 22px; }
  .sticky-bar .btn-pay { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-pay, .sticky-bar, .pill svg { transition: none; }
  .skeleton i { animation: none; }
}

/* ── Two steps: 1/2 Tilaus (details), 2/2 Maksu (payment page) ───────────── */
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.steps__bar { display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 8px; }
.steps__item.is-active .steps__bar, .steps__item.is-done .steps__bar { background: var(--red); }
.steps__label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.steps__item.is-active .steps__label { color: var(--ink); }
.steps__label b { font-weight: 600; }
.steps__item.is-done .steps__label b { font-size: 0; }
.steps__item.is-done .steps__label b::before {
  content: ""; display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a82b31' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.panel h2 { font-size: 22px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field input {
  width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; font: inherit; font-size: 16px; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(8, 9, 40, 0.1); }
.field input[readonly] { background: #f4f1e3; color: var(--muted); }
.field__hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.form-error { margin: 0 0 14px; font-size: 14px; color: var(--red-dark); font-weight: 500; line-height: 1.45; }

.btn-pay--inline { width: 100%; }
.btn-pay--full { width: 100%; gap: 10px; }
.btn-pay { gap: 10px; }
.btn-pay svg { flex: none; }
.btn-pay b { font-weight: 700; }
.btn-pay:disabled { opacity: 0.6; cursor: progress; }

.mini-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px;
  padding: 14px 16px; background: var(--panel); border-radius: 16px;
}
.mini-summary > div { display: grid; gap: 2px; }
.mini-summary strong { font-family: "Poppins", sans-serif; font-size: 16px; }
.mini-summary span { font-size: 14px; color: var(--muted); }
.mini-summary b { color: var(--ink); }

#pay-element { min-height: 160px; }
.skeleton { display: grid; gap: 12px; }
.skeleton i { display: block; height: 58px; border-radius: 14px; background: #f1ead6; animation: kassa-pulse 1.3s ease-in-out infinite; }
@keyframes kassa-pulse { 50% { opacity: 0.55; } }

.or { display: flex; align-items: center; gap: 14px; margin: 22px 0 16px; color: var(--muted); font-size: 15px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#express-element { min-height: 0; }

.consent {
  display: flex; gap: 12px; align-items: flex-start; margin: 22px 0 16px; padding: 16px;
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font-size: 15px; line-height: 1.5; cursor: pointer;
}
.consent input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--red); cursor: pointer; }
.consent a { color: var(--ink); text-underline-offset: 2px; }
.consent small { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

/* sticky bar states */
#sticky-bar [hidden] { display: none !important; }
@media (max-width: 860px) {
  .kassa[data-step="2"] .kassa-summary { display: none; }
  .btn-pay--inline, .method-chips--inline { display: none; }
  .kassa-pay { padding-top: 22px; }
  .steps { margin-bottom: 18px; }
}
