*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --brand: #00b26f;
  --brand-dark: #006b4a;
  --brand-light: #5edb92;
  --surface: #ffffff;
  --surface-muted: #f4f7f5;
  --text: #0a1f16;
  --text-muted: #5a6b62;
  --border: #e3ebe6;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-actions: 0 -8px 32px rgba(0, 107, 74, 0.08);
  --shadow-btn: 0 6px 18px rgba(0, 178, 111, 0.3);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

html {
  height: 100%;
}

body {
  font-family: 'Cairo', sans-serif;
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  direction: rtl;
  background: var(--surface-muted);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Full-height shell ── */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  animation: fade-in 0.4s ease both;
}

@media (min-width: 520px) {
  body {
    background: linear-gradient(180deg, var(--brand-dark) 0%, var(--brand) 40%, var(--surface-muted) 40%);
  }

  .shell {
    min-height: calc(100dvh - 32px);
    margin-block: 16px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 107, 74, 0.18);
  }
}

/* ── Branded header (top zone) ── */
.site-header {
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(155deg, var(--brand-dark) 0%, var(--brand) 55%, var(--brand-light) 100%);
  color: #fff;
  overflow: hidden;
}

.site-header__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.site-header__route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.35);
}

.site-header__pin {
  position: absolute;
  top: 18%;
  left: 12%;
  width: 24px;
  height: 24px;
  opacity: 0.25;
}

.site-header__inner {
  position: relative;
  padding: 36px 24px 32px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.logo-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.15);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.15);
}

.logo-wrap--image {
  background-image: var(--logo-url);
  background-color: #fff;
}

.logo-wrap--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
}

.logo-wrap__initial {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.brand-lockup {
  text-align: start;
}

.brand-lockup__ar {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-lockup__en {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.brand-message {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.55;
  color: #fff;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.location-tag,
.platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.location-tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.location-tag svg {
  width: 12px;
  height: 12px;
}

.platform-tag {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.categories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.categories__item {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ── Main content (scrollable middle) ── */
.site-main {
  flex: 1;
  padding: 24px 24px 16px;
  overflow-y: auto;
}

.subtitle {
  margin: 0 0 20px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.65;
  color: var(--text-muted);
}

.panel {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.panel--loading {
  text-align: center;
  padding: 32px 20px 28px;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, white);
}

.panel__icon svg {
  width: 20px;
  height: 20px;
}

.panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.panel--loading .panel__title {
  margin-top: 18px;
}

.panel__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steps__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.steps__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 12%, white);
}

.steps__text {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
  padding-top: 2px;
}

.steps__text strong {
  color: var(--brand-dark);
  font-weight: 700;
}

.loader {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto;
}

.loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--brand) 12%, white);
  border-top-color: var(--brand);
  animation: spin 0.85s linear infinite;
}

.loader__logo {
  position: absolute;
  inset: 11px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--brand-light), var(--brand));
}

.loader__logo--image {
  background-color: var(--surface);
  background-image: var(--logo-url);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── Sticky bottom actions ── */
.site-actions {
  flex-shrink: 0;
  padding: 16px 24px calc(16px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-actions);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-actions:empty {
  display: none;
}

.hint {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  text-align: center;
}

.actions__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
}

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

.action-btn,
.store-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-btn:focus-visible,
.store-btn:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.action-btn:active,
.store-btn:active {
  transform: scale(0.98);
}

.action-btn svg,
.store-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.action-btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.store-btn .label {
  text-align: start;
  line-height: 1.15;
}

.store-btn .label small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.75;
}

.store-btn--apple {
  background: var(--brand-dark);
  color: #fff;
}

.store-btn--google {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

/* ── Footer hint ── */
.site-footer {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 0 24px calc(20px + var(--safe-bottom));
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface);
}

.site-footer svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--brand);
}

.site-footer a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand);
}

@media (max-width: 380px) {
  .site-header__inner {
    padding: 28px 20px 26px;
  }

  .site-header__brand {
    gap: 12px;
  }

  .logo-wrap {
    width: 64px;
    height: 64px;
  }

  .brand-lockup__ar {
    font-size: 1.6rem;
  }

  .brand-message {
    font-size: 0.95rem;
  }

  .site-main,
  .site-actions {
    padding-inline: 20px;
  }

  .site-footer {
    padding-inline: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
