/* ==========================================================================
   BCCI MEMBERSHIP CARD — Refined Premium Design
   Elegant, subtle, professional — like a premium credit card
   ========================================================================== */

/* ── Card Container ─────────────────────────────────────────────── */
.bcci-membership-card-wrapper {
  perspective: 1200px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  /* Makes the card's own width the reference for cqw below. */
  container-type: inline-size;
}

/* The card keeps a fixed aspect ratio but its width is fluid, so every size
   inside it is expressed in em against this one root font-size. Sizing the
   parts in fixed px instead let the layout drift out of proportion as the card
   shrank — the microprint rule cut through the footer and the chip drifted into
   the cardholder name. 2.62cqw resolves to ~11px at the 420px max width. */
.bcci-membership-card {
  position: relative;
  width: 100%;
  font-size: clamp(7.5px, 2.62cqw, 11px);
  aspect-ratio: 1.586 / 1;
  background: linear-gradient(145deg, #0c1829 0%, #162a48 40%, #0e1d35 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 
    0 20px 40px -10px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(212, 175, 55, 0.15);
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s ease;
}

.bcci-membership-card:hover {
  transform: translateY(-4px) rotateX(2deg);
  box-shadow: 
    0 30px 50px -10px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(212, 175, 55, 0.25);
}

/* ── Subtle Holographic Sheen ───────────────────────────────────── */
.bcci-card-hologram {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 45%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 55%
  );
  pointer-events: none;
  z-index: 10;
}

/* ── Gold Border ────────────────────────────────────────────────── */
.bcci-card-border {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 16px;
  pointer-events: none;
  z-index: 5;
}

/* ── Card Content ───────────────────────────────────────────────── */
.bcci-card-content {
  position: relative;
  padding: 2em 2.36em;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
}

/* ── Header ─────────────────────────────────────────────────────── */
.bcci-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.bcci-card-logo-section {
  display: flex;
  align-items: center;
  gap: 1.09em;
  min-width: 0;
}

.bcci-card-logo {
  width: 4.36em;
  height: 4.36em;
  flex-shrink: 0;
  background: linear-gradient(135deg, #c9a227 0%, #e8c84a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bcci-card-logo img {
  width: 3.82em;
  height: 3.82em;
  border-radius: 50%;
  object-fit: contain;
}

.bcci-card-org {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bcci-card-org-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.27em;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.bcci-card-org-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73em;
  color: rgba(212, 175, 55, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.19em;
  margin-top: 0.25em;
  white-space: nowrap;
}

.bcci-card-type {
  text-align: right;
  /* Clears the absolutely-positioned "MEMBER" pill, which was landing
     directly on top of this label. */
  padding-top: 1.82em;
  min-width: 0;
}

.bcci-card-type-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73em;
  color: rgba(212, 175, 55, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.bcci-card-type-value {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.36em;
  color: #d4af37;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Middle Section ─────────────────────────────────────────────── */
.bcci-card-middle {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.09em;
}

.bcci-card-member-info {
  flex: 1;
  min-width: 0;
}

.bcci-card-member-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.19em;
  margin-bottom: 0.45em;
}

/* Company and cardholder names are free text, so both truncate rather than
   wrapping into the footer below them. */
.bcci-card-member-name {
  font-family: 'Inter', sans-serif;
  font-size: 1.64em;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.045em;
  margin-bottom: 0.17em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bcci-card-member-company {
  font-family: 'Inter', sans-serif;
  font-size: 1.09em;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── QR Code ────────────────────────────────────────────────────── */
.bcci-card-qr {
  width: 5.82em;
  height: 5.82em;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 0.7em;
  padding: 0.36em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bcci-card-qr canvas,
.bcci-card-qr img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 4px;
}

/* ── Microprint Line ────────────────────────────────────────────── */
/* Sits in normal flow between the cardholder block and the footer. It used to
   be absolutely positioned a fixed distance off the bottom, which meant it cut
   straight through the footer as soon as that block changed height. */
.bcci-card-microprint {
  flex-shrink: 0;
  margin: 0.9em 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.25) 20%,
    rgba(212, 175, 55, 0.25) 80%,
    transparent 100%
  );
  z-index: 3;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.bcci-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.09em;
}

.bcci-card-details {
  display: flex;
  gap: 2.18em;
  min-width: 0;
}

.bcci-card-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bcci-card-detail-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.3em;
}

.bcci-card-detail-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1em;
  color: rgba(255, 255, 255, 0.75);
}

/* Member IDs are a fixed 27 characters (BCCI- plus a 13-digit timestamp and 8
   hex). Sat beside "Since" and the status pill they overran the card edge, so
   the ID gets its own full-width row above the rest of the footer. */
.bcci-card-id-row {
  margin-bottom: 0.9em;
}

.bcci-card-id-row .bcci-card-detail-value {
  font-size: 0.95em;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bcci-card-validity {
  text-align: right;
  flex-shrink: 0;
}

.bcci-card-validity-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.3em;
}

.bcci-card-validity-value {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.91em;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.4em 1em;
  border-radius: 0.4em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bcci-card-validity-value.active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.bcci-card-validity-value.expiring {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.bcci-card-validity-value.expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ── Premium Badge ──────────────────────────────────────────────── */
.bcci-card-premium-badge {
  position: absolute;
  top: 1.27em;
  right: 1.27em;
  z-index: 6;
  background: linear-gradient(135deg, #c9a227 0%, #e8c84a 100%);
  color: #0c1829;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.19em;
  padding: 0.45em 1.09em;
  border-radius: 0.3em;
}

/* ── Card Actions ───────────────────────────────────────────────── */
.bcci-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  justify-content: center;
}

.bcci-card-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.bcci-card-action-btn.primary {
  background: linear-gradient(135deg, #c9a227 0%, #a67c00 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.bcci-card-action-btn.primary:hover {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.bcci-card-action-btn.secondary {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.bcci-card-action-btn.secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* ── Membership Benefits ────────────────────────────────────────── */
.bcci-card-benefits {
  margin-top: 28px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.bcci-card-benefits-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 16px;
  color: #0f2c59;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bcci-card-benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.bcci-card-benefit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
  color: #64748b;
}

.bcci-card-benefit i {
  color: #d4af37;
  font-size: 14px;
  width: 18px;
  text-align: center;
}

/* ── Chip Emboss ────────────────────────────────────────────────── */
.bcci-card-chip {
  position: absolute;
  top: 6.82em;
  left: 2.36em;
  width: 3.27em;
  height: 2.55em;
  background: linear-gradient(135deg, #e8c84a 0%, #c9a227 100%);
  border-radius: 0.45em;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 4;
}

.bcci-card-chip::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.bcci-card-chip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 2px;
  right: 2px;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

/* ── Security Pattern ───────────────────────────────────────────── */
.bcci-card-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image: 
    radial-gradient(circle at 25% 25%, #ffffff 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, #ffffff 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 1;
}

/* ── Responsive ─────────────────────────────────────────────────── */
/* The card itself needs no per-breakpoint type sizes — it scales from its own
   width via the cqw root above. Only the blocks outside the card do. */
@media (max-width: 480px) {
  .bcci-membership-card-wrapper {
    max-width: 100%;
  }

  .bcci-card-benefits-grid {
    grid-template-columns: 1fr;
  }
  
  .bcci-card-actions {
    flex-direction: column;
  }
  
  .bcci-card-action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Print ──────────────────────────────────────────────────────── */
@media print {
  .bcci-membership-card-wrapper {
    box-shadow: none;
  }
  
  .bcci-membership-card {
    box-shadow: none;
    border: 2px solid #d4af37;
  }
  
  .bcci-card-hologram,
  .bcci-card-actions,
  .bcci-card-benefits {
    display: none !important;
  }
  
  body {
    background: #ffffff;
  }
}

/* ── Loading State ──────────────────────────────────────────────── */
.bcci-card-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}

.bcci-card-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid #e2e8f0;
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.bcci-card-loading-text {
  margin-top: 14px;
  font-size: 13px;
  color: #94a3b8;
}
