@import url("/assets/fonts.css");

:root {
  --ink: #16302B;
  --ink-2: #3E504A;
  --muted: #4A5A55;
  --green: #1E6B50;
  --green-dark: #134735;
  --green-tint: #E7F1EC;
  --gold: #8A5B0E;
  --gold-light: #E3B65C;
  --ground: #F6F5EF;
  --card: #FFFFFF;
  --line: #DEDBCF;
  --field: #B9BFB5;
  --danger: #A12C1E;
  --danger-tint: #FBEAE7;
  --radius: 14px;
  --body: Inter, system-ui, sans-serif;
  --display: Manrope, Inter, sans-serif;
  --arabic: Amiri, "Noto Naskh Arabic", serif;
}
html[lang="ar"] { --body: "Noto Naskh Arabic", Tahoma, sans-serif; --display: "Noto Naskh Arabic", Tahoma, sans-serif; }
html[lang="ur"] { --body: "Noto Nastaliq Urdu", "Noto Naskh Arabic", sans-serif; --display: "Noto Nastaliq Urdu", "Noto Naskh Arabic", sans-serif; }
html[lang="ur"] body { line-height: 2.1; }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3 { line-height: 1.9; }
html[lang="ar"] h1, html[lang="ar"] h2 { line-height: 1.5; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
a { color: var(--green); } a:hover { color: var(--green-dark); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -0.015em; }
h3 { font-size: 20px; font-weight: 700; }
html[dir="rtl"] h1, html[dir="rtl"] h2 { letter-spacing: 0; }
p { margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }

.container { max-width: 1160px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 760px; }
.section { padding-block: 72px; }
.section-white { background: var(--card); border-block: 1px solid var(--line); }
.section-dark { background: var(--ink); color: var(--ground); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
html[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 620px; }
.arabic { font-family: var(--arabic); direction: rtl; }

/* header / footer */
#site-header { background: var(--ground); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.logo { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-ar { font-family: var(--arabic); font-size: 30px; line-height: 1; color: var(--green); font-weight: 700; }
.logo-en { font-family: Manrope, sans-serif; font-weight: 800; font-size: 21px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 18px; font-weight: 500; font-size: 15px; flex: 1 1 auto; min-width: 0; }
.logo { flex: none; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 2px; }
.nav a.active, .nav a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 6px; }
.lang-select { width: auto; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--field); background: var(--card); font: inherit; color: var(--ink); min-height: 40px; }
.config-banner { background: #FFF4D6; color: #6B4A06; text-align: center; padding: 8px; font-size: 14px; }
#site-footer { background: var(--ink); color: #C9D6D1; margin-top: 0; }
#site-footer a { color: var(--gold-light); }
.footer-row { padding-block: 40px; display: flex; flex-direction: column; gap: 8px; }
.footer-brand { color: #fff; font-family: Manrope, sans-serif; font-weight: 800; font-size: 18px; }
.footer-brand .logo-ar { color: var(--gold-light); font-size: 26px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px;
  border-radius: 999px; font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--field); }
.btn-gold { background: var(--gold-light); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* cards & forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.card-soft { background: var(--ground); border-radius: 18px; padding: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, legend { font-size: 15px; font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); }
input[type="text"], input:not([type]), input[type="email"], input[type="tel"], input[type="date"], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--field); border-radius: 10px; padding: 11px 13px; min-height: 46px; width: 100%; }
textarea { resize: vertical; min-height: 96px; }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
.hint { font-size: 14px; color: var(--muted); min-height: 20px; }
.hint.ok { color: var(--green); } .hint.bad { color: var(--danger); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--field); border-radius: 12px; background: #fff; font-weight: 500; }
.choice input:checked + span { border-color: var(--green); background: var(--green-tint); color: var(--green-dark); }
.choice input:focus-visible + span { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--green); }

.notice { padding: 16px 18px; border-radius: 12px; font-size: 16px; }
.notice-info { background: var(--ground); border: 1px solid var(--line); }
.notice-success { background: var(--green-tint); color: var(--green-dark); }
.notice-error { background: var(--danger-tint); color: var(--danger); }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--ground); color: var(--ink-2); border: 1px solid var(--line); }
.badge-green { background: var(--green-tint); color: var(--green-dark); border-color: transparent; }
.badge-gold { background: #FBF0D9; color: var(--gold); border-color: transparent; }
.badge-red { background: var(--danger-tint); color: var(--danger); border-color: transparent; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.step { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--ground); }
.step .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: #fff; border: 1.5px solid var(--field); flex: none; }
.step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }

/* home */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-text { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero-card { flex: 1 1 320px; }
.bismillah { font-family: var(--arabic); font-size: 26px; color: var(--gold); }
.mark { display: flex; flex-direction: column; align-items: center; }
.mark .arabic { font-size: 86px; line-height: 1.1; color: var(--green); font-weight: 700; }
.mark .wordmark { font-family: Manrope, sans-serif; font-weight: 800; letter-spacing: 0.3em; font-size: 14px; color: var(--ink); padding-top: 6px; }
.pillar .arabic { font-size: 30px; color: var(--green); text-align: end; }
html[dir="rtl"] .pillar .arabic { text-align: start; }
.verse { text-align: center; display: flex; flex-direction: column; gap: 22px; align-items: center; }
.verse .arabic { font-size: clamp(40px, 6vw, 60px); color: #fff; line-height: 1.2; }
.verse .ref { color: #C9D6D1; font-weight: 600; font-size: 15px; }
.verse .meaning { font-family: var(--display); font-weight: 600; font-size: clamp(21px, 2.6vw, 28px); line-height: 1.5; max-width: 760px; }
.round-btn { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid #6F8A82; background: transparent; color: var(--ground); cursor: pointer; display: grid; place-items: center; }
html[dir="rtl"] .round-btn svg { transform: scaleX(-1); }
.num { font-family: Manrope, sans-serif; font-weight: 800; font-size: 38px; color: var(--green); }

/* lists */
.list { display: flex; flex-direction: column; gap: 14px; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }

/* admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat b { display: block; font-family: Manrope, sans-serif; font-size: 30px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--ground); font-weight: 600; white-space: nowrap; }

@media (max-width: 640px) {
  .section { padding-block: 48px; }
  .card { padding: 20px; }
  .mark .arabic { font-size: 64px; }
}
html[lang="ur"] .stack-sm { gap: 16px; }
.verse-ar { font-family: "Amiri Quran", Amiri, serif; font-size: clamp(24px, 3.2vw, 34px); line-height: 2.2; color: #fff; max-width: 860px; }
.verse-ar .vnum { color: var(--gold-light); font-size: 0.8em; }
.verse-tr { max-width: 760px; font-size: clamp(17px, 2vw, 21px); line-height: 1.7; display: flex; flex-direction: column; gap: 8px; }
.verse-tr[lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; line-height: 2.3; }
.vnum-tr { color: var(--gold-light); font-weight: 700; }

/* Inside the phone apps: keep content clear of the notch / status bar / home bar */
html.in-app #site-header { padding-top: env(safe-area-inset-top); }
html.in-app #site-footer { padding-bottom: env(safe-area-inset-bottom); }
html.in-app body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
