/* Customer loyalty page — mobile first, dark lounge style */
:root {
  --accent: #c9a227;
  --bg: #12100e;
  --surface: #1c1815;
  --surface-2: #26201b;
  --line: rgba(255, 240, 220, .09);
  --text: #f4ede4;
  --muted: #a3978a;
  --ok: #6fcf97;
  --bad: #ff7b6b;
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.customer {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans);
  min-height: 100vh; min-height: 100dvh;
  background-image: radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
  background-attachment: fixed;
}
.shell { max-width: 520px; margin: 0 auto; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
a { color: var(--accent); }

.hero { padding: calc(28px + env(safe-area-inset-top)) 22px 18px; text-align: center; }
.logo { max-height: 64px; max-width: 70%; object-fit: contain; }
/* Logo size (Admin › Settings › Logo settings); the image keeps its own aspect ratio. */
.logo-small { --logo-h: 35px; } .logo-medium { --logo-h: 50px; } .logo-large { --logo-h: 70px; }
.logo.site-logo { display: block; margin: 0 auto; height: var(--logo-h, 50px); width: auto; max-height: none; max-width: 80%; object-fit: contain; }
.logo-text { font: 600 1.15rem/1 var(--serif); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.eyebrow { margin: 18px 0 2px; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin: 0; font: 500 1.75rem/1.2 var(--serif); }
.member-chip {
  display: inline-block; margin-top: 12px; padding: 7px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: .82rem; color: var(--muted);
}
.member-chip strong { color: var(--text); letter-spacing: .12em; font-size: 1.05rem; margin-left: 6px; font-variant-numeric: tabular-nums; }

.body { padding: 0 16px; }
.alert { padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-size: .92rem; border: 1px solid var(--line); }
.alert-success { background: rgba(111, 207, 151, .12); color: #bdf0d1; }
.alert-error { background: rgba(255, 123, 107, .12); color: #ffc7bf; }
.alert-warning { background: color-mix(in srgb, var(--accent) 14%, transparent); color: #f5e2a8; }

.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; margin-bottom: 14px; }
.panel-card h2 { margin: 0 0 6px; font: 500 1.3rem/1.25 var(--serif); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .86rem; margin: 14px 0 0; }
.terms { color: var(--muted); font-size: .8rem; }
/* Software credit: discreet, below all customer content */
.sw-customer { margin: 26px 0 8px; text-align: center; color: var(--muted); font-size: .7rem; line-height: 1.6; opacity: .7; }
.sw-customer .sw-product { font-weight: 600; letter-spacing: .02em; }
.sw-customer a { color: inherit; text-decoration: none; font-weight: 600; }
.sw-customer bdi { unicode-bidi: isolate; }
.center { text-align: center; }

label { display: block; margin: 14px 0 6px; font-size: .85rem; color: var(--muted); }
label.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: .92rem; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }
input[type=tel], input[type=text], input[type=email], input:not([type]) {
  width: 100%; padding: 15px 16px; font-size: 1.05rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; outline: none; -webkit-appearance: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input.otp { text-align: center; font-size: 1.8rem; letter-spacing: .5em; font-variant-numeric: tabular-nums; padding-left: .5em; }

.btn-primary {
  display: block; width: 100%; margin-top: 18px; padding: 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #1a1408; font: 600 1.02rem var(--sans); letter-spacing: .02em;
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary.is-loading { opacity: .6; }
.btn-link { background: none; border: 0; color: var(--accent); font: inherit; font-size: .9rem; cursor: pointer; padding: 0; }
.btn-ghost {
  display: inline-block; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: transparent; color: var(--text); text-decoration: none; font: inherit; font-size: .92rem; cursor: pointer;
}
.row-actions { display: flex; justify-content: space-between; margin-top: 16px; }

.how { display: grid; gap: 8px; margin: 4px 0 20px; }
.how div { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; padding: 4px 6px; }
.how span {
  flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent); font-size: .8rem;
}

/* reward banner */
.reward-banner {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 14px; border-radius: var(--radius);
  text-decoration: none; color: #1a1408; background: var(--accent); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff4cf));
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.reward-banner .big { font-size: 2rem; }

/* stamp cards */
.cards { display: grid; gap: 12px; }
.stamp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; }
.stamp-card.has-reward {
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface) 70%);
}
.sc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sc-icon {
  flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
  background: var(--surface-2); border: 1px solid var(--line);
}
.sc-head h3 { margin: 0; flex: 1; font: 600 .95rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.sc-count { font: 600 1.15rem var(--sans); font-variant-numeric: tabular-nums; }
.segments { display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); gap: 6px; }
.segments i { display: block; height: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.segments i.on { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); border-color: transparent; }
.sc-msg { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.sc-reward { margin: 14px 0 0; font-weight: 700; color: var(--accent); letter-spacing: .03em; }

.reward-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.reward-item:first-of-type { border-top: 0; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; flex-direction: column; padding: 12px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.history small { color: var(--muted); font-size: .78rem; }
.history b { margin-left: 6px; }
.history em { font-style: normal; color: var(--muted); font-size: .82rem; margin-left: 6px; }
.history em.gold { color: var(--accent); }
.plus { color: var(--ok); } .minus { color: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 12px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; max-width: 520px; margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(18,16,14,.94); background: color-mix(in srgb, var(--bg) 88%, transparent); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.tabbar a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .72rem; padding: 4px 0; }
.tabbar a span { font-size: 1.2rem; line-height: 1.2; }
.tabbar a.on { color: var(--accent); }
.tabbar b { position: absolute; top: 0; right: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--accent); color: #1a1408; font-size: .7rem; display: grid; place-items: center; padding: 0 5px; }

/* language switcher (EN | العربية) */
.hero-lang { display: flex; width: max-content; margin: 0 0 14px auto; margin-inline-start: auto; margin-inline-end: 0;
  align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: .8rem; line-height: 1.3; }
.hero-lang a { padding: 4px 11px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.hero-lang a.on { background: var(--accent); color: #1a1408; font-weight: 600; }
.hero-lang .sep { color: var(--muted); opacity: .45; font-size: .72rem; }
.hero-lang a[lang=ar] { font-family: "Cairo", Tahoma, "Segoe UI", Arial, sans-serif; }
bdi { unicode-bidi: isolate; }

/* Arabic / right-to-left layout */
[dir=rtl] body.customer, [dir=rtl] .btn-primary, [dir=rtl] .btn-ghost, [dir=rtl] .btn-link, [dir=rtl] input,
[dir=rtl] .hero h1, [dir=rtl] .panel-card h2, [dir=rtl] .sc-head h3, [dir=rtl] .sc-count {
  font-family: "Cairo", Tahoma, "Segoe UI", Arial, sans-serif; }
[dir=rtl] .hero h1 { font-weight: 700; line-height: 1.35; }
[dir=rtl] .panel-card h2 { font-weight: 700; }
[dir=rtl] .eyebrow, [dir=rtl] .sc-head h3, [dir=rtl] .btn-primary, [dir=rtl] .sc-reward { letter-spacing: 0; }
[dir=rtl] .member-chip strong { margin-left: 0; margin-right: 6px; }
[dir=rtl] .history b, [dir=rtl] .history em { margin-left: 0; margin-right: 6px; }
[dir=rtl] .tabbar b { right: auto; left: calc(50% - 22px); }
[dir=rtl] input[dir=ltr]:not(.otp) { text-align: right; }

@media (prefers-reduced-motion: no-preference) {
  .stamp-card.has-reward .sc-reward { animation: glow 2.4s ease-in-out infinite; }
  @keyframes glow { 50% { opacity: .72; } }
}
