@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Noto+Nastaliq+Urdu:wght@400;600;700&family=Noto+Sans+Arabic:wght@400;500;700;800&display=swap");

:root {
  --bg0: #07111f;
  --bg1: #0c1d34;
  --bg2: #102a4d;
  --card: rgba(255,255,255,.92);
  --card2: rgba(255,255,255,.78);
  --stroke: rgba(255,255,255,.18);
  --text: #07111f;
  --muted: #64748b;
  --soft: #f1f5f9;
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --cyan: #06b6d4;
  --green: #16a34a;
  --greenBg: #dcfce7;
  --red: #dc2626;
  --redBg: #fee2e2;
  --amber: #f59e0b;
  --amberBg: #fef3c7;
  --purple: #7c3aed;
  --shadow: 0 20px 60px rgba(2,8,23,.22);
  --radius: 28px;
  --safeBottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg0);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: white;
  background:
    radial-gradient(circle at 10% 0%, rgba(37,99,235,.42), transparent 32rem),
    radial-gradient(circle at 90% 10%, rgba(6,182,212,.25), transparent 28rem),
    linear-gradient(180deg, var(--bg0), var(--bg1) 42%, #08101c);
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 14px 14px calc(96px + var(--safeBottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  backdrop-filter: blur(18px);
}

.brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff, #dbeafe);
  color: #0f172a;
  box-shadow: 0 12px 30px rgba(37,99,235,.24);
}

.brand-title {
  min-width: 0;
}

.brand-title b {
  display: block;
  line-height: 1.05;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.brand-title span {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.66);
  font-size: .76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn, .pill-btn {
  border: 1px solid rgba(255,255,255,.18);
  color: white;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(16px);
  border-radius: 999px;
  min-height: 42px;
  padding: 0 13px;
  font-size: .82rem;
  font-weight: 800;
}

.icon-btn {
  width: 42px;
  padding: 0;
}

.hero {
  border: 1px solid var(--stroke);
  border-radius: 34px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.06)),
    linear-gradient(135deg, rgba(37,99,235,.26), rgba(6,182,212,.16));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  right: -70px;
  top: -70px;
  background: rgba(255,255,255,.13);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dbeafe;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34,197,94,.16);
}

.hero h1 {
  margin: 12px 0 8px;
  max-width: 14ch;
  font-size: clamp(2rem, 11vw, 3.45rem);
  line-height: .9;
  letter-spacing: -.075em;
}

.hero p {
  margin: 0;
  color: rgba(255,255,255,.76);
  font-size: .96rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
}

.ring {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    conic-gradient(#38bdf8 var(--pct), rgba(255,255,255,.16) 0);
  position: relative;
}

.ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: #0b1730;
}

.ring-inner {
  position: relative;
  text-align: center;
}

.ring-inner b {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.ring-inner span {
  font-size: .68rem;
  color: rgba(255,255,255,.62);
  font-weight: 800;
}

.quick-stats {
  display: grid;
  gap: 8px;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}

.stat-line span {
  color: rgba(255,255,255,.68);
  font-size: .78rem;
  font-weight: 700;
}

.stat-line b {
  font-size: .84rem;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 22px 2px 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -.03em;
}

.section-title span {
  color: rgba(255,255,255,.55);
  font-size: .78rem;
  font-weight: 700;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  min-height: 154px;
  text-align: left;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 28px;
  padding: 16px;
  color: white;
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.07));
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.mode-card:active {
  transform: scale(.975);
}

.mode-card.wide {
  grid-column: 1 / -1;
  min-height: 128px;
}

.mode-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: rgba(255,255,255,.16);
  font-weight: 900;
  letter-spacing: -.05em;
}

.mode-card h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -.03em;
}

.mode-card p {
  margin: 6px 0 0;
  color: rgba(255,255,255,.62);
  font-size: .82rem;
  line-height: 1.35;
}

.panel {
  color: var(--text);
  background: var(--card);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel + .panel {
  margin-top: 14px;
}

.panel.soft {
  background: rgba(255,255,255,.74);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .01em;
}

.badge.blue {
  background: #dbeafe;
  color: #1e40af;
}

.badge.amber {
  background: var(--amberBg);
  color: #92400e;
}

.badge.green {
  background: var(--greenBg);
  color: #166534;
}

.badge.gray {
  background: #e2e8f0;
  color: #334155;
}

.question-card {
  position: relative;
  overflow: hidden;
}

.question-en {
  margin: 0;
  font-size: clamp(1.55rem, 6.3vw, 2.35rem);
  line-height: 1.06;
  letter-spacing: -.055em;
  font-weight: 900;
}

.question-ur {
  margin: 14px 0 0;
  direction: rtl;
  text-align: right;
  font-family: "Noto Nastaliq Urdu", "Noto Sans Arabic", serif;
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  line-height: 2.25;
  color: #102a4d;
}

.answer-box {
  display: none;
  margin-top: 16px;
  border-radius: 24px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.answer-box.show {
  display: block;
}

.answer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #ecfeff;
  border-bottom: 1px solid #cffafe;
  color: #155e75;
  font-weight: 900;
}

.answer-list {
  padding: 14px 18px 16px;
  margin: 0;
}

.answer-list li {
  margin: 8px 0;
  font-weight: 700;
  line-height: 1.35;
}

.answer-ur {
  direction: rtl;
  text-align: right;
  font-family: "Noto Nastaliq Urdu", "Noto Sans Arabic", serif;
  font-size: 1.08rem;
  line-height: 2.15;
  color: #334155;
  border-top: 1px dashed #cbd5e1;
  padding: 12px 18px 18px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.action-row.single {
  grid-template-columns: 1fr;
}

.btn {
  border: 0;
  border-radius: 20px;
  min-height: 54px;
  padding: 0 16px;
  font-weight: 900;
  letter-spacing: -.01em;
  transition: transform .15s ease, opacity .15s ease;
}

.btn:active {
  transform: scale(.98);
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 14px 28px rgba(37,99,235,.24);
}

.btn.dark {
  color: white;
  background: #0f172a;
}

.btn.light {
  color: #0f172a;
  background: #e2e8f0;
}

.btn.green {
  color: #166534;
  background: var(--greenBg);
}

.btn.red {
  color: #991b1b;
  background: var(--redBg);
}

.btn.full {
  width: 100%;
}

.score-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.score-pill {
  color: white;
  text-align: center;
  padding: 12px 8px;
  border-radius: 22px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}

.score-pill span {
  display: block;
  color: rgba(255,255,255,.60);
  font-size: .72rem;
  font-weight: 800;
}

.score-pill b {
  display: block;
  margin-top: 2px;
  font-size: 1.35rem;
  letter-spacing: -.04em;
}

.result-card {
  text-align: center;
  padding: 28px 20px;
}

.result-card h1 {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: -.07em;
}

.result-card p {
  color: var(--muted);
  margin: 10px 0 20px;
}

.input {
  width: 100%;
  min-height: 58px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 0 16px;
  outline: none;
  font-size: 1.05rem;
  background: white;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.diff {
  margin-top: 14px;
  line-height: 2;
}

.diff .ok {
  color: var(--green);
  font-weight: 900;
}

.diff .miss {
  color: var(--red);
  text-decoration: underline;
  font-weight: 900;
}

.read-list {
  display: grid;
  gap: 12px;
}

.read-card {
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 16px;
  background: white;
}

.read-card p {
  margin: 0 0 12px;
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: -.035em;
}

.interview-section {
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  overflow: hidden;
  background: white;
  margin-bottom: 12px;
}

.interview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  font-weight: 900;
  background: #f8fafc;
}

.interview-q {
  padding: 14px 15px;
  border-top: 1px solid #e2e8f0;
}

.interview-q b {
  display: block;
  line-height: 1.35;
}

.interview-q span {
  display: block;
  color: var(--green);
  margin-top: 6px;
  font-size: .9rem;
  font-weight: 700;
}

.check-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid #e2e8f0;
}

.check-item input {
  width: 24px;
  height: 24px;
  accent-color: var(--blue);
}

.check-item label {
  line-height: 1.45;
  font-weight: 650;
}

.notice {
  margin-top: 14px;
  border-radius: 22px;
  padding: 14px;
  background: var(--amberBg);
  color: #92400e;
  font-weight: 750;
  line-height: 1.45;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safeBottom));
  transform: translateX(-50%);
  z-index: 30;
  width: min(500px, calc(100vw - 24px));
  height: 72px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 28px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  background: rgba(7,17,31,.76);
  backdrop-filter: blur(22px);
  box-shadow: 0 20px 60px rgba(0,0,0,.38);
}

.nav-btn {
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: rgba(255,255,255,.58);
  display: grid;
  place-items: center;
  gap: 2px;
  font-weight: 900;
  font-size: .72rem;
}

.nav-btn.active {
  color: white;
  background: rgba(255,255,255,.13);
}

.nav-btn b {
  display: block;
  font-size: .9rem;
  letter-spacing: -.02em;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 18px;
  display: grid;
  place-items: end center;
  background: rgba(2,8,23,.56);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(500px, 100%);
  border-radius: 30px;
  padding: 18px;
  background: white;
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0 0 12px;
  letter-spacing: -.04em;
}

.ur-ui {
  font-family: "Noto Sans Arabic", "Noto Nastaliq Urdu", sans-serif;
}

.ur-copy {
  font-family: "Noto Nastaliq Urdu", "Noto Sans Arabic", serif;
  direction: rtl;
  text-align: right;
  line-height: 2.2;
}

body.lang-ur .brand-title b,
body.lang-ur .mode-card h3,
body.lang-ur .mode-card p,
body.lang-ur .section-title,
body.lang-ur .nav-btn,
body.lang-ur .btn,
body.lang-ur .badge,
body.lang-ur .notice,
body.lang-ur label {
  font-family: "Noto Sans Arabic", Inter, sans-serif;
}

body.lang-ur .question-ur {
  font-family: "Noto Nastaliq Urdu", "Noto Sans Arabic", serif;
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 10px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .ring {
    margin: 0 auto;
  }

  .mode-card {
    min-height: 140px;
  }
}
