/* Friedz customer page — approved design (canvas "Friedz Pager — Customer Page"), mobile first.
   Brand values live in :root so colour/spacing changes are one-line edits. No inline styles: the page runs
   under a strict CSP (style-src 'self'). */

@font-face { font-family: 'Beebzz'; src: url('/customer/fonts/Beebzz-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Beebzz'; src: url('/customer/fonts/Beebzz-SemiBold.otf') format('opentype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Beebzz'; src: url('/customer/fonts/Beebzz-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }

:root {
  --red: #E31B23;
  --red-fold: #C8141D;
  --purple: #4A1772;
  --purple-tab: #5A2491;
  --ink: #2A0F3D;
  --ink-soft: #4A3557;
  --ink-muted: #6B4A80;
  --card: #FFF8F0;
  --yellow: #FFC629;
  --lilac: #E9D9F7;
  --ok-bg: #E7F6EC; --ok: #146C36;
  --warn-bg: #FFF0C2; --warn: #6A4A00;
  --err-bg: #FDE3E4; --err: #C8141D;
  --top: 170px;          /* height of the purple bag top */
  --content-top: 318px;  /* where the card starts, below the seal tab */
  --font: 'Beebzz', 'Segoe UI', Tahoma, 'Geeza Pro', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--red);
  background-image: url('/customer/img/bag-shards.svg');
  background-size: 420px 420px;
  position: relative;
  overflow-x: hidden;
}

/* ---------- bag top, fold and seal tab ---------- */
.bag-top {
  position: absolute; top: 0; left: 0; right: 0; height: var(--top);
  background-color: var(--purple);
}
.bag-fold {
  position: absolute; top: var(--top); left: 0; right: 0; height: 30px;
  background-color: var(--red-fold);
  background-image: url('/customer/img/bag-shards.svg'); background-size: 420px 420px;
  box-shadow: 0 6px 10px rgba(60, 0, 10, 0.25);
}
.seal-tab {
  position: absolute; top: calc(var(--top) - 30px); left: 50%; transform: translateX(-50%);
  width: 76px; height: 156px; padding-bottom: 12px;
  background-color: var(--purple-tab); border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 10px rgba(30, 0, 40, 0.3);
  display: flex; align-items: flex-end; justify-content: center;
}
.seal-tab svg { width: 62px; height: 62px; direction: ltr; unicode-bidi: isolate; } /* Latin text on a curve: never RTL */

.brand {
  position: absolute; top: 22px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.logo {
  width: 150px; height: 64px;
  background-image: url('/customer/img/logo-ar-white.png');
  background-size: 182px 182px; background-position: -16px -59px; background-repeat: no-repeat;
}
.subtitle { margin: 0; color: var(--lilac); font-size: 14px; font-weight: 600; text-align: center; }

.side-wordmark { display: none; }

/* ---------- content ---------- */
.content {
  position: relative;
  width: 100%; max-width: 440px; margin: 0 auto;
  padding: var(--content-top) 20px 72px;
  display: flex; flex-direction: column; gap: 16px;
}
.card {
  background-color: var(--card); border-radius: 28px; padding: 26px 24px 24px;
  box-shadow: 0 14px 30px rgba(70, 0, 20, 0.28);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.card.is-ready { border: 4px solid var(--yellow); padding-top: 30px; }
.card[hidden], [hidden] { display: none !important; }

.label { font-size: 15px; font-weight: 600; color: var(--ink-muted); }
.number { font-size: 112px; line-height: 1; font-weight: 700; color: var(--red); letter-spacing: -2px; }
.number.is-closed { font-size: 84px; color: #B9A9C6; }
.number-wrap { position: relative; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.burst { position: absolute; width: 54px; height: 54px; }
.burst-a { top: -10px; right: -48px; }
.burst-b { bottom: -6px; left: -48px; }

.tape {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  background-color: var(--purple); color: #fff; font-size: 20px; font-weight: 700;
  padding: 8px 22px; transform: rotate(-2.5deg);
  clip-path: polygon(2% 0, 100% 7%, 98% 100%, 0 92%);
}
.tape.is-ready { background-color: var(--red); font-size: 34px; padding: 10px 28px; transform: rotate(-3deg); }
.tape.is-closed { background-color: var(--ink); }
.tape svg { width: 20px; height: 20px; }

.lead { margin: 8px 0 0; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }
.lead.is-strong { font-size: 19px; font-weight: 700; color: var(--ink); }
.lead.is-red { font-size: 22px; font-weight: 700; color: var(--red); }
.small { margin: 0; font-size: 14px; color: var(--ink-muted); line-height: 1.7; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  background-color: var(--ok-bg); color: var(--ok); border-radius: 999px; padding: 8px 16px;
  font-size: 15px; font-weight: 600;
}
.chip svg { width: 18px; height: 18px; }

.notice {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; width: 100%;
  border-radius: 16px; padding: 12px 14px; font-size: 14px; line-height: 1.7; text-align: start;
}
.notice svg { flex: none; width: 20px; height: 20px; margin-top: 3px; }
.notice.is-warn { background-color: var(--warn-bg); color: var(--warn); }
.notice.is-err { background-color: var(--err-bg); color: var(--err); }

.problem-icon {
  width: 64px; height: 64px; border-radius: 999px; background-color: var(--err-bg);
  display: flex; align-items: center; justify-content: center;
}
.problem-icon svg { width: 32px; height: 32px; }
h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.4; }
h1.is-red { font-size: 21px; color: var(--red); }

/* iPhone install steps */
.steps { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: start; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.steps .n {
  flex: none; width: 30px; height: 30px; border-radius: 999px; background-color: var(--purple); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.steps .t { flex: 1; }
.steps .i { flex: none; width: 24px; height: 24px; }
.app-icon { flex: none; width: 28px; height: 28px; border-radius: 7px; background-color: var(--red); display: flex; align-items: center; justify-content: center; }
.app-icon svg { width: 14px; height: 18px; }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 58px; border: 0; border-radius: 999px; padding: 0 20px;
  background-color: var(--purple); color: #fff; font-family: inherit; font-size: 18px; font-weight: 700;
  box-shadow: 0 8px 18px rgba(30, 0, 40, 0.35); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 22px; height: 22px; }
.btn:active { transform: translateY(1px); }
.btn.is-ghost { min-height: 48px; border: 2px solid #fff; background-color: transparent; font-size: 16px; font-weight: 600; box-shadow: none; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.hint {
  display: flex; align-items: flex-start; gap: 10px; margin: 0;
  background-color: rgba(42, 15, 61, 0.6); color: #fff; border-radius: 18px; padding: 14px 16px;
  font-size: 13px; line-height: 1.7;
}
.hint svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }

.foot { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: #FFE3E3; font-size: 12px; font-weight: 600; }

.loading .number, .loading .tape { opacity: 0.35; }

/* ---------- larger screens ---------- */
@media (min-width: 768px) {
  :root { --top: 220px; --content-top: 340px; }
  .brand { top: 30px; }
  .logo { width: 170px; height: 72px; background-size: 206px 206px; background-position: -18px -67px; }
  .subtitle { font-size: 15px; }
  .number { font-size: 120px; }
  .side-wordmark {
    display: block; position: fixed; left: 40px; bottom: 40px; width: 360px; height: 154px;
    background-image: url('/customer/img/logo-en-white.png');
    background-size: 437px 437px; background-position: -21px -138px; background-repeat: no-repeat;
    transform: rotate(-90deg) translate(0, 0); transform-origin: left bottom; translate: 154px 0; opacity: 0.95;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card.is-ready { animation: pop 0.5s ease-out; }
  @keyframes pop { from { transform: scale(0.94); } to { transform: scale(1); } }
}
