/* Befroosh public site — base styles on top of the generated tokens.css. */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
       url('/static/fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  /* optional: no layout shift from a late swap (CLS); the font is preloaded
     and cached, so only the first uncached visit on a slow link may render
     the fallback face. */
  font-display: optional;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.bf-body {
  margin: 0;
  background: var(--bf-ground);
  color: var(--bf-ink);
  font-family: var(--bf-font);
  font-size: var(--bf-type-body-size);
  line-height: var(--bf-type-body-lh);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--bf-primary); }
a:hover { color: var(--bf-primary-hover); }
button, input, select, textarea { font-family: inherit; }
img, svg { display: block; max-width: 100%; }
.bf-main { flex: 1; }
.bf-container { width: 100%; max-width: var(--bf-size-desktop-container); margin: 0 auto; padding: 0 var(--bf-space-md); }
@media (min-width: 1024px) { .bf-container { padding: 0 var(--bf-space-xxl); } }

/* Test-mode banner */
.bf-test-banner { background: var(--bf-danger); color: #fff; text-align: center; font-size: 13px; font-weight: 700; padding: 6px 16px; }

/* Header */
.bf-header { background: var(--bf-surface); border-bottom: 1px solid var(--bf-border-card); position: sticky; top: 0; z-index: 20; }
.bf-header__row { height: var(--bf-size-app-bar); display: flex; align-items: center; gap: var(--bf-space-lg); }
.bf-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--bf-navy); }
.bf-logo__word { font-size: 24px; font-weight: 900; }
.bf-logo--onnavy { color: #fff; }
.bf-nav { display: none; gap: var(--bf-space-lg); margin-inline-start: var(--bf-space-lg); }
.bf-nav__link { color: var(--bf-body); text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 0; }
.bf-nav__link:hover { color: var(--bf-primary); }
.bf-header__actions { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
@media (min-width: 1024px) { .bf-nav { display: flex; } }

/* Buttons & pills */
.bf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--bf-size-button-primary); padding: 0 20px; border-radius: var(--bf-radius-button); font-size: var(--bf-type-button-size); font-weight: var(--bf-type-button-weight); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.bf-btn--sm { height: 44px; padding: 0 16px; font-size: 15px; }
.bf-btn--lg { height: var(--bf-size-button-sheet); padding: 0 24px; font-size: var(--bf-type-button-large-size); font-weight: var(--bf-type-button-large-weight); border-radius: var(--bf-radius-button-large); }
.bf-btn--primary { background: var(--bf-primary); color: #fff; }
.bf-btn--primary:hover { background: var(--bf-primary-hover); color: #fff; }
.bf-btn--secondary { background: var(--bf-surface); color: var(--bf-ink); border-color: var(--bf-border-control); }
.bf-btn--saffron { background: var(--bf-saffron); color: var(--bf-ink); }
.bf-btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.bf-btn--outline-light:hover { color: #fff; border-color: #fff; }
.bf-pill { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: var(--bf-radius-pill); font-size: 14px; font-weight: 700; text-decoration: none; }
.bf-pill--call { background: var(--bf-primary-tint); color: var(--bf-primary-text); display: none; }
@media (min-width: 600px) { .bf-pill--call { display: inline-flex; } }

/* Hero */
.bf-hero { position: relative; overflow: hidden; background: var(--bf-navy); color: #fff; padding: 56px 0 64px; }
.bf-hero::before { content: ""; position: absolute; inset: 0; opacity: .08; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><polygon points='30,8 36.44,14.44 45.56,14.44 45.56,23.56 52,30 45.56,36.44 45.56,45.56 36.44,45.56 30,52 23.56,45.56 14.44,45.56 14.44,36.44 8,30 14.44,23.56 14.44,14.44 23.56,14.44' fill='none' stroke='white' stroke-width='1'/><path d='M52 30H60M0 30H8M30 0V8M30 52V60' stroke='white' stroke-width='1'/></svg>"); }
.bf-hero__grid { position: relative; display: grid; gap: var(--bf-space-section); align-items: center; }
@media (min-width: 1024px) { .bf-hero__grid { grid-template-columns: 1.2fr 1fr; padding: 16px 0; } .bf-hero { padding: 72px 0 80px; } }
.bf-hero__title { margin: 0 0 16px; font-size: 32px; font-weight: 900; line-height: 1.45; }
@media (min-width: 1024px) { .bf-hero__title { font-size: 52px; } }
.bf-accent { color: var(--bf-saffron); }
.bf-hero__lead { margin: 0 0 24px; font-size: 17px; line-height: 2; color: var(--bf-on-navy); max-width: 560px; }
.bf-hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.bf-hero__visual { display: flex; justify-content: center; }
.bf-arch { width: 260px; height: 330px; background: var(--bf-navy-mid); border: 4px solid var(--bf-saffron); border-radius: 130px 130px 24px 24px; display: flex; align-items: center; justify-content: center; animation: bfFloat 6s ease-in-out infinite; }
.bf-laptop { width: 200px; }

/* Sections */
.bf-section { padding: 56px 0; }
.bf-h2 { margin: 0 0 24px; font-size: var(--bf-type-h2-size); font-weight: var(--bf-type-h2-weight); line-height: var(--bf-type-h2-lh); }
.bf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.bf-step { background: var(--bf-surface); border: 1px solid var(--bf-border-card); border-radius: var(--bf-radius-card-large); padding: 24px; display: flex; flex-direction: column; gap: 8px; animation: bfRise .4s ease-out both; }
.bf-step:nth-child(2) { animation-delay: .08s } .bf-step:nth-child(3) { animation-delay: .16s } .bf-step:nth-child(4) { animation-delay: .24s }
.bf-step__badge { width: 44px; height: 56px; border-radius: 22px 22px 8px 8px; background: var(--bf-navy); color: var(--bf-saffron); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; }
.bf-step p { margin: 0; color: var(--bf-muted); font-size: 14px; line-height: 1.8; }
.bf-note { margin-top: 24px; color: var(--bf-muted); font-size: 13px; }

/* Footer */
.bf-footer { background: var(--bf-navy-deep); color: var(--bf-on-navy); padding: 48px 0; margin-top: 48px; }
.bf-footer__grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.bf-footer h3 { margin: 0 0 12px; font-size: 15px; color: #fff; }
.bf-footer a { display: block; color: var(--bf-on-navy); text-decoration: none; padding: 6px 0; font-size: 14px; }
.bf-footer a:hover { color: #fff; }
.bf-footer p { margin: 0 0 8px; font-size: 14px; line-height: 1.9; }
.bf-footer__tag { max-width: 360px; }

/* State pages */
.bf-state__box { background: var(--bf-surface); border: 1px solid var(--bf-border-card); border-radius: var(--bf-radius-sheet); padding: 40px 24px; text-align: center; max-width: 560px; }
.bf-state__box .bf-hero__ctas { justify-content: center; margin-top: 16px; }

@keyframes bfFloat { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes bfRise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes bfPulse { 0% { box-shadow: 0 0 0 0 rgba(233,162,59,.55) } 70% { box-shadow: 0 0 0 7px rgba(233,162,59,0) } 100% { box-shadow: 0 0 0 0 rgba(233,162,59,0) } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- simulated gateway page (test mode only) ---- */
.bf-sim { max-width: 560px; text-align: center; }
.bf-sim__badge { display: inline-block; background: var(--bf-saffron-tint); color: var(--bf-saffron-text); border: 1px solid var(--bf-saffron-border); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.bf-sim__purpose { color: var(--bf-muted); margin: 0 0 16px; }
.bf-sim__amount { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 8px 0 4px; }
.bf-sim__number { font-size: 40px; font-weight: 800; color: var(--bf-ink); }
.bf-sim__unit { font-size: 16px; font-weight: 600; color: var(--bf-muted); }
.bf-sim__words { color: var(--bf-body); margin: 0 0 20px; }
.bf-sim__actions { display: flex; flex-direction: column; gap: 12px; margin: 24px 0 8px; }
.bf-sim__expired { color: var(--bf-danger-text); background: var(--bf-danger-tint); border-radius: 12px; padding: 12px 16px; }
.bf-sim__meta { font-size: 13px; color: var(--bf-muted); margin-top: 20px; }

/* ---- printable parcel label (manual_post) ---- */
.bf-label-page .bf-container { max-width: 760px; }
.bf-label__toolbar { text-align: center; margin-bottom: 20px; }
.bf-label__toolbar .bf-note { margin: 8px auto 16px; max-width: 560px; }
.bf-label { background: var(--bf-surface); border: 2px solid var(--bf-ink); border-radius: 12px; padding: 0; overflow: hidden; color: var(--bf-ink); }
.bf-label__head { display: flex; justify-content: space-between; align-items: center; background: var(--bf-navy); color: #fff; padding: 12px 18px; font-weight: 800; }
.bf-label__fragile { background: var(--bf-saffron); color: var(--bf-ink); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.bf-label__body { display: grid; grid-template-columns: 1fr 200px; gap: 16px; padding: 18px; }
.bf-label__parties { display: grid; gap: 14px; }
.bf-label__party { border: 1px solid var(--bf-border-control); border-radius: 10px; padding: 12px 14px; }
.bf-label__party--to { border: 2px solid var(--bf-primary); background: var(--bf-primary-tint); }
.bf-label__party h2 { font-size: 13px; font-weight: 700; color: var(--bf-muted); margin: 0 0 6px; }
.bf-label__party p { margin: 2px 0; line-height: 1.7; }
.bf-label__name { font-size: 20px; font-weight: 800; }
.bf-label__code { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; border-inline-start: 1px dashed var(--bf-border-control); padding-inline-start: 16px; }
.bf-label__code img { width: 160px; height: 160px; image-rendering: pixelated; }
.bf-label__ourcode { font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.bf-label__meta { font-size: 12px; color: var(--bf-muted); }
.bf-label__foot { border-top: 1px solid var(--bf-border-control); padding: 12px 18px 14px; font-size: 13px; }
.bf-label__steps { margin: 0; padding-inline-start: 20px; line-height: 1.8; }
.bf-label__status { text-align: center; margin-top: 20px; }
.bf-label__status-line { font-weight: 700; }
@media (max-width: 640px) {
  .bf-label__body { grid-template-columns: 1fr; }
  .bf-label__code { border-inline-start: 0; padding-inline-start: 0; border-top: 1px dashed var(--bf-border-control); padding-top: 14px; }
}
@media print {
  .bf-noprint, .bf-header, .bf-footer, .bf-testmode { display: none !important; }
  body { background: #fff; }
  .bf-section { padding: 0; }
  .bf-label { border-radius: 0; break-inside: avoid; }
  .bf-label__head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bf-label__party--to { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
