/* ==========================================================================
   Mock Experience — Certificate Verification
   Design language: minimal, premium (Apple / Stripe / Notion / Linear)
   Palette: Deep Navy #0A1A44 · Gold #D4AF37 · White #FFFFFF
   ========================================================================== */

:root {
  --navy: #0A1A44;
  --navy-soft: #12255E;
  --gold: #D4AF37;
  --gold-soft: #E6C860;
  --white: #FFFFFF;
  --ground: #F6F7FA;          /* near-white with a cool navy tint */
  --ink: #0A1A44;
  --muted: #6B7390;
  --hairline: #E7E9F0;
  --green: #16A34A;
  --green-bg: #EAF7EF;
  --red: #DC2626;
  --red-bg: #FDEDED;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow-card: 0 24px 60px -24px rgba(10, 26, 68, 0.18),
                 0 4px 16px -6px rgba(10, 26, 68, 0.08);
  --font-ar: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  direction: rtl;
  font-family: var(--font-ar);
  color: var(--ink);
  background: var(--ground);
  line-height: 1.7;
}

/* Subtle top brand accent — a single navy band with a gold hairline */
.top-band {
  height: 6px;
  background: linear-gradient(90deg, var(--navy) 60%, var(--gold));
}

/* ---------- Layout shell ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(28px, 6vw, 64px) 20px 48px;
}

/* ---------- Header / brand ---------- */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: clamp(28px, 5vw, 44px);
}

.brand .logo-mark { flex: none; }

.brand .wordmark {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--navy);
}

.brand .wordmark span { color: var(--gold); }

.page-title {
  text-align: center;
  margin: 0 0 6px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: -0.02em;
  color: var(--navy);
}

.page-subtitle {
  text-align: center;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- Status badge (verified / not found) ---------- */
.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 30px;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
}

.badge.verified { background: var(--green-bg); color: var(--green); }
.badge.invalid  { background: var(--red-bg);  color: var(--red); }

.badge svg { flex: none; }

/* ---------- Certificate card ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Participant name header inside the card */
.card-head {
  background: linear-gradient(150deg, var(--navy), var(--navy-soft));
  color: var(--white);
  text-align: center;
  padding: 30px 24px 26px;
}

.card-head .participant-name {
  margin: 0;
  font-size: clamp(1.4rem, 4.5vw, 1.8rem);
  font-weight: 800;
}

.card-head .cert-id {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-en);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  direction: ltr;
}

/* Detail rows — one reusable row pattern */
.card-body { padding: 10px 26px 26px; }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--hairline);
}

.row:last-child { border-bottom: none; }

.row .label {
  color: var(--muted);
  font-size: 0.95rem;
  flex: none;
}

.row .value {
  font-weight: 700;
  font-size: 1.02rem;
  text-align: left;
}

.row .value.en {
  font-family: var(--font-en);
  direction: ltr;
  letter-spacing: 0.02em;
}

.row .value .status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 0.95rem;
}

/* QR authentication strip under the details */
.auth-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #FBF7EA;               /* faint gold wash */
  border-top: 1px solid #F0E6C8;
  color: #8A7420;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 20px;
  text-align: center;
}

/* ---------- Not-found state ---------- */
.not-found {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
  padding: clamp(40px, 8vw, 64px) 28px;
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.not-found .icon { margin-bottom: 18px; }

.not-found h2 {
  margin: 0 0 8px;
  font-family: var(--font-en);
  font-size: 1.5rem;
  color: var(--red);
}

.not-found p { margin: 0; color: var(--muted); }

.not-found .checked-id {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-en);
  direction: ltr;
  background: var(--ground);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 6px 16px;
  font-size: 0.9rem;
  color: var(--ink);
}

/* ---------- Idle state (opened without an ID) ---------- */
.idle {
  text-align: center;
  color: var(--muted);
  padding: clamp(40px, 8vw, 64px) 24px;
}

/* ---------- Skeleton while loading ---------- */
.skeleton {
  height: 320px;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, #EEF0F5 40%, #F7F8FB 50%, #EEF0F5 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

/* ---------- Home page (index.html) ---------- */
main.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  padding-block: clamp(56px, 12vh, 110px);
}

.home-mark { margin-bottom: 22px; }

.home-title {
  margin: 0;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: clamp(2rem, 7vw, 2.8rem);
  letter-spacing: -0.02em;
  color: var(--navy);
}

.home-title span { color: var(--gold); }

.home-slogan {
  margin: 10px 0 0;
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  font-weight: 800;
  color: var(--gold);
}

.home-line {
  margin: 18px 0 0;
  max-width: 30em;
  color: var(--muted);
  font-size: 1.05rem;
}

.home-actions { margin-top: 32px; }

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 28px;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.home-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.home-note {
  margin: 34px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .home-btn:hover { transform: none; }
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 22px 16px 30px;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--font-en);
}

footer b { color: var(--navy); }
footer b span { color: var(--gold); }

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .not-found { animation: none; }
  .skeleton { animation: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 420px) {
  .row { flex-direction: column; gap: 2px; }
  .row .value { text-align: right; }
  .row .value.en { text-align: right; }
}
