/**
 * PNP Customer Account — scoped styles.
 *
 * Design tokens lifted from the affiliate hub (hub.css) so the customer
 * portal reads as the same brand family: gold #c9a84c accent, garnet
 * #7c1c2e primary, 4-pt spacing, 12px radii. Light-surface variant —
 * these cards live inside the storefront theme, not the dark hub shell.
 * Everything is scoped under .pnp-ca to never leak into Astra/Elementor.
 */

.pnp-ca {
  --pnp-gold:        #c9a84c;
  --pnp-gold-soft:   rgba(201, 168, 76, 0.12);
  --pnp-garnet:      #7c1c2e;
  --pnp-garnet-deep: #5a1220;
  --pnp-text:        #1a1714;
  --pnp-text-soft:   #4a443c;
  --pnp-text-muted:  #7a7368;
  --pnp-surface:     #ffffff;
  --pnp-surface-alt: #f7f4eb;
  --pnp-border:      rgba(124, 92, 36, 0.16);
  --pnp-ok:          #1e7f4f;
  --pnp-ok-soft:     rgba(52, 211, 153, 0.14);
  --pnp-warn:        #8a5a00;
  --pnp-warn-soft:   rgba(232, 179, 43, 0.16);
  --pnp-radius:      12px;
  --pnp-shadow:      0 2px 12px rgba(26, 23, 20, 0.07);

  color: var(--pnp-text);
  line-height: 1.55;
}

/* ── Cards ─────────────────────────────────────────────────────────── */
.pnp-ca-card {
  background: var(--pnp-surface);
  border: 1px solid var(--pnp-border);
  border-radius: var(--pnp-radius);
  box-shadow: var(--pnp-shadow);
  padding: 20px 22px;
  margin: 0 0 18px;
}

.pnp-ca-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pnp-text-muted);
  margin: 0 0 6px;
}

.pnp-ca-empty { color: var(--pnp-text-muted); margin: 6px 0 0; }

/* ── Credits card ──────────────────────────────────────────────────── */
.pnp-ca-balance {
  font-size: 34px;
  font-weight: 800;
  color: var(--pnp-garnet);
  margin: 0;
  line-height: 1.1;
}
.pnp-ca-balance-sub { color: var(--pnp-text-soft); margin: 4px 0 12px; }
.pnp-ca-balance-sub strong { color: var(--pnp-text); }

.pnp-ca-expiry-nudge {
  background: var(--pnp-warn-soft);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--pnp-warn);
  margin: 0 0 12px;
}

.pnp-ca-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--pnp-border);
  font-size: 13.5px;
  color: var(--pnp-text-soft);
}
.pnp-ca-row-tag {
  flex: 0 0 64px;
  color: var(--pnp-gold);
  font-weight: 700;
}
.pnp-ca-row strong { color: var(--pnp-text); }

/* ── Badges ────────────────────────────────────────────────────────── */
.pnp-ca-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 9999px;
  padding: 2px 10px;
}
.pnp-ca-badge--ok   { background: var(--pnp-ok-soft);   color: var(--pnp-ok); }
.pnp-ca-badge--warn { background: var(--pnp-warn-soft); color: var(--pnp-warn); }
.pnp-ca-badge--dim  { background: rgba(122, 115, 104, 0.14); color: var(--pnp-text-muted); }
.pnp-ca-badge--gold { background: var(--pnp-gold); color: #fff; }

/* ── History table ─────────────────────────────────────────────────── */
.pnp-ca-tablewrap { overflow-x: auto; }
.pnp-ca-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 8px 0 0;
}
.pnp-ca-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pnp-text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--pnp-border);
}
.pnp-ca-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--pnp-border);
  color: var(--pnp-text-soft);
}
.pnp-ca-num { font-variant-numeric: tabular-nums; text-align: right; }
.pnp-ca-table th:nth-child(3), .pnp-ca-table th:nth-child(4) { text-align: right; }

/* ── Dashboard hero ────────────────────────────────────────────────── */
.pnp-ca-hero {
  background: linear-gradient(135deg, var(--pnp-surface) 0%, var(--pnp-surface-alt) 100%);
  border-color: rgba(201, 168, 76, 0.35);
}
.pnp-ca-hero-greeting { font-size: 18px; margin: 0 0 14px; }
.pnp-ca-hero-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.pnp-ca-stat {
  flex: 1 1 160px;
  background: var(--pnp-surface);
  border: 1px solid var(--pnp-border);
  border-radius: 10px;
  padding: 12px 16px;
  text-decoration: none !important;
  transition: border-color 150ms ease;
}
.pnp-ca-stat:hover { border-color: var(--pnp-gold); }
.pnp-ca-stat-num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--pnp-garnet);
  line-height: 1.15;
}
.pnp-ca-stat-label { font-size: 12.5px; color: var(--pnp-text-muted); }

.pnp-ca-hero-links { display: flex; gap: 10px; flex-wrap: wrap; }
.pnp-ca-btn {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 9999px;
  border: 1px solid var(--pnp-border);
  background: var(--pnp-surface);
  color: var(--pnp-text) !important;
  text-decoration: none !important;
  transition: background 150ms ease, border-color 150ms ease;
}
.pnp-ca-btn:hover { border-color: var(--pnp-gold); background: var(--pnp-gold-soft); }
.pnp-ca-btn--gold {
  background: var(--pnp-garnet);
  border-color: var(--pnp-garnet);
  color: #fff !important;
}
.pnp-ca-btn--gold:hover { background: var(--pnp-garnet-deep); border-color: var(--pnp-garnet-deep); }

/* ── What's New grid ───────────────────────────────────────────────── */
.pnp-ca-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.pnp-ca-news-card {
  background: var(--pnp-surface);
  border: 1px solid var(--pnp-border);
  border-radius: var(--pnp-radius);
  box-shadow: var(--pnp-shadow);
  overflow: hidden;
  text-decoration: none !important;
  color: var(--pnp-text) !important;
  transition: border-color 150ms ease, transform 150ms ease;
}
.pnp-ca-news-card:hover { border-color: var(--pnp-gold); transform: translateY(-2px); }
.pnp-ca-news-img { position: relative; aspect-ratio: 1 / 1; background: var(--pnp-surface-alt); }
.pnp-ca-news-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pnp-ca-news-noimg {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-weight: 800; font-size: 22px; color: var(--pnp-gold);
}
.pnp-ca-news-flag { position: absolute; top: 10px; left: 10px; }
.pnp-ca-news-body { padding: 12px 14px 14px; }
.pnp-ca-news-name { font-weight: 700; font-size: 14.5px; margin: 0 0 4px; }
.pnp-ca-news-price { font-size: 14px; color: var(--pnp-garnet); font-weight: 700; margin: 0 0 2px; }
.pnp-ca-news-date { font-size: 12px; color: var(--pnp-text-muted); margin: 0; }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pnp-ca-card { padding: 16px; }
  .pnp-ca-balance { font-size: 28px; }
  .pnp-ca-row { flex-direction: column; gap: 2px; }
  .pnp-ca-row-tag { flex-basis: auto; }
  .pnp-ca-news-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
