/* fressocafe.com/card – the payment panel (Lane P). Everything under .fcp-.
 * Colours and radii: DESIGN §3, IOS-FLOW §5 (green #265221, selected wash
 * rgba(38,82,33,.08), field border rgba(142,142,147,.3), radius 16, reds
 * #B3261F). The page's own font is inherited; Square's iframe uses the
 * system stack (set in card-pay.js). */

.fcp {
  --fcp-green: #265221;
  --fcp-wash: rgba(38, 82, 33, 0.08);
  --fcp-line: rgba(142, 142, 147, 0.3);
  --fcp-ink: #1a1a1a;
  --fcp-ink-2: rgba(60, 60, 67, 0.6);
  --fcp-red: #B3261F;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--fcp-ink);
}

.fcp [hidden] { display: none !important; }

/* ── Wallets ─────────────────────────────────────────────────────────── */

.fcp-wallets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.fcp-wallets.is-pair { grid-template-columns: 1fr 1fr; }

.fcp-wallet {
  display: block;
  width: 100%;
  height: 50px;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
}

/* Apple's own button, where the engine draws it (Safari). The reset comes
   first and the native appearance LAST, in its own block: `appearance` and
   `-webkit-appearance` are one property, so an `appearance: none` after the
   native value (as this once had) leaves a blank black box. */
.fcp-applepay {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background-color: #000;
}
.fcp-applepay-fallback { display: none; }
@supports (-webkit-appearance: -apple-pay-button) {
  .fcp-applepay {
    -webkit-appearance: -apple-pay-button;
    -apple-pay-button-type: plain;
    -apple-pay-button-style: black;
  }
}
@supports not (-webkit-appearance: -apple-pay-button) {
  .fcp-applepay {
    color: #fff;
    font: 600 17px/50px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }
  .fcp-applepay-fallback { display: inline; }
}
.fcp-applepay:focus-visible,
.fcp-gpay:focus-within {
  outline: 2px solid var(--fcp-green);
  outline-offset: 2px;
}
.fcp-applepay:disabled { opacity: 0.5; cursor: default; }

/* Square/Google draw the button inside; make it fill our 50 px box. */
.fcp-gpay { cursor: pointer; }
.fcp-gpay > *,
.fcp-gpay button { width: 100% !important; height: 50px !important; min-width: 0 !important; }
.fcp-gpay.is-disabled { opacity: 0.5; pointer-events: none; }

/* ── "or pay with a card" ────────────────────────────────────────────── */

.fcp-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--fcp-ink-2);
  font-size: 14px;
  line-height: 1.3;
}
.fcp-divider::before,
.fcp-divider::after {
  content: "";
  flex: 1 1 0;
  height: 0.5px;
  background: rgba(142, 142, 147, 0.4);
}
.fcp-divider-text { flex: 0 0 auto; white-space: nowrap; }

/* ── Saved cards + New card ──────────────────────────────────────────── */

.fcp-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fcp-method {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--fcp-line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  font-size: 17px;
  line-height: 1.25;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.fcp-method.is-selected {
  border-color: var(--fcp-green);
  background: var(--fcp-wash);
}

.fcp-radio {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid rgba(142, 142, 147, 0.6);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.fcp-radio::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fcp-green);
  transform: scale(0);
  transition: transform 0.15s ease;
}
.fcp-radio:checked { border-color: var(--fcp-green); }
.fcp-radio:checked::before { transform: scale(1); }
.fcp-radio:focus-visible { outline: 2px solid var(--fcp-green); outline-offset: 2px; }
.fcp-radio:disabled { cursor: default; }

.fcp-method-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.fcp-method-meta {
  flex: 0 0 auto;
  color: var(--fcp-ink-2);
  font-size: 15px;
}

/* ── Square's card field ─────────────────────────────────────────────── */

.fcp-card-wrap { position: relative; }
.fcp-card-wrap.fcp-offstage {
  position: absolute;
  left: 0;
  right: 0;
  visibility: hidden;
  pointer-events: none;
}
.fcp-card { min-height: 50px; }
.fcp-card-wrap.is-loading .fcp-card { min-height: 0; }

.fcp-loading {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--fcp-line);
  border-radius: 16px;
  background: #fff;
  color: var(--fcp-ink-2);
  font-size: 15px;
}

.fcp-load-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--fcp-line);
  border-radius: 16px;
  background: #fff;
}
.fcp-load-error-text { margin: 0; font-size: 15px; line-height: 1.4; color: var(--fcp-ink); }
.fcp-retry {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--fcp-wash);
  color: var(--fcp-green);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.fcp-retry:focus-visible { outline: 2px solid var(--fcp-green); outline-offset: 2px; }

/* ── Error line + busy ───────────────────────────────────────────────── */

.fcp-error {
  margin: 0;
  color: var(--fcp-red);
  font-size: 15px;
  line-height: 1.4;
}

.fcp.is-busy .fcp-card-wrap,
.fcp.is-busy .fcp-methods { pointer-events: none; opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .fcp-method, .fcp-radio::before { transition: none; }
}
