/* ---------- fonts ---------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ---------- design tokens (Otet Markets) ---------- */
:root {
  --brand: #5C64FA;
  --brand-dark: #4046d8;
  --brand-soft: #eceeff;
  --mint: #23E6A4;
  --mint-soft: #e2fbf2;
  --ink: #1c1f35;
  --ink-2: #5b5f7d;
  --ink-3: #9a9db8;
  --bg: #f4f5fb;
  --card: #ffffff;
  --line: #e6e8f5;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(38, 43, 100, 0.07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }
.muted { color: var(--ink-2); font-size: 0.92rem; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* ---------- topbar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.5; }
.brand-text strong { font-size: 1rem; }
.brand-text span { font-size: 0.78rem; color: var(--ink-3); }
.session-box { display: flex; align-items: center; gap: 10px; min-width: 0; }
.session-email {
  font-size: 0.85rem;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

/* ---------- admin test-mode banner ---------- */
.test-banner {
  background: #fff7e0;
  border-bottom: 1px solid #f0e2b0;
  color: #8a6d1a;
  font-size: 0.85rem;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.test-banner .btn-ghost { color: #8a6d1a; }
.test-banner .btn-ghost:hover:not(:disabled) { background: #f5ebc8; }

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 56px;
  flex: 1;
}

/* ---------- hero ---------- */
.hero { text-align: center; margin-bottom: 28px; }
.hero-badge {
  display: inline-block;
  background: var(--mint-soft);
  color: #0b9a6d;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 14px;
}
.hero h1 { font-size: 1.65rem; margin: 0 0 10px; }
.hero-sub { max-width: 560px; margin: 0 auto; color: var(--ink-2); font-size: 0.95rem; }
.steps {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 16px 6px 18px;
  font-size: 0.85rem;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-num {
  background: var(--brand);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex: 0 0 auto;
}

/* ---------- cards & forms ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.form-card { max-width: 440px; margin: 0 auto; }
.form-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.form-card label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 8px; }

input[type="email"], input[type="text"], .otp-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 14px;
}
input:focus { border-color: var(--brand); }
.otp-input {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 10px;
  font-weight: 700;
}

.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }

.btn-ghost {
  background: none;
  border: 0;
  color: var(--brand);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}
.btn-ghost:hover:not(:disabled) { background: var(--brand-soft); }
.btn-ghost:disabled { color: var(--ink-3); cursor: default; }

.otp-actions { display: flex; justify-content: space-between; margin-top: 4px; }

.form-msg { font-size: 0.88rem; margin: 10px 0 0; min-height: 1.4em; }
.form-msg.ok { color: #0b9a6d; }
.form-msg.err { color: var(--danger); }

.fine-print {
  text-align: center;
  color: var(--ink-3);
  font-size: 0.8rem;
  max-width: 480px;
  margin: 20px auto 0;
}

/* ---------- dashboard ---------- */
.dash-head { margin-bottom: 20px; }
.dash-head h2 { margin: 0 0 4px; font-size: 1.3rem; }

.claim-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.claim-card.locked { opacity: 0.6; box-shadow: none; }

.claim-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.claim-title { font-size: 1.05rem; font-weight: 700; margin: 0; }

.badge {
  font-size: 0.76rem;
  font-weight: 500;
  border-radius: 100px;
  padding: 3px 12px;
  white-space: nowrap;
}
.badge.open { background: var(--brand-soft); color: var(--brand-dark); }
.badge.done { background: var(--mint-soft); color: #0b9a6d; }
.badge.locked { background: #eef0f6; color: var(--ink-3); }

.claim-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.85rem;
  color: var(--ink-2);
  margin-bottom: 14px;
}
.claim-meta b { color: var(--ink); font-weight: 500; }

/* options */
.options { display: grid; gap: 12px; margin-bottom: 14px; }
@media (min-width: 640px) { .options.two { grid-template-columns: 1fr 1fr; } }

.option {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.option:hover { border-color: var(--brand); }
.option.selected { border-color: var(--brand); background: var(--brand-soft); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-title { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.option-amount { color: var(--brand-dark); font-weight: 700; font-size: 1.15rem; margin: 4px 0; }
.option-desc { font-size: 0.83rem; color: var(--ink-2); margin: 0; }

.tick {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  background: #fff;
}
.option.selected .tick { border-color: var(--brand); background: var(--brand); color: #fff; }

.acct-field { margin-bottom: 14px; }
.acct-field label { display: block; font-size: 0.86rem; font-weight: 500; margin-bottom: 6px; }
.acct-field input { margin-bottom: 4px; }
.acct-hint { font-size: 0.78rem; color: var(--ink-3); margin: 0; }

.claim-actions .btn-primary { width: auto; padding: 11px 28px; }
.claim-msg { font-size: 0.86rem; color: var(--danger); min-height: 1.3em; margin: 8px 0 0; }

/* done state inside a card */
.done-box {
  background: var(--mint-soft);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.9rem;
}
.done-box b { color: #0b9a6d; }
.done-box p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.84rem; }

.locked-note { font-size: 0.85rem; color: var(--ink-3); margin: 0; }

/* all-done */
.all-done { text-align: center; margin-top: 8px; }
.all-done h3 { margin: 10px 0 6px; }
.done-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 31, 53, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 100%;
}
.modal h3 { margin: 0 0 10px; }
.modal p { margin: 0 0 8px; font-size: 0.92rem; color: var(--ink-2); }
.modal-warn {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem !important;
  margin: 12px 0 !important;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn-primary { flex: 1; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 18px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.8rem;
}
.footer p { max-width: 640px; margin: 0 auto; }

@media (max-width: 480px) {
  .hero h1 { font-size: 1.3rem; }
  .container { padding: 24px 14px 40px; }
  .card, .claim-card { padding: 18px; }
}
