﻿:root {
  --gold:       #2b42d8;
  --gold-dark:  #68c0e7;
  --gold-glow:  rgba(43,66,216,0.24);
  --ink:        #1F2937;
  --ink-soft:   #334155;
  --canvas:     #F4F8FF;
  --surface:    #FFFFFF;
  --surface2:   #F6F9FF;
  --card:       #FFFFFF;
  --border:     rgba(30,41,59,0.14);
  --text:       #1F2937;
  --muted:      #64748B;
    --success:    #2ECC71;
    --error:      #E74C3C;
    --radius:     16px;
    --r-sm:       10px;
  }

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

  html { scroll-behavior: smooth; }

  body {
    font-family: Arial, sans-serif;
    background: var(--canvas);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
  }



  /* â”€â”€ Background atmosphere â”€â”€ */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 80% 60% at 20% 0%, rgba(216,154,43,0.12) 0%, transparent 60%),
      radial-gradient(ellipse 60% 50% at 80% 100%, rgba(96,165,250,0.12) 0%, transparent 55%),
      linear-gradient(165deg, #f4f8ff 0%, #eef4ff 60%, #f9fbff 100%);
    z-index: -1;
  }

  

  /* â”€â”€ Layout â”€â”€ */
  .page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 60px;
  }

  /* â”€â”€ Header â”€â”€ */
  .header {
    width: 100%;
    max-width: 440px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 32px;
  }

  .logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 18px;
    box-shadow: 0 0 20px var(--gold-glow);
  }

  .logo-text {
    font-family: Arial, sans-serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
  }

  .logo-text span { color: var(--gold); }

  .lang-toggle {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .lang-toggle:hover { color: var(--text); border-color: var(--gold); }

  .flag {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
  }

  .flag-eg {
    background: linear-gradient(to bottom, #ce1126 0 33%, #ffffff 33% 66%, #000000 66% 100%);
  }

  .flag-gb {
    background:
      linear-gradient(90deg, transparent 42%, #fff 42% 58%, transparent 58%),
      linear-gradient(0deg, transparent 42%, #fff 42% 58%, transparent 58%),
      linear-gradient(90deg, transparent 46%, #cf142b 46% 54%, transparent 54%),
      linear-gradient(0deg, transparent 46%, #cf142b 46% 54%, transparent 54%),
      #012169;
  }

  /* â”€â”€ Hero card â”€â”€ */
  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,200,66,0.1);
    border: 1px solid rgba(245,200,66,0.3);
    color: var(--gold);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
    animation: pulse-badge 3s ease-in-out infinite;
  }

  @keyframes pulse-badge {
    0%,100% { box-shadow: 0 0 0 0 transparent; }
    50%      { box-shadow: 0 0 0 6px rgba(245,200,66,0.08); }
  }

  .hero-badge::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
    animation: blink 1.4s ease-in-out infinite;
  }

  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

  h1 {
    font-family: Arial, sans-serif;
    font-weight: 800;
    font-size: clamp(28px, 7vw, 42px);
    line-height: 1.1;
    letter-spacing: -1px;
    text-align: center;
    margin-bottom: 12px;
  }

  html[lang="ar"] h1 { letter-spacing: 0; line-height: 1.3; }

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

  .subtitle {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
    max-width: 340px;
    margin-bottom: 40px;
  }

  /* â”€â”€ Main card â”€â”€ */
  .card {
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 24px 56px rgba(15,23,42,0.14), 0 0 0 1px rgba(255,255,255,0.55) inset;
  }

  .card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.6;
  }

  /* â”€â”€ Step indicator â”€â”€ */
  .steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
  }

  .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
  }

  .step-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface2);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    position: relative;
    z-index: 1;
    transition: all .3s;
  }

  .step.active .step-circle {
    border-color: var(--gold);
    background: rgba(245,200,66,0.12);
    color: var(--gold);
    box-shadow: 0 0 16px var(--gold-glow);
  }

  .step.done .step-circle {
    border-color: var(--success);
    background: rgba(46,204,113,0.12);
    color: var(--success);
  }

  .step-label {
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 500;
  }

  html[lang="ar"] .step-label { letter-spacing: 0; }

  .step.active .step-label { color: var(--gold); }
  .step.done .step-label { color: var(--success); }

  .step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-top: -22px;
    transition: background .3s;
  }

  .step-line.done { background: var(--success); }

  /* â”€â”€ Input group â”€â”€ */
  .field { margin-bottom: 20px; }

  .field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .brand-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
  }

  .brand-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(148,163,184,0.12);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
  }

  .brand-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .brand-meta {
    min-width: 0;
  }

  .brand-company {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
  }

  .brand-campaign {
    font-size: 12px;
    color: var(--muted);
  }

  .brand-preview-hint {
    min-height: 18px;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 12px;
  }

  .brand-preview-hint.error {
    color: var(--error);
  }

  html[lang="ar"] .field label { letter-spacing: 0; }

  .input-wrap {
    position: relative;
    display: flex;
    align-items: center;
  }

  .input-wrap .icon {
    position: absolute;
    left: 14px;
    color: var(--muted);
    font-size: 17px;
    pointer-events: none;
    transition: color .2s;
  }

  html[dir="rtl"] .input-wrap .icon { left: auto; right: 14px; }

  input[type="text"],
  input[type="tel"],
  input[type="number"] {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: Arial, sans-serif;
    font-size: 16px;
    padding: 14px 14px 14px 44px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    letter-spacing: 0.3px;
  }

  html[dir="rtl"] input[type="text"],
  html[dir="rtl"] input[type="tel"],
  html[dir="rtl"] input[type="number"] {
    padding: 14px 44px 14px 14px;
    text-align: right;
    font-family: Arial, sans-serif;
  }

  input::placeholder { color: var(--muted); font-size: 14px; }

  input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
  }

  .input-wrap input:focus ~ .icon { color: var(--gold); }

  /* Serial input styling */
  .serial-input {
    font-family: Arial, monospace;
    font-size: 18px !important;
    letter-spacing: 3px !important;
    text-transform: uppercase;
    text-align: center;
    padding-left: 14px !important;
  }

  html[dir="rtl"] .serial-input { padding-right: 14px !important; }

  /* â”€â”€ Scan button â”€â”€ */
  .scan-btn {
    position: absolute;
    right: 10px;
    width: 36px; height: 36px;
    background: rgba(245,200,66,0.1);
    border: 1px solid rgba(245,200,66,0.3);
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--gold);
    font-size: 16px;
    transition: all .2s;
  }

  html[dir="rtl"] .scan-btn { right: auto; left: 10px; }
  .scan-btn:hover { background: rgba(245,200,66,0.2); }

  /* â”€â”€ Divider â”€â”€ */
  .divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  .divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  html[lang="ar"] .divider { letter-spacing: 0; }

  /* â”€â”€ OTP input group â”€â”€ */
  .otp-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 8px 0;
  }

  .otp-group input {
    width: 50px; height: 56px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    padding: 0 !important;
    letter-spacing: 0 !important;
    border-radius: var(--r-sm) !important;
  }

  /* â”€â”€ Phone flag â”€â”€ */
  .phone-prefix {
    position: absolute;
    left: 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
  }

  html[dir="rtl"] .phone-prefix { left: auto; right: 14px; }

  .phone-input { padding-left: 70px !important; }
  html[dir="rtl"] .phone-input { padding-right: 70px !important; padding-left: 14px !important; }

  /* â”€â”€ Primary button â”€â”€ */
  .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--ink);
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: none;
    border-radius: var(--r-sm);
    padding: 16px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(245,200,66,0.3);
    margin-top: 8px;
  }

  html[lang="ar"] .btn-primary { letter-spacing: 0; }

  .btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left .4s;
  }

  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(245,200,66,0.4); }
  .btn-primary:hover::before { left: 100%; }
  .btn-primary:active { transform: translateY(0); }
  .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

  /* â”€â”€ Ghost button â”€â”€ */
  .btn-ghost {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 13px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all .2s;
    margin-top: 10px;
  }
  html[lang="ar"] .btn-ghost { font-family: Arial, sans-serif; }
  .btn-ghost:hover { border-color: var(--muted); color: var(--text); }

  /* â”€â”€ Alert â”€â”€ */
  .alert {
    padding: 12px 16px;
    border-radius: var(--r-sm);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }
  .alert-error  { background: rgba(231,76,60,0.12);  border: 1px solid rgba(231,76,60,0.3);  color: #b42318; }
  .alert-success{ background: rgba(46,204,113,0.12); border: 1px solid rgba(46,204,113,0.3); color: #166534; }
  .alert-info   { background: rgba(216,154,43,0.1);  border: 1px solid rgba(216,154,43,0.25);color: #8a5a00; }

  /* â”€â”€ Success screen â”€â”€ */
  .success-screen {
    text-align: center;
    padding: 8px 0;
    display: none;
  }

  .reward-amount-display {
    position: relative;
    margin: 24px auto;
    width: 180px; height: 180px;
  }

  .amount-ring {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--gold) 0%, var(--gold-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 60px rgba(245,200,66,0.35), 0 0 120px rgba(245,200,66,0.15);
    animation: ring-appear .6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  @keyframes ring-appear {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
  }

  .amount-ring .amount-val {
    font-family: Arial, sans-serif;
    font-weight: 800;
    font-size: 36px;
    color: var(--ink);
    line-height: 1;
  }

  .amount-ring .amount-currency {
    font-size: 14px;
    font-weight: 600;
    color: rgba(13,13,13,0.7);
    letter-spacing: 1px;
  }

  .confetti-text {
    font-size: 36px;
    margin-bottom: 8px;
    animation: bounce-in .5s .3s both cubic-bezier(0.34,1.56,0.64,1);
  }

  @keyframes bounce-in {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
  }

  .success-title {
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
  }

  .success-sub {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
  }

  .wallet-balance-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }

  .wallet-balance-box .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
  html[lang="ar"] .wallet-balance-box .label { letter-spacing: 0; }
  .wallet-balance-box .value { font-family: Arial, sans-serif; font-weight: 700; font-size: 20px; color: var(--gold); }

  .collect-logo {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(148,163,184,0.12);
    display: flex;
    place-items: center;
    overflow: hidden;
  }

  .collect-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .collect-meta {
    display: flex;
    gap: 8px;
    margin: 14px 0 16px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(148,163,184,0.1);
    text-align: left;
    flex-direction: row;
    align-items: center;
  }

  .collect-company-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .collect-meta .label {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-right: 8px;
  }

  .collect-meta .value {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
  }

  html[dir="rtl"] .collect-meta {
    text-align: right;
  }

  html[dir="rtl"] .collect-company-row {
    flex-direction: row-reverse;
  }

  html[dir="rtl"] .collect-meta .label {
    margin-right: 0;
    margin-left: 8px;
  }

  /* â”€â”€ How it works â”€â”€ */
  .how-it-works {
    width: 100%;
    max-width: 1100px;
    margin-top: 40px;
    text-align: center;
  }

  .section-title {
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 24px;
  }

  html[lang="ar"] .section-title { letter-spacing: 0; font-family: Arial, sans-serif; }

  .steps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .how-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: left;
    transition: border-color .2s, transform .2s;
  }

  html[dir="rtl"] .how-card { text-align: right; }
  .how-card:hover { border-color: rgba(43,66,216,0.3); transform: translateY(-2px); }

  .how-num {
    font-family: Arial, sans-serif;
    font-size: 30px;
    font-weight: 800;
    color: var(--gold-glow);
    line-height: 1;
    margin-bottom: 8px;
  }

  .how-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
  }

  .how-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

  /* â”€â”€ Footer â”€â”€ */
  .footer {
    margin-top: 48px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
  }

  .footer strong { color: var(--text); }

  /* â”€â”€ Loader â”€â”€ */
  .spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(13,13,13,0.3);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
  }

  html[dir="rtl"] .spinner { margin-right: 0; margin-left: 8px; }

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

  /* â”€â”€ Resend timer â”€â”€ */
  .resend-row {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
  }

  .resend-link { color: var(--gold); cursor: pointer; text-decoration: underline; }
  .resend-link.disabled { color: var(--muted); pointer-events: none; text-decoration: none; }

  /* â”€â”€ Panel transitions â”€â”€ */
  .panel { display: none; }
  .panel.active { display: block; animation: fadeUp .35s ease; }

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

  /* â”€â”€ QR Scanner Modal â”€â”€ */
  .qr-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.62);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px;
  }
  .qr-modal.open { display: flex; }

  .qr-modal-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    position: relative;
  }

  .qr-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
  }

  .qr-modal-sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
  }

  .qr-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
  }

  #qrVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .qr-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }

  .qr-frame {
    width: 65%;
    aspect-ratio: 1;
    border: 3px solid var(--gold);
    border-radius: 12px;
    box-shadow: 0 0 0 2000px rgba(0,0,0,0.45);
    animation: frame-pulse 2s ease-in-out infinite;
  }

  @keyframes frame-pulse {
    0%,100% { border-color: var(--gold); box-shadow: 0 0 0 2000px rgba(0,0,0,0.45), 0 0 12px var(--gold-glow); }
    50%      { border-color: var(--gold-dark); box-shadow: 0 0 0 2000px rgba(0,0,0,0.45), 0 0 24px var(--gold-glow); }
  }

  .qr-scan-line {
    position: absolute;
    left: 17.5%; right: 17.5%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: scan-line 2s linear infinite;
  }

  @keyframes scan-line {
    0%   { top: 17.5%; opacity: 1; }
    90%  { top: 82.5%; opacity: 1; }
    100% { top: 17.5%; opacity: 0; }
  }

  .qr-status {
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
    min-height: 20px;
  }

  .qr-close {
    margin-top: 14px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 10px 28px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .2s;
    width: 100%;
  }
  .qr-close:hover { border-color: var(--error); color: #b42318; }

  @media (max-width: 768px) {
    .steps-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 380px) {
    .card { padding: 24px 18px; }
    .otp-group input { width: 42px; height: 50px; font-size: 18px; }
  }

