/* ===== MY CARDS PAGE ===== */
.cards-page {
  padding: 28px 40px 80px;
  max-width: 1200px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: #f0f6fc;
}

/* btn-primary: now inherited from style.css .app-body scope */

/* Card Hero + Details Grid */
.cards-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 1024px) {
  .cards-page { padding: 24px 20px 60px; }
}
@media (max-width: 600px) {
  .cards-page { padding: 20px 16px 60px; }
}
@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Debit Card Visual ===== */
.card-hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Multi-card (design §4): the hero is a STACK of card faces, one per card,
   newest first, no "primary" tag. Each face carries its own status rows. */
.card-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
}
.card-face-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* VISA-only holders: the additional-card offer above the stack (§3.1). */
.card-offer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(224,160,80,.14) 0%, rgba(224,160,80,.05) 100%);
  border: 1px solid rgba(224,160,80,.35);
}
.card-offer-banner[hidden] { display: none; }
.card-offer-text {
  font-size: 14px;
  line-height: 1.5;
  color: #f0f6fc;
}
.card-offer-text strong { color: #e0a050; }
.card-offer-cta { white-space: nowrap; }

/* "Card balance · shared by both of your cards" (§3.3) */
.detail-note {
  font-size: 12px;
  color: #8b949e;
  margin: -8px 0 16px;
}
.detail-note[hidden] { display: none; }

.debit-card {
  position: relative;
  width: 390px;
  height: 245px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(92,184,230,.15);
}

.debit-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--app-surface-2) 0%, #1a2332 40%, #0f1923 100%);
  z-index: 0;
}
.debit-card-bg::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92,184,230,.12) 0%, transparent 70%);
}

.debit-card-content {
  position: relative;
  z-index: 1;
  padding: 24px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.debit-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debit-card-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--app-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
}

.debit-card-type {
  font-size: 11px;
  color: rgba(240,246,252,.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid rgba(240,246,252,.15);
  padding: 3px 10px;
  border-radius: 20px;
}

.debit-card-chip {
  margin-top: 6px;
}

.debit-card-number {
  font-size: 22px;
  font-weight: 500;
  color: #f0f6fc;
  letter-spacing: 4px;
  font-family: 'Courier New', monospace;
}

.debit-card-bottom {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.debit-card-holder,
.debit-card-expiry {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.debit-card-label {
  font-size: 9px;
  text-transform: uppercase;
  color: rgba(240,246,252,.4);
  letter-spacing: 1px;
}

.debit-card-name {
  font-size: 13px;
  font-weight: 500;
  color: #f0f6fc;
  letter-spacing: 1px;
}

.debit-card-visa {
  margin-left: auto;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #8b949e;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #484f58;
}
.status-dot.active {
  background: #3fb950;
  box-shadow: 0 0 8px rgba(63,185,80,.4);
}

/* ===== Card Details Section ===== */
.card-details-section {
  background: var(--app-surface-2);
  border: 1px solid rgba(240,246,252,.06);
  border-radius: 12px;
  padding: 24px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #f0f6fc;
  margin-bottom: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  color: #8b949e;
}

.detail-value {
  font-size: 18px;
  font-weight: 600;
  color: #f0f6fc;
}
.detail-value.highlight {
  color: var(--app-primary);
}

/* Card Actions */
.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(240,246,252,.04);
  border: 1px solid rgba(240,246,252,.08);
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.card-action-btn:hover {
  background: rgba(92,184,230,.1);
  border-color: rgba(92,184,230,.3);
  color: var(--app-primary);
}

/* ===== Transaction Table ===== */
.section-panel {
  background: var(--app-surface-2);
  border: 1px solid rgba(240,246,252,.06);
  border-radius: 12px;
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(240,246,252,.06);
}

.data-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: #c9d1d9;
  border-bottom: 1px solid rgba(240,246,252,.04);
}

.data-table tbody tr:hover {
  background: rgba(240,246,252,.02);
}

.merchant-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.merchant-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--app-text-white);
}

.amount-negative {
  color: #f85149;
  font-weight: 500;
}

.amount-positive {
  color: #3fb950;
  font-weight: 500;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.status-badge.completed {
  background: rgba(63,185,80,.12);
  color: #3fb950;
}
.status-badge.pending {
  background: rgba(210,153,34,.12);
  color: #d29922;
}
.status-badge.failed {
  background: rgba(248,81,73,.12);
  color: #f85149;
}

/* ===== Ultimo light-theme overrides (audit 2026-06-25) ===== */
/* Card visual stays a DARK card; its gradient's first stop is var(--app-surface-2)
   → light on Ultimo = a big white glare. Use a balanced dark gradient instead. */
html[data-brand="ultimo"] .debit-card-bg {
  background: linear-gradient(135deg, #2a3548 0%, #1a2332 45%, #0f1923 100%);
}
/* Card Details + Transactions panels flipped to a light surface but kept white text
   (#f0f6fc) → invisible. Flip text dark; readable borders; cyan highlight not gold. */
/* The page heading was missed by the 2026-06-25 sweep: .page-title is #f0f6fc
   (near-white) and Ultimo's page background is light, so "My Cards" read as a
   faint smudge. card-issue.css and card-load.css have carried this exact
   override since that sweep — this is the same one line. */
html[data-brand="ultimo"] .page-title,
html[data-brand="ultimo"] .section-title,
html[data-brand="ultimo"] .detail-value { color: var(--app-text-strong); }
html[data-brand="ultimo"] .detail-value.highlight { color: var(--app-buy); }
html[data-brand="ultimo"] .card-details-section,
html[data-brand="ultimo"] .section-panel { border-color: var(--app-border); }
html[data-brand="ultimo"] .data-table th { border-bottom-color: var(--app-border); }
html[data-brand="ultimo"] .data-table td { color: var(--app-text-1); border-bottom-color: var(--app-border); }
html[data-brand="ultimo"] .data-table tbody tr:hover { background: var(--app-surface-1); }
/* Action buttons (Freeze/Set PIN/View Tx/Top Up) were near-invisible (light-gray
   text + faint white bg on the light panel). Readable neutral chip + gold hover —
   the consistent secondary action-button style. */
html[data-brand="ultimo"] .card-action-btn {
  background: var(--app-surface-1);
  border-color: var(--app-border);
  color: var(--app-text-strong);
}
html[data-brand="ultimo"] .card-action-btn:hover {
  background: rgba(245,181,10,0.1);
  border-color: var(--app-primary);
  color: var(--app-text-strong);
}
