/* Shared "app portal" theme — member login/dashboard/profile and the
   loyalty punch-card portal. Dark, app-like (these are logged-in tools,
   installable as a PWA), retokenized to match the public site's brand
   palette instead of the old ad-hoc #7c3aed/#06b6d4 pair. Bootstrap
   Icons replace emoji throughout. */
:root {
  --purple: #5e2b97;
  --purple-dark: #3f1a6b;
  --purple-soft: #efe6fa;
  --cyan: #00b8cf;
  --yellow: #ffc93c;
  --navy: #100c2a;
  --navy-2: #201750;
  --bg: var(--navy);
  --ink: #ffffff;
  --muted: #b6aede;
  --line: rgba(255,255,255,.12);
  --card-bg: rgba(255,255,255,.05);
  --danger: #ef4444;
  --danger-soft: rgba(239,68,68,.15);
  --success: #22c55e;
  --success-soft: rgba(34,197,94,.12);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: 'Poppins', system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  background-image:
    radial-gradient(1000px 600px at 50% -100px, var(--navy-2) 0%, var(--bg) 45%, var(--bg) 100%);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: 'Orbitron', system-ui, sans-serif; margin: 0; }
a { color: inherit; }

/* Twinkling star field, same visual language as the marketing hero */
.stars { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.stars i { position: absolute; width: 2px; height: 2px; background: #fff; border-radius: 50%; opacity: .8; animation: twinkle 4s infinite ease-in-out; }
@keyframes twinkle { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .stars i { animation: none; } }

.portal-topbar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; max-width: 480px; margin: 0 auto; padding: 18px 18px 0; }
.portal-topbar .logo-img { height: 34px; width: auto; display: block; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; }
.back-link:hover { color: #fff; }

.wrap { position: relative; z-index: 1; max-width: 440px; margin: 4vh auto; padding: 0 18px; }
.wrap.wide { max-width: 760px; }

.card {
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 15px 40px rgba(0,0,0,.4); backdrop-filter: blur(10px);
}
.card + .card { margin-top: 16px; }
.card h1, .card h2 { font-size: 20px; margin-bottom: 6px; }
.card .hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

.field { margin-top: 14px; }
.label { font-weight: 600; font-size: 13px; margin-bottom: 5px; color: #cbd5e1; }
.ctl { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.ctl i { color: var(--muted); font-size: 15px; flex-shrink: 0; }
.ctl input, .ctl select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; font-family: inherit; }
.ctl button.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0; }
.ctl button.icon-btn:hover { color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 16px; padding: 14px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--cyan)); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: .3px; cursor: pointer;
  box-shadow: 0 10px 25px rgba(94,43,151,.35); font-family: inherit;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .7; cursor: default; transform: none; }
.btn.btn-outline { background: rgba(255,255,255,.06); box-shadow: none; border: 1px solid var(--line); }
.btn.btn-yellow { background: var(--yellow); color: var(--navy); box-shadow: 0 10px 25px rgba(255,201,60,.25); }

.simple-links { display: flex; flex-direction: column; align-items: stretch; margin-top: 18px; gap: 8px; }
.simple-links a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #cabdfa; text-decoration: none; font-weight: 600; font-size: 13.5px;
  border: 1px solid rgba(165,180,252,.3); border-radius: 10px; padding: 11px 16px;
  background: rgba(255,255,255,.05); transition: .2s;
}
.simple-links a:hover { background: rgba(165,180,252,.15); color: #fff; }

.toast { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; font-size: 13.5px; }
.toast i { flex-shrink: 0; }
.toast.success { background: var(--success-soft); border-color: rgba(34,197,94,.4); color: #86efac; }

.invite { margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--success-soft); border: 1px solid rgba(34,197,94,.3); color: #bbf7d0; font-size: 13.5px; text-align: center; }
.invite a { color: #5eead4; text-decoration: none; font-weight: 700; }

.row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 8px; }
.row a { color: #cabdfa; font-size: 13px; text-decoration: none; }
.row a:hover { color: #fff; }
.help { text-align: center; margin-top: 16px; color: var(--muted); font-size: 12.5px; }

/* Pills / chips / tags — small status labels used on dashboards */
.pill, .chip, .tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 11.5px; padding: 4px 10px; border-radius: 999px; }
.pill { background: var(--purple-soft); color: var(--purple-dark); }
.chip { background: rgba(255,255,255,.08); color: #e5deff; border: 1px solid var(--line); }
.tag.ok { background: var(--success-soft); color: #86efac; }
.tag.wait { background: rgba(255,201,60,.15); color: #ffdd85; }

/* Progress bar (loyalty punch card) */
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); border-radius: 999px; transition: width .4s ease; }

/* Language switch (loyalty i18n) */
.lang-switch { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.lang-switch a { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.lang-switch a.active { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.langbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.langlabel { font-size: 12px; color: #cbd5e1; font-weight: 600; }

/* "How it works" bullet box (loyalty login/register) */
.bullets { margin: 12px 0 6px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.bullets .t { font-weight: 800; font-size: 13px; margin-bottom: 8px; color: #e2e8f0; }
.bullets ul { margin: 0 0 0 18px; padding: 0; }
.bullets li { color: #cbd5e1; font-size: 13px; line-height: 1.5; margin: 6px 0; }

/* QR modal (loyalty dashboard) */
.qr-modal { position: fixed; inset: 0; background: rgba(16,12,42,.92); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.qr-modal.open { display: flex; }
.qr-modal .modal-card { background: #fff; border-radius: 20px; padding: 24px; text-align: center; max-width: 320px; width: 100%; }
.qr-modal .close { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 999px; width: 36px; height: 36px; font-size: 16px; cursor: pointer; }

@media (max-width: 480px) { .wrap.wide { max-width: 100%; } }
