/* Personal bonus card (templates/loyalty/_card.html).
   Self-contained: only .lcard* classes, so it changes nothing else in either theme.
   Card proportions follow a real bank card (ISO ID-1, 85.6 × 54 mm).
   Sizes use container units (cqw), so the card looks the same at any width. */

.lcard {
  --lc-forest-deep: #17301E;
  --lc-forest: #2A4A34;
  --lc-moss: #4A6B3A;
  --lc-sage: #B7C5A6;
  --lc-terracotta: #B85040;
  --lc-gold: #C9A24E;
  --lc-gold-lt: #E6CF94;
  --lc-cream: #F4F1E4;
  --lc-ash: #6B7062;

  container-type: inline-size;
  width: 100%;
  max-width: 440px;
  perspective: 1400px;
  margin-inline: auto;
}

.lcard__inner {
  position: relative;
  aspect-ratio: 85.6 / 54;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
  cursor: pointer;
  border-radius: 5cqw;
  outline: none;
}
.lcard[data-flipped="true"] .lcard__inner { transform: rotateY(180deg); }
.lcard__inner:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--lc-terracotta); }

.lcard__face {
  position: absolute;
  inset: 0;
  border-radius: 5cqw;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  padding: 6cqw 6.5cqw 5.5cqw;
  box-shadow:
    0 1px 2px rgba(23, 48, 30, .10),
    0 10px 24px rgba(23, 48, 30, .18),
    0 28px 60px rgba(23, 48, 30, .16);
}

/* ---------- Front: cream craft paper, gold frame, the "breath" wave ---------- */
.lcard__front {
  color: var(--lc-forest-deep);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(201, 162, 78, .20), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(74, 107, 58, .14), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #FAF8EF 0%, var(--lc-cream) 45%, #E8E3CC 100%);
}
.lcard__front::before { /* thin gold foil frame */
  content: "";
  position: absolute;
  inset: 2.6cqw;
  border-radius: 3.2cqw;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--lc-gold-lt), var(--lc-gold) 40%, #F3E3B3 60%, var(--lc-gold)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: .9;
}
.lcard__front::after { /* soft light sweep */
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  transform: translateX(-60%);
  transition: transform 1.2s ease;
  pointer-events: none;
}
.lcard__inner:hover .lcard__front::after { transform: translateX(60%); }

.lcard__wave {
  position: absolute;
  left: 46%; right: 0; top: 34%;
  width: 54%; height: 34%;
  overflow: visible;
  pointer-events: none;
}
.lcard__wave path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lcard__wave-a { stroke: var(--lc-moss); stroke-width: 2.2; opacity: .55; }
.lcard__wave-b { stroke: var(--lc-sage); stroke-width: 2.6; opacity: .9; }
.lcard__wave-c { stroke: var(--lc-forest); stroke-width: 1.6; opacity: .35; }
.lcard__ember { fill: var(--lc-terracotta); }

.lcard__top, .lcard__balance, .lcard__bottom { position: relative; z-index: 1; }
.lcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 3cqw; }
.lcard__logo { height: 13cqw; width: auto; max-width: 42cqw; object-fit: contain; }
.lcard__wordmark {
  font-family: "Fraunces", Georgia, serif; font-weight: 500;
  font-size: 6cqw; letter-spacing: .16em;
}
.lcard__kind {
  font-size: 2.7cqw; letter-spacing: .22em; text-transform: uppercase; font-weight: 600;
  color: #8A6A28;
  padding-top: 1.2cqw;
}

.lcard__balance { margin-top: auto; display: flex; flex-direction: column; }
.lcard__caption {
  font-size: 2.7cqw; letter-spacing: .14em; text-transform: uppercase; color: var(--lc-ash);
}
.lcard__points {
  font-family: "Fraunces", Georgia, serif;
  font-size: 13cqw; line-height: 1; font-weight: 500;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums lining-nums;
  /* gold-to-forest ink */
  background: linear-gradient(180deg, var(--lc-forest-deep) 30%, var(--lc-forest) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lcard__bottom {
  margin-top: 3.5cqw;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 3cqw;
}
.lcard__holder {
  font-size: 3.9cqw; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lcard__since { font-size: 2.8cqw; color: var(--lc-ash); margin-top: .4cqw; }
.lcard__flip-hint {
  flex: none;
  width: 8cqw; height: 8cqw; border-radius: 50%;
  display: grid; place-items: center;
  color: #8A6A28;
  border: 1px solid rgba(201, 162, 78, .55);
  background: rgba(255, 255, 255, .45);
}
.lcard__flip-hint svg { width: 4.4cqw; height: 4.4cqw; }

/* ---------- Back: deep forest, gold type, barcode on white ---------- */
.lcard__back {
  transform: rotateY(180deg);
  color: #F1F3EA;
  background:
    radial-gradient(100% 80% at 100% 0%, rgba(201, 162, 78, .18), transparent 55%),
    radial-gradient(90% 90% at 0% 100%, rgba(74, 107, 58, .45), transparent 60%),
    linear-gradient(150deg, var(--lc-forest) 0%, var(--lc-forest-deep) 70%);
  padding-top: 5cqw;
}
.lcard__back-head { display: flex; justify-content: space-between; align-items: center; }
.lcard__back-title {
  font-size: 2.7cqw; letter-spacing: .2em; text-transform: uppercase; color: var(--lc-gold-lt);
}
.lcard__barcode-panel {
  margin-top: 3.2cqw;
  background: #fff;
  border-radius: 2.4cqw;
  padding: 2.6cqw 4cqw 1.8cqw;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 78, .5);
}
.lcard-barcode { display: block; width: 100%; height: 15cqw; }
.lcard__number {
  text-align: center;
  font-size: 3.5cqw; letter-spacing: .18em; color: #111;
  font-variant-numeric: tabular-nums; margin-top: .8cqw;
}
.lcard__rules {
  list-style: none; margin: 3.2cqw 0 0; padding: 0;
  display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 2cqw;
  white-space: nowrap;
  font-size: 2.5cqw; color: rgba(241, 243, 234, .85);
}
.lcard__rules b { color: var(--lc-gold-lt); font-weight: 600; }
.lcard__rules li + li::before { content: "·"; margin-right: 2cqw; color: var(--lc-gold); }
.lcard__contact {
  margin-top: auto;
  display: flex; justify-content: space-between; gap: 2cqw;
  font-size: 2.6cqw; color: rgba(241, 243, 234, .6);
}

@media (prefers-reduced-motion: reduce) {
  .lcard__inner, .lcard__front::after { transition: none; }
}
