/* BlinkS Cafex Onboard — deep navy + mint green, mobile-first.
   Palette sampled from blinkspro.com hero. */

:root {
  --bg: #0E1F3D;
  --bg-2: #142848;
  --bg-3: #1A3158;
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.66);
  --fg-faint: rgba(255, 255, 255, 0.42);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);
  --accent: #5DE69E;
  --accent-fg: #0E1F3D;
  --accent-glow: rgba(93, 230, 158, 0.22);
  --whatsapp: #25D366;
  --whatsapp-fg: #ffffff;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --tap: 56px;
  --max: 480px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1000px 600px at 50% -10%, rgba(93, 230, 158, 0.10), transparent 70%),
    radial-gradient(800px 500px at 100% 100%, rgba(255, 255, 255, 0.04), transparent 60%),
    var(--bg);
  overflow-x: hidden;
}

a { color: inherit; }

/* App shell */
.app {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 28px 22px max(28px, env(safe-area-inset-bottom)) 22px;
  display: flex;
  flex-direction: column;
}

/* Brand */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  filter: drop-shadow(0 0 18px var(--accent-glow));
}

.brand-mark img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 220px;
}

.brand-tag {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* Views */
.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeUp 280ms cubic-bezier(.2, .7, .2, 1) both;
}

.view[hidden] { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* Typography */
.hl {
  font-size: clamp(28px, 7vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 10px;
}

.sub {
  margin: 0 0 22px;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.5;
}

.accent { color: var(--accent); }

.micro {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--fg-faint);
  letter-spacing: 0.01em;
}

.step-label {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.badge {
  display: inline-block;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(93, 230, 158, 0.14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Progress */
.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
}

.progress-step {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 12px;
  color: var(--fg-muted);
  transition: all 200ms ease;
}

.progress-step.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 6px var(--accent-glow);
}

.progress-step.is-done {
  background: rgba(93, 230, 158, 0.20);
  border-color: var(--accent);
  color: var(--accent);
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}

.progress-line.is-active {
  background: linear-gradient(90deg, var(--accent), rgba(93, 230, 158, 0.30));
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.01em;
}

.field input {
  width: 100%;
  height: var(--tap);
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--fg);
  font-size: 17px;
  font-family: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  -webkit-appearance: none;
}

.field input::placeholder {
  color: var(--fg-faint);
}

.field input:focus {
  border-color: var(--accent);
  background: var(--bg-3);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.field-hint {
  font-size: 12px;
  color: var(--fg-faint);
  margin-top: -2px;
}

/* Buttons */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 100ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.985); }

.btn--lg {
  height: 60px;
  font-size: 17px;
  margin-top: 10px;
}

.btn--md {
  height: var(--tap);
  margin-top: 10px;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 8px 28px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.btn--primary:hover {
  background: #75ECAD;
  box-shadow: 0 10px 32px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.btn--wa {
  background: var(--whatsapp);
  color: var(--whatsapp-fg);
}

.btn--wa:hover { background: #1fb558; }

.btn--ghost {
  background: var(--bg-2);
  color: var(--fg);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--bg-3);
  border-color: rgba(255, 255, 255, 0.30);
}

.btn-arrow,
.btn-icon {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* App store badges — two overlay click-zones over the combined image */
.store-badges {
  position: relative;
  display: block;
  margin-top: 12px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.40),
    0 0 0 1px var(--border-strong) inset;
  -webkit-tap-highlight-color: transparent;
}

.store-badges img {
  display: block;
  width: 100%;
  height: auto;
}

.store-badges__half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  display: block;
  transition: background 160ms ease, transform 100ms ease;
}

.store-badges__half--ios     { left: 0; }
.store-badges__half--android { right: 0; }

.store-badges__half:hover,
.store-badges__half:focus-visible {
  background: rgba(93, 230, 158, 0.14);
  outline: none;
}

.store-badges__half:active { transform: scale(0.985); }

/* Buyer "Visit on the Web" card — visual parallel of the supplier app badges. */
.store-badges--web {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 18px;
  cursor: pointer;
  transition: transform 100ms ease, background 160ms ease, box-shadow 160ms ease;
}

.store-badges--web:hover,
.store-badges--web:focus-visible {
  background: #f5fff9;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--accent) inset,
    0 0 0 4px var(--accent-glow);
  outline: none;
}

.store-badges--web:active { transform: scale(0.99); }

.web-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 26px;
  background: #000;
  color: #fff;
  border-radius: 14px;
  min-width: 240px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.web-badge__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.web-badge__icon svg {
  width: 100%;
  height: 100%;
}

.web-badge__text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  text-align: start;
}

.web-badge__tagline {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 5px;
}

.web-badge__name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

[dir="rtl"] .web-badge__text { align-items: flex-end; }
[dir="rtl"] .web-badge__tagline { letter-spacing: 0; }

/* Force the two WhatsApp buttons (supplier + buyer) to be visually identical
   regardless of surrounding context or document direction. */
#waSupplier,
#waBuyerBtn {
  height: var(--tap);
  font-size: 16px;
  margin-top: 10px;
  background: var(--whatsapp);
  color: var(--whatsapp-fg);
  border: 1px solid transparent;
}

/* Choice cards (router) */
.choice-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  text-align: start;
  cursor: pointer;
  font-family: inherit;
  transition: transform 100ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.choice:hover,
.choice:focus-visible {
  background: var(--bg-3);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  outline: none;
}

.choice:active { transform: scale(0.99); }

.choice-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border-radius: 12px;
  flex: 0 0 auto;
}

.choice-body { flex: 1; min-width: 0; }

.choice-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 2px;
}

.choice-sub {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.4;
}

.choice-arrow {
  font-size: 20px;
  color: var(--fg-muted);
  flex: 0 0 auto;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 2px 6px;
  color: var(--fg-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Back link */
.link-back {
  align-self: center;
  margin-top: 22px;
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 14px;
}

.link-back:hover { color: var(--fg); }

/* Footer */
.foot {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-faint);
}

.foot a {
  color: var(--fg-muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--border-strong);
  padding-bottom: 1px;
}

.foot a:hover { color: var(--accent); border-color: var(--accent); }

/* Larger screens — keep mobile feel, just constrain */
@media (min-width: 520px) {
  .app { padding-top: 48px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ----- Language toggle (EN / ع) ----- */
.lang-toggle {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 100;
  display: inline-flex;
  background: rgba(14, 31, 61, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.lang-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  height: 28px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.lang-btn--ar {
  font-size: 16px;
  letter-spacing: 0;
}

.lang-btn:hover { color: var(--fg); }

.lang-btn.is-active {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media print {
  .lang-toggle { display: none !important; }
}

/* ----- RTL overrides ----- */
[dir="rtl"] .btn-arrow,
[dir="rtl"] .choice-arrow {
  transform: scaleX(-1);
}

/* Phone input numerals always render LTR even in RTL doc; keep
   placeholder positioned correctly. The dir="ltr" on the input
   itself handles the typing direction. */
[dir="rtl"] input[type="tel"] {
  text-align: right;
}

/* Slightly wider letter-spacing trips up some Arabic glyphs;
   reset spacing on Arabic-rendered headings so they breathe naturally. */
[dir="rtl"] .hl,
[dir="rtl"] .op-section-title,
[dir="rtl"] .op-hero h1 {
  letter-spacing: 0;
}

/* Pillar accent stripe should sit on the visual start edge. */
[dir="rtl"] .op-pillar { padding: 18px 22px 18px 18px; }
[dir="rtl"] .op-pillar::before {
  left: auto;
  right: 0;
}
