/* =========================================================
   Hafiz AI · Iqra Beta — portal + report form
   Dark-first, Apple-grade. Matches the Iqra marketing brand
   (Fraunces display, Inter body, Aref Ruqaa Arabic, green).
========================================================= */

:root {
  --bg:       #000000;
  --bg-soft:  #0a0a0a;
  --bg-card:  #161618;
  --bg-card2: #1d1d20;
  --bg-nav:   rgba(0, 0, 0, 0.72);
  --ink:      #f5f5f7;
  --ink-2:    #a1a1a6;
  --ink-3:    #6e6e73;
  --line:     rgba(255, 255, 255, 0.10);
  --line-2:   rgba(255, 255, 255, 0.05);
  --green:    #30d158;
  --green-2:  #28b14b;
  --green-3:  rgba(48, 209, 88, 0.12);
  --green-glow: rgba(48, 209, 88, 0.16);
  --gold:     #e9c46a;
  --red:      #ff453a;
  --orange:   #ff9f0a;
  --yellow:   #ffd60a;
  --blue:     #0a84ff;
  --radius:   18px;
  --radius-lg: 26px;
  --max:      980px;
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --serif:    "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:     "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --kufi:     "Aref Ruqaa", "Amiri", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient green aurora behind the hero */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% -5%, var(--green-glow), transparent 70%),
    radial-gradient(40% 30% at 90% 10%, rgba(10, 132, 255, 0.08), transparent 60%);
}
.wrap { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: 0 22px; }

a { color: var(--green); text-decoration: none; }
a:hover { color: #4ee06f; }

/* ── Nav ──────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--line-2);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 13px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 600; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #13b269, #0a5e34);
  color: #fff; font-family: var(--kufi); font-size: 17px; box-shadow: 0 4px 16px var(--green-glow);
}
.brand b { font-weight: 600; letter-spacing: -0.01em; }
.brand .sub { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.nav-cta {
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line);
  transition: all .15s var(--ease);
}
.nav-cta:hover { color: var(--ink); border-color: var(--green-2); background: var(--green-3); }

/* ── Hero ─────────────────────────────────────────────── */
.hero { text-align: center; padding: 64px 0 26px; }
.hero .arabic {
  font-family: var(--kufi); font-size: clamp(58px, 13vw, 96px); line-height: 1;
  background: linear-gradient(180deg, var(--gold), #fff 85%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 22px rgba(233, 196, 106, 0.28));
  direction: rtl; margin-bottom: 14px;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--green); background: var(--green-3); border: 1px solid rgba(48,209,88,0.28);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 18px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green-glow); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(48,209,88,.5);} 70%{ box-shadow:0 0 0 8px rgba(48,209,88,0);} 100%{box-shadow:0 0 0 0 rgba(48,209,88,0);} }
.hero h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em;
  font-size: clamp(34px, 6.5vw, 58px); line-height: 1.05; margin: 0 0 16px;
}
.hero h1 .accent { color: var(--green); }
.hero p.lead {
  color: var(--ink-2); font-size: clamp(16px, 2.4vw, 19px);
  max-width: 600px; margin: 0 auto 26px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .12s var(--ease), box-shadow .15s var(--ease), background .15s, border-color .15s;
  text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--green); color: #04140a; box-shadow: 0 10px 30px -8px var(--green-glow); }
.btn-primary:hover { background: #3be065; color: #04140a; box-shadow: 0 14px 38px -8px var(--green-glow); }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green-2); background: var(--green-3); color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn .spin { width: 16px; height: 16px; border: 2px solid rgba(4,20,10,0.35); border-top-color: #04140a; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards / sections ─────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.7);
}
.section-title { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; margin: 0 0 4px; }
.section-sub { color: var(--ink-3); font-size: 14px; margin: 0 0 20px; }

/* What-to-test grid */
.test-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 30px 0; }
.test-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; }
.test-item .ico { font-size: 22px; margin-bottom: 8px; display: block; }
.test-item h4 { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.test-item p { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 1.5; }

/* Steps strip */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0 8px; }
.step { display: flex; gap: 11px; align-items: flex-start; }
.step .n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--green-3); color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 1px solid rgba(48,209,88,.3); }
.step p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.step b { color: var(--ink); display: block; font-size: 14px; }

/* ── Forms ────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.req { color: var(--green); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg-card2); border: 1px solid var(--line); border-radius: 13px;
  padding: 13px 15px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--green-2); background: #1b1b1e;
  box-shadow: 0 0 0 4px var(--green-3);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round'><path d='M3 5l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px; }

/* Chip multi-select */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none;
  font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  background: var(--bg-card2); border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px;
  transition: all .14s var(--ease);
}
.chip input { display: none; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--green-3); border-color: var(--green-2); color: #b8f3c8; }
.chip.on::before { content: "✓"; font-weight: 800; color: var(--green); }

/* Segmented radio (report type / severity) */
.seg { display: grid; gap: 9px; }
.seg.cols-3 { grid-template-columns: repeat(3, 1fr); }
.seg.cols-4 { grid-template-columns: repeat(4, 1fr); }
.opt {
  position: relative; cursor: pointer; text-align: center;
  background: var(--bg-card2); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 8px; transition: all .14s var(--ease);
}
.opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt .oico { font-size: 19px; display: block; margin-bottom: 4px; }
.opt .otxt { font-size: 13px; font-weight: 600; color: var(--ink-2); display: block; }
.opt:hover { border-color: var(--ink-3); }
.opt.on { border-color: var(--green-2); background: var(--green-3); }
.opt.on .otxt { color: var(--ink); }
/* severity colour accents */
.opt.sev-critical.on { border-color: var(--red); background: rgba(255,69,58,0.12); }
.opt.sev-high.on { border-color: var(--orange); background: rgba(255,159,10,0.12); }
.opt.sev-medium.on { border-color: var(--yellow); background: rgba(255,214,10,0.12); }
.opt.sev-low.on { border-color: var(--blue); background: rgba(10,132,255,0.12); }

/* Consent checkbox */
.consent { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.consent input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--green); flex: 0 0 auto; }

/* ── Dropzone / screenshots ───────────────────────────── */
.drop {
  border: 1.5px dashed var(--line); border-radius: 16px; background: var(--bg-card2);
  padding: 26px 18px; text-align: center; cursor: pointer; transition: all .15s var(--ease);
}
.drop:hover, .drop.drag { border-color: var(--green-2); background: var(--green-3); }
.drop .dico { font-size: 26px; }
.drop b { display: block; font-size: 14.5px; margin: 8px 0 2px; }
.drop span { font-size: 12.5px; color: var(--ink-3); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.shot { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .rm { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.65); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; display: grid; place-items: center; backdrop-filter: blur(4px); }
.shot .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--green); transform-origin: left; transition: transform .2s; }
.shot.up { opacity: 0.6; }

/* ── Alerts / success ─────────────────────────────────── */
.alert { font-size: 13.5px; padding: 11px 14px; border-radius: 12px; margin-top: 2px; display: none; }
.alert.show { display: block; }
.alert.err { background: rgba(255,69,58,0.12); color: #ff8a80; border: 1px solid rgba(255,69,58,0.3); }
.success { text-align: center; padding: 20px 6px; }
.success .check { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--green-3); border: 1px solid rgba(48,209,88,0.35); font-size: 30px; color: var(--green); }
.success h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0 0 8px; }
.success p { color: var(--ink-2); margin: 0 auto 20px; max-width: 440px; }

/* ── Footer ───────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line-2); margin-top: 56px; padding: 26px 0 40px; color: var(--ink-3); font-size: 13px; text-align: center; }
.foot a { color: var(--ink-2); }
.foot .row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .seg.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 22px 18px; border-radius: 22px; }
  .hero { padding: 44px 0 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto; } }

/* ── Icon image + de-emoji refinements ────────────────────────────────── */
.brand img.mark { object-fit: cover; background: none; box-shadow: 0 4px 16px var(--green-glow); }
/* Feature cards: a quiet green accent instead of an emoji. */
.test-item { position: relative; padding-top: 22px; }
.test-item::before { content: ""; position: absolute; top: 0; left: 18px; width: 26px; height: 3px; background: var(--green); border-radius: 0 0 3px 3px; }
.test-item .ico { display: none; }
/* Severity dot (replaces emoji), centred above the label. */
.opt .oico { display: none; }
.opt .sevdot { display: block; width: 9px; height: 9px; border-radius: 50%; margin: 2px auto 6px; background: var(--ink-3); }
.sev-critical .sevdot { background: var(--red); }
.sev-high .sevdot { background: var(--orange); }
.sev-medium .sevdot { background: var(--yellow); }
.sev-low .sevdot { background: var(--blue); }
/* Dropzone glyph is now an SVG. */
.drop .dico { width: 30px; height: 30px; color: var(--ink-3); display: inline-block; }

/* ── Tester dashboard ─────────────────────────────────────────────────── */
/* The hidden attribute MUST win over component display rules, otherwise toggling
   `el.hidden = true` (to reveal the gate/dashboard) leaves the loading state on
   screen forever. This is the fix for "Loading…" never going away. */
[hidden] { display: none !important; }
.dash-loading { display: flex; align-items: center; justify-content: center; gap: 11px; color: var(--ink-2); padding: 90px 0; font-size: 14.5px; }
/* Standalone animated spinner (the base .spin was only scoped to .btn). */
.dash-loading .spin, .spin { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.18); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; box-sizing: border-box; }
.spin.dark { border-color: rgba(255,255,255,0.2); border-top-color: var(--green); }
.auth-gate { max-width: 440px; margin: 48px auto; text-align: center; }
.auth-gate .arabic.small { font-size: 52px; margin: 0 0 6px; }
.gate-h { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0 0 8px; }
.gate-p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 22px; }
.gate-note { color: var(--ink-3); font-size: 13px; margin-top: 16px; }
.gate-sent { padding-top: 8px; }

.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 36px 0 22px; flex-wrap: wrap; }
.dash-eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; font-weight: 700; color: var(--green); margin: 0 0 4px; }
.dash-title { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 5vw, 38px); letter-spacing: -0.02em; margin: 0; }
.status-badge { font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 999px; background: var(--bg-card2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.status-badge.ok { background: var(--green-3); border-color: rgba(48,209,88,0.3); color: #b8f3c8; }

.dash-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.tf-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; }
.tf-card .card-h { font-size: 16px; font-weight: 650; margin: 0 0 4px; }
.tf-card .card-sub { font-size: 13px; color: var(--ink-3); margin: 0; }
.tf-card .btn { flex: 0 0 auto; padding: 11px 20px; font-size: 14px; }

.dash-section { font-family: var(--serif); font-weight: 600; font-size: 21px; margin: 34px 0 14px; }
.dash-section .count { color: var(--ink-3); font-weight: 400; font-size: 16px; }
.empty { color: var(--ink-2); font-size: 14px; padding: 22px 24px; }

.reports-list { display: flex; flex-direction: column; gap: 12px; }
.report-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.report-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-title { font-size: 14.5px; font-weight: 650; margin-right: auto; }
.sev-pill, .kind-pill, .report-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }
.sev-pill.sev-h { background: rgba(255,69,58,0.16); color: #ff8a80; }
.sev-pill.sev-m { background: rgba(255,214,10,0.16); color: #ffe066; }
.sev-pill.sev-l { background: rgba(10,132,255,0.16); color: #6db3ff; }
.kind-pill { background: var(--bg-card2); color: var(--ink-2); border: 1px solid var(--line); }
.report-status { background: var(--bg-card2); color: var(--ink-2); border: 1px solid var(--line); }
.report-status.st-resolved { background: var(--green-3); color: #b8f3c8; }
.report-status.st-in_progress { background: rgba(10,132,255,0.16); color: #6db3ff; }
.report-status.st-wont_fix { background: rgba(255,255,255,0.06); color: var(--ink-3); }
.report-desc { font-size: 13.5px; color: var(--ink-2); margin: 10px 0; white-space: pre-wrap; }
.report-shots { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.beta-shot { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.beta-shot.sm { width: 64px; height: 64px; }
.beta-shot img { width: 100%; height: 100%; object-fit: cover; }
.thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bubble { font-size: 13.5px; line-height: 1.5; padding: 10px 13px; border-radius: 13px; max-width: 88%; white-space: pre-wrap; }
.bubble .bubble-who { display: block; font-size: 11px; font-weight: 700; opacity: 0.7; margin-bottom: 3px; }
.bubble.team { background: var(--green-3); border: 1px solid rgba(48,209,88,0.22); align-self: flex-start; }
.bubble.you { background: var(--bg-card2); border: 1px solid var(--line); align-self: flex-end; }
.reply-row { display: flex; gap: 8px; margin-top: 10px; }
.reply-row .reply-in { flex: 1; padding: 10px 13px; font-size: 14px; }
.reply-row .reply-send { flex: 0 0 auto; padding: 10px 18px; font-size: 14px; }

.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.ann-item.pinned { border-color: rgba(48,209,88,0.3); }
.ann-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 4px; }
.ann-head strong { font-size: 14.5px; font-weight: 650; }
.ann-item p { margin: 0; font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; }

@media (max-width: 640px) {
  .dash-cards { grid-template-columns: 1fr; }
  .tf-card { flex-direction: column; align-items: flex-start; }
  .tf-card .btn { width: 100%; }
}
