@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --cobalt: #2531e8;
  --cobalt-deep: #1620a8;
  --ink: #0b1030;
  --paper: #ffffff;
  --sun: #ffd84d;
  --mist: #c9ceff;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--cobalt);
  color: var(--paper);
  font-family: "Bricolage", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- layout ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(32px, 8vw, 96px) var(--gutter) 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-content: start;
  justify-items: center;
  text-align: center;
}

.lead__kicker {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--sun);
}

.lead__name {
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.lead__hint {
  margin: 20px auto 0;
  color: var(--mist);
  max-width: 36ch;
}

/* ---------- payment slips ---------- */

.methods {
  list-style: none;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 14px;
}

.slip {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 88px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, transform 0.15s;
}

.slip__main {
  flex: 1;
  min-width: 0;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.slip__method {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.slip__detail {
  margin-top: 4px;
  font-size: 0.95rem;
  color: #4a5085;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.slip__act {
  flex: none;
  min-width: 104px;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-left: 2px dashed var(--mist);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.slip__act svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* tutte le card hanno la stessa altezza: la più alta decide per tutte */
.methods { grid-auto-rows: 1fr; }
.methods > li { display: flex; }
.slip { height: 100%; min-height: 120px; }

.slip:active { transform: scale(0.985); }

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg) scale(1.15); }
  75% { transform: rotate(12deg) scale(1.15); }
}

.slip.is-active .slip__act svg { animation: wiggle 0.5s ease-in-out; }
.slip.is-active { transform: rotate(-0.7deg); }

.slip:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.slip.is-active { background: var(--sun); }
.slip.is-active .slip__act { border-left-color: var(--ink); }
.slip.is-active .slip__detail { color: var(--ink); }

/* ---------- QR panel (desktop pointer only) ---------- */

.qr {
  display: none;
  background: var(--paper);
  color: var(--ink);
  border-radius: 28px;
  padding: 28px;
  text-align: center;
  width: 100%;
  max-width: 340px;
}

.qr__code {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}

.qr__code svg { display: block; width: 100%; height: 100%; }

.qr__title {
  margin-top: 20px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.qr__hint {
  margin-top: 2px;
  font-size: 0.95rem;
  color: #4a5085;
}

.only-pointer { display: none; }

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .qr:not([hidden]) { display: block; }
  .only-touch { display: none; }
  .only-pointer { display: inline; }

  .methods {
    max-width: 880px;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .slip {
    flex-direction: column;
    text-align: center;
    min-height: 260px;
  }
  .slip__main { align-items: center; padding: 28px 20px 20px; }
  .slip__act {
    flex-direction: row;
    justify-content: center;
    min-width: 0;
    padding: 16px 18px;
    border-left: 0;
    border-top: 2px dashed var(--mist);
  }

  .slip:hover { background: var(--sun); }
  .slip:hover .slip__act { border-top-color: var(--ink); }
  .slip:hover .slip__detail { color: var(--ink); }
  .slip.is-active .slip__act { border-top-color: var(--ink); }
}

/* ---------- small bits ---------- */

.foot {
  padding: 16px var(--gutter) 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--mist);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 24px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- colori e loghi dei metodi ---------- */

.slip[data-brand="paypal"]  { --card: #003087; --fg: #ffffff; --soft: rgba(255,255,255,.78); --line: rgba(255,255,255,.35); }
.slip[data-brand="revolut"] { --card: #191c1f; --fg: #ffffff; --soft: rgba(255,255,255,.78); --line: rgba(255,255,255,.35); }
.slip[data-brand="iban"]    { --card: var(--sun); --fg: var(--ink); --soft: rgba(11,16,48,.78); --line: rgba(11,16,48,.35); }

.slip[data-brand] {
  background: var(--card);
  color: var(--fg);
}
.slip[data-brand] .slip__detail { color: var(--soft); }
.slip[data-brand] .slip__act { border-color: var(--line); }

.slip[data-brand].is-active {
  background: var(--card);
  box-shadow: 0 0 0 4px var(--paper);
}

.slip__logo {
  flex: none;
  align-self: center;
  width: 44px;
  height: 44px;
  margin-left: 18px;
  display: grid;
  place-items: center;
}
.slip__logo svg { display: block; width: 100%; height: 100%; }
.slip__logo + .slip__main { padding-left: 16px; }

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .slip[data-brand]:hover {
    background: var(--card);
    box-shadow: 0 0 0 4px var(--paper);
  }
  .slip__logo {
    width: 56px;
    height: 56px;
    margin: 28px 0 0;
  }
  .slip__logo + .slip__main { padding: 16px 20px 20px; }
}
