/* ==========================================================================
   UCIN × OneGate WooCommerce checkout demo — storefront styling.
   Light, professional, "real store" — deliberately NOT the dark UCIN portal.
   Self-contained: only a system font stack, no external resources.
   ========================================================================== */

:root {
  /* Store palette (neutral, retail) */
  --ink: #1f2733;
  --ink-soft: #55606e;
  --ink-faint: #8a94a2;
  --line: #e2e6eb;
  --line-soft: #eef1f4;
  --bg: #f4f6f8;
  --card: #ffffff;
  --store: #16653f;      /* Cape Union green — the store's own brand */
  --store-dark: #0f4d2f;

  /* UCIN brand (matches packages/sdk ui.tsx tokens) */
  --ucin: #2563eb;
  --ucin-dark: #1d4ed8;
  --ucin-light: #eff6ff;
  --ucin-border: #bfdbfe;
  --ok: #10b981;
  --ok-light: #ecfdf5;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Demo explainer banner ────────────────────────────────────────────────── */
.demo-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
}
.demo-banner__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.demo-banner__badge {
  flex-shrink: 0;
  background: var(--ucin);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 6px;
  margin-top: 1px;
}
.demo-banner__text { font-size: 13px; line-height: 1.55; }
.demo-banner__text strong { color: #fff; }
.demo-banner__text em { color: #93c5fd; font-style: normal; font-weight: 600; }
.demo-banner__text code {
  background: rgba(148, 163, 184, 0.18);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* ── Store header ─────────────────────────────────────────────────────────── */
.store-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.store-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.store-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--store);
  display: flex;
  align-items: center;
  gap: 7px;
}
.store-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--store);
  color: #fff;
  border-radius: 7px;
  font-size: 13px;
}
.store-nav { display: flex; gap: 20px; margin-left: auto; }
.store-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.store-nav a.is-current { color: var(--ink); font-weight: 700; }
.store-cart { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.store-cart span {
  background: var(--store);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 12px;
  margin-left: 2px;
}

/* ── Checkout layout ──────────────────────────────────────────────────────── */
.checkout-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}
.checkout-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0 22px;
}
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .col--order { order: -1; } /* summary first on mobile, like real Woo */
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.section-title--sm { font-size: 15px; border-bottom-width: 1px; }

/* ── Billing fields (native WC look) ──────────────────────────────────────── */
.woocommerce-billing-fields {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 8px;
  box-shadow: var(--shadow);
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.woocommerce-billing-fields .section-title { grid-column: 1 / -1; }
.form-row { margin-bottom: 16px; }
.form-row-wide { grid-column: 1 / -1; }
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.form-row .required { color: #dc2626; border: none; text-decoration: none; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
}
.input-text {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.input-text::placeholder { color: var(--ink-faint); }
.input-text:focus {
  border-color: var(--store);
  box-shadow: 0 0 0 3px rgba(22, 101, 63, 0.12);
}
select.input-text { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%), linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* Pulse applied by the harness to fields UCIN just populated */
@keyframes ucin-fill-flash {
  0%   { border-color: var(--ucin); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28); background: var(--ucin-light); }
  100% { border-color: var(--line); box-shadow: none; background: #fff; }
}
.ucin-filled-flash { animation: ucin-fill-flash 1.6s ease-out; }

/* ── Order summary ────────────────────────────────────────────────────────── */
.col--order { position: sticky; top: 20px; }
.order-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.order-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-table th { text-align: left; }
.order-table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.order-table tbody td { padding: 12px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
.order-table tbody td:last-child { text-align: right; white-space: nowrap; color: var(--ink); font-weight: 600; }
.order-table .qty { color: var(--ink-faint); font-size: 12px; }
.order-table tfoot th { padding: 10px 0; color: var(--ink-soft); font-weight: 600; }
.order-table tfoot td { padding: 10px 0; text-align: right; white-space: nowrap; }
.order-total th, .order-total td { padding-top: 14px; font-size: 17px; border-top: 2px solid var(--line); }
.order-total strong { color: var(--ink); }

/* ── Payment methods ──────────────────────────────────────────────────────── */
.wc-payment { margin-top: 22px; }
.payment_methods { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wc_payment_method {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  transition: border-color 0.15s, background 0.15s;
}
.wc_payment_method:hover { border-color: var(--ucin-border); }
.wc_payment_method label {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
  color: var(--ink);
}
.wc_payment_method input[type="radio"] { accent-color: var(--ucin); width: 17px; height: 17px; flex-shrink: 0; }
/* Selected state (drives the OneGate highlight when the adapter checks it) */
.wc_payment_method:has(input:checked) { border-color: var(--ucin); background: var(--ucin-light); }
.pm-brand { display: flex; align-items: center; gap: 10px; }
.pm-brand__logo {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  flex-shrink: 0;
}
.pm-brand__logo--onegate { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.pm-brand__logo--cod { background: #64748b; }
.payment_box {
  margin: 10px 0 2px 28px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--line-soft);
  border-radius: 8px;
  padding: 9px 11px;
  display: none;
}
.wc_payment_method:has(input:checked) .payment_box { display: block; }

.place-order-btn {
  width: 100%;
  margin-top: 20px;
  background: var(--store);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.place-order-btn:hover { background: var(--store-dark); }
.place-order-btn:active { transform: translateY(1px); }
.secure-line { text-align: center; font-size: 12px; color: var(--ink-faint); margin: 12px 0 0; }

/* ── Outcome ribbon ───────────────────────────────────────────────────────── */
.outcome-note {
  margin: 14px 0 0;
  background: var(--ok-light);
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* ==========================================================================
   Simulated UCIN widget — styled to match the SDK modal (blue brand),
   so it reads as the genuine UCIN surface sitting inside the store page.
   ========================================================================== */
.ucin-widget {
  position: relative;
  background: var(--card);
  border: 1px solid var(--ucin-border);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.12);
  overflow: hidden;
}
.ucin-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
}
.ucin-brand { display: flex; align-items: center; gap: 8px; }
.ucin-brand__logo {
  background: linear-gradient(135deg, var(--ucin), var(--ucin-dark));
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}
.ucin-brand__store { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.ucin-dots { display: flex; gap: 5px; }
.ucin-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background 0.25s; }
.ucin-dot.is-active { background: var(--ucin); }

.ucin-widget__body { padding: 18px 18px 16px; }
.ucin-step { animation: ucin-fade 0.25s ease; }
@keyframes ucin-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ucin-h { font-size: 16px; font-weight: 700; margin: 0 0 5px; letter-spacing: -0.01em; color: var(--ink); }
.ucin-sub { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 15px; line-height: 1.5; }

.ucin-form { display: block; }
.ucin-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.ucin-phone { position: relative; display: flex; align-items: stretch; }
.ucin-phone__cc {
  display: flex; align-items: center;
  font-size: 13px; color: var(--ink-soft); font-weight: 600;
  padding: 0 10px;
  border: 1.5px solid var(--line);
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: var(--bg);
  white-space: nowrap;
}
.ucin-phone .ucin-input { border-radius: 0 10px 10px 0; }
.ucin-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ucin-input:focus { border-color: var(--ucin); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.ucin-input--otp { letter-spacing: 0.4em; text-align: center; font-size: 20px; font-weight: 700; }
.ucin-invalid { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important; }

.ucin-btn {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--ucin) 0%, var(--ucin-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ucin-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45); }
.ucin-btn--ghost {
  background: none;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.ucin-btn--ghost:hover { transform: none; border-color: var(--ucin); color: var(--ucin); }

.ucin-fineprint { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; color: var(--ink-faint); margin: 12px 0 0; }
.ucin-demo-line { font-size: 12px; color: var(--ink-soft); margin: 12px 0 0; padding: 8px 10px; background: var(--ucin-light); border-radius: 8px; text-align: center; }
.ucin-demo-line b { color: var(--ucin-dark); letter-spacing: 0.15em; font-size: 14px; }

.ucin-step--done { text-align: center; padding: 6px 0; }
.ucin-check {
  width: 52px; height: 52px;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: var(--ok-light);
  color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
}

/* Honesty tag pinned to the bottom of the widget */
.ucin-harness-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b45309;
  background: #fffbeb;
  border-top: 1px dashed #fcd34d;
  padding: 6px 16px;
  text-align: center;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.store-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 40px;
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
}
