/* Papa J's lahjakortti – minimalistinen ostolomake ja saldokysely.
   Värit sivustolta: laventeli #99ACFF, sininen #1800AD, lime-kerma #E9F7C3, musta #181818. */
.pgc {
  --pgc-ink: #181818;
  --pgc-muted: #55594f;
  --pgc-surface: #E9F7C3;
  --pgc-field: #ffffff;
  --pgc-line: rgba(24, 24, 24, .18);
  --pgc-accent: #1800AD;
  --pgc-accent-ink: #ffffff;
  --pgc-error: #b3261e;
  --pgc-radius: 14px;
  --pgc-serif: "Playfair Display", Georgia, serif;
  --pgc-sans: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;

  box-sizing: border-box;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px);
  background: var(--pgc-surface);
  border-radius: 28px;
  color: var(--pgc-ink);
  font-family: var(--pgc-sans);
  font-size: 16px;
  line-height: 1.5;
}
.pgc *, .pgc *::before, .pgc *::after { box-sizing: border-box; }
.pgc--narrow { max-width: 560px; }

.pgc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

/* ── Esikatselu ── */
.pgc-preview-col { position: sticky; top: 24px; }
.pgc-card {
  margin: 0;
  aspect-ratio: 1050 / 600;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(24, 0, 173, .45);
  background: #0C3327;
}
.pgc-card-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pgc-card-plain {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7% 8%;
  background: #0C3327;
  color: #FFF900;
}
.pgc-card-brand { font-family: var(--pgc-serif); font-size: clamp(20px, 3vw, 30px); }
.pgc-card-amount { font-family: Britney, var(--pgc-serif); font-size: clamp(44px, 7vw, 84px); line-height: 1; font-variant-numeric: tabular-nums; }
.pgc-card[hidden], .pgc-card-img[hidden], .pgc-card-plain[hidden] { display: none; }

.pgc-card-meta { margin: 20px 0 0; display: grid; gap: 6px; }
.pgc-card-meta div { display: flex; gap: 12px; }
.pgc-card-meta dt { width: 72px; flex: none; color: var(--pgc-muted); font-size: 14px; }
.pgc-card-meta dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.pgc-trust { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--pgc-line); display: grid; gap: 6px; font-size: 14px; color: var(--pgc-muted); }
.pgc-trust li { padding-left: 22px; position: relative; }
.pgc-trust li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 10px; height: 6px; border-left: 2px solid var(--pgc-accent); border-bottom: 2px solid var(--pgc-accent); transform: rotate(-45deg); }

/* ── Lomake ── */
.pgc-form { margin: 0; }
.pgc-section { border: 0; margin: 0 0 28px; padding: 0; min-width: 0; }
.pgc-section legend, .pgc-title {
  padding: 0;
  margin: 0 0 14px;
  font-family: var(--pgc-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--pgc-ink);
  letter-spacing: 0;
  text-transform: none;
}
.pgc-title { font-size: 28px; margin-bottom: 6px; }

.pgc-field { margin-top: 14px; }
.pgc-field > label, .pgc-label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--pgc-ink); }
.pgc-hint { font-size: 14px; font-weight: 400; color: var(--pgc-muted); margin: 6px 0 0; }
.pgc-field > label .pgc-hint { margin: 0; }

.pgc input[type="text"], .pgc input[type="email"], .pgc input[type="number"], .pgc input[type="date"], .pgc textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--pgc-line);
  border-radius: 10px;
  background: var(--pgc-field);
  color: var(--pgc-ink);
  font: inherit;
  font-size: 17px;
  box-shadow: none;
  transition: border-color .15s ease;
}
.pgc textarea { min-height: 96px; resize: vertical; }
.pgc input:hover, .pgc textarea:hover { border-color: rgba(24, 24, 24, .4); }
.pgc input:focus, .pgc textarea:focus { outline: none; border-color: var(--pgc-accent); box-shadow: 0 0 0 3px rgba(24, 0, 173, .18); }
.pgc input::placeholder, .pgc textarea::placeholder { color: #8a8d84; }
.pgc [aria-invalid="true"] { border-color: var(--pgc-error); }

.pgc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Summapainikkeet */
.pgc-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pgc-chip {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 8px 10px;
  border: 1.5px solid var(--pgc-line); border-radius: 12px;
  background: var(--pgc-field);
  font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: pointer; user-select: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.pgc-chip:hover { border-color: var(--pgc-ink); }
.pgc-sr:checked + .pgc-chip { background: var(--pgc-accent); border-color: var(--pgc-accent); color: var(--pgc-accent-ink); }
.pgc-sr:focus-visible + .pgc-chip, .pgc-sr:focus-visible + label { outline: 3px solid var(--pgc-accent); outline-offset: 2px; }
.pgc-custom { max-width: 220px; }
.pgc-input-suffix { position: relative; }
.pgc-input-suffix input { padding-right: 36px; }
.pgc-input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--pgc-muted); pointer-events: none; }

/* Segmenttivalitsin */
.pgc-segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px; background: rgba(24, 24, 24, .07); border-radius: 12px; }
.pgc-segment label { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 6px 10px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--pgc-muted); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.pgc-segment .pgc-sr:checked + label { background: var(--pgc-field); color: var(--pgc-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.pgc-segment--small { max-width: 320px; }
.pgc-date { margin-top: 10px; max-width: 320px; }

.pgc-counter { display: block; text-align: right; font-size: 13px; color: var(--pgc-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

.pgc-error { margin: 8px 0 0; color: var(--pgc-error); font-size: 14px; font-weight: 500; }
.pgc-error--form { padding: 12px 14px; background: #fdecea; border-radius: 10px; margin-bottom: 20px; }

/* Maksupainike */
.pgc-submit {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 58px; margin: 8px 0 0; padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--pgc-accent); color: var(--pgc-accent-ink);
  font-family: var(--pgc-sans); font-size: 17px; font-weight: 600; letter-spacing: 0; text-transform: none;
  cursor: pointer;
  transition: transform .1s ease, background-color .15s ease;
}
.pgc-submit:hover { background: #12008a; color: var(--pgc-accent-ink); }
.pgc-submit:active { transform: scale(.99); }
.pgc-submit:focus-visible { outline: 3px solid var(--pgc-ink); outline-offset: 3px; }
.pgc-submit-amount { font-variant-numeric: tabular-nums; opacity: .9; }
.pgc-submit[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* Saldokysely */
.pgc-balance .pgc-hint { margin: 0 0 16px; }
.pgc-inline { display: flex; gap: 8px; }
.pgc-code-input { font-family: ui-monospace, Menlo, Consolas, monospace !important; letter-spacing: 1.5px; text-transform: uppercase; }
.pgc-submit--inline { width: auto; margin: 0; padding: 0 24px; min-height: 50px; justify-content: center; flex: none; }
.pgc-balance-result { margin-top: 20px; padding: 20px; background: var(--pgc-field); border-radius: var(--pgc-radius); display: grid; gap: 2px; }
.pgc-balance-result strong { font-family: var(--pgc-serif); font-size: 44px; font-weight: 600; line-height: 1.1; color: var(--pgc-accent); font-variant-numeric: tabular-nums; }
.pgc-balance .pgc-error { margin-top: 16px; }

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .pgc { border-radius: 20px; }
  .pgc-grid { grid-template-columns: 1fr; }
  .pgc-preview-col { position: static; }
  .pgc-card { max-width: 420px; }
  .pgc-trust, .pgc-card-meta { display: none; }
}
@media (max-width: 420px) {
  .pgc { padding: 20px 16px; }
  .pgc-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pgc-inline { flex-direction: column; }
  .pgc-submit--inline { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pgc * { transition: none !important; }
}

/* Elementor-sivulla saldolaatikko linjataan otsikon kanssa vasempaan reunaan. */
.elementor .pgc--narrow { margin-left: 0; }
.pgc-terms { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--pgc-muted); text-align: center; }
.pgc-terms a { color: var(--pgc-accent); text-decoration: underline; text-underline-offset: 2px; }
