/* rijal-alfajr: tokens from the handoff (§2). Mobile-first, 390px design width. */
@font-face {
  font-family: "Thmanyah Serif Display";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/thmanyah-display.woff2") format("woff2");
}
@font-face {
  font-family: "Readex Pro";
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/readex-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+FE70-FEFF, U+200C-200F;
}
@font-face {
  font-family: "Readex Pro";
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/readex-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2010-2027;
}
@font-face {
  font-family: "Amiri";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/amiri-arabic.woff2") format("woff2");
}

:root {
  --ink: #141a3a;
  --ink-2: #2e3863;
  --text-2: #4e5470;
  --muted: #646a85;
  --gold: #f2c46d;
  --bg: #f4f1ec;
  --surface: #fff;
  --hairline: rgb(20 26 58 / 8%);
  --input-line: rgb(20 26 58 / 16%);
  --cream: #fbf3e4;
  --cream-2: rgb(251 243 228 / 82%);
  --success-bg: #e3ede6;
  --success: #1e5a3a;
  --wa-bg: #e3f2e9;
  --wa: #1e7a4a;
  --danger: #9a3b3b;
  --soft: #e9e6ec;
  --dawn: linear-gradient(180deg, #141a3a 0%, #2e3863 35%, #6b7090 65%, #a9a7b0 85%, #cfd4da 100%);
  --shadow: 0 8px 24px rgb(20 26 58 / 12%);
  --display: "Thmanyah Serif Display", "Readex Pro", serif;
  --tab-h: 72px;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
}

/* RTL: the next tab sits to the left, so it slides in from the left. */
html[data-dir="next"]::view-transition-old(root) {
  animation-name: out-to-right;
}
html[data-dir="next"]::view-transition-new(root) {
  animation-name: in-from-left;
}
html[data-dir="prev"]::view-transition-old(root) {
  animation-name: out-to-left;
}
html[data-dir="prev"]::view-transition-new(root) {
  animation-name: in-from-right;
}

@keyframes out-to-left {
  to {
    transform: translateX(-30%);
    opacity: 0;
  }
}
@keyframes in-from-right {
  from {
    transform: translateX(30%);
    opacity: 0;
  }
}
@keyframes out-to-right {
  to {
    transform: translateX(30%);
    opacity: 0;
  }
}
@keyframes in-from-left {
  from {
    transform: translateX(-30%);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Readex Pro", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body:not(.is-admin) {
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}

a {
  color: var(--ink);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.3;
}

h2 {
  font-size: 26px;
}

h3 {
  font-size: 20px;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ink-2);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.sr {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.lead {
  font-size: 16px;
  line-height: 1.85;
}

/* ---- Dawn header ---- */
.dawn {
  position: relative;
  background: var(--dawn);
  color: var(--cream);
  overflow: hidden;
}

.dawn--home {
  height: 410px;
}

.dawn--inner {
  height: 250px;
}

.dawn--done {
  height: 420px;
}

.dawn__photo {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: 38% 22%;
  mask-image: linear-gradient(180deg, transparent 0, #000 70px);
}

.dawn--inner .dawn__photo {
  height: 120px;
}

.dawn--done .dawn__photo {
  height: 220px;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 16px 20px;
}

.brand__name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
}

.brand__place {
  font-size: 13px;
  color: var(--cream-2);
}

.back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-start: -10px;
  color: var(--cream);
}

.ptitle {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 20px;
}

.ptitle h1 {
  font-size: 40px;
}

.ptitle span {
  font-size: 14px;
  color: var(--cream-2);
}

.countdown {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  text-align: center;
}

.countdown span {
  font-size: 14px;
  color: var(--cream-2);
}

.countdown b {
  font-size: 60px;
  font-weight: 600;
  line-height: 1;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.done {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 72px;
  text-align: center;
}

.done h1 {
  font-size: 40px;
}

.done span {
  color: var(--cream-2);
}

.done__mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
}

.done__mark svg {
  width: 30px;
  height: 30px;
}

/* ---- Page body ---- */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 24px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sec {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 28px;
}

.sec__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.card {
  padding: 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.empty {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  padding: 12px;
}

/* ---- Floating prayer card ---- */
.float {
  position: relative;
  margin-top: -64px;
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.float--preview {
  margin-top: 0;
}

.float__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.float__head .muted {
  font-size: 13px;
}

.float__mosque {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
}

.tiles {
  display: flex;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}

.tiles > div,
.tile {
  flex: 1 1 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tiles .muted {
  font-size: 13px;
}

.tiles b {
  font-size: 24px;
  font-weight: 600;
}

/* ---- Steps ---- */
.steps {
  margin: 0;
  list-style: none;
  gap: 16px;
}

.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.steps li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
}

.steps b {
  font-size: 16px;
  font-weight: 500;
}

.steps li span:not(.steps__n) {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.steps__n {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
}

/* ---- Buttons ---- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn--gold {
  background: var(--gold);
  color: var(--ink);
}

.btn--ink {
  background: var(--ink);
  color: var(--cream);
}

.btn--line {
  min-height: 48px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
}

.btn--wa {
  background: var(--wa-bg);
  color: var(--wa);
  font-weight: 500;
}

.btn--sm {
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
}

.danger {
  color: var(--danger);
}

.link {
  align-self: center;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Install card ---- */
.install {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--soft);
  display: flex;
  align-items: center;
  gap: 14px;
}

.install > div {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install b {
  font-size: 15px;
  font-weight: 500;
}

.install span {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

/* ---- Heroes ---- */
.hero {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.hero__text b {
  font-size: 17px;
  font-weight: 500;
}

.hero__text .muted {
  font-size: 13px;
}

.hero--col {
  flex-direction: column;
  text-align: center;
  gap: 8px;
}

.hero--col b {
  font-size: 15px;
  font-weight: 500;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hphoto {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--soft);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  object-fit: cover;
}

.hphoto--big {
  width: 72px;
  height: 72px;
}

.badge {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.badge--ink {
  padding: 6px 10px;
  background: var(--ink);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}

/* ---- Hadith ---- */
.hadith {
  margin: 0;
  gap: 8px;
}

.hadith blockquote {
  margin: 0;
  font-family: "Amiri", serif;
  font-size: 20px;
  line-height: 1.9;
}

/* ---- Forms ---- */
.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.label {
  font-size: 14px;
  font-weight: 500;
}

.field input,
.field select,
.search {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--input-line);
  background: var(--surface);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.field input[dir="ltr"] {
  text-align: start;
}

input[type="tel"][dir="ltr"] {
  text-align: right;
}

.field input[aria-invalid] {
  border-color: var(--danger);
}

.field__err {
  font-size: 12px;
  color: var(--danger);
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}

.consent input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f6e7e7;
  color: var(--danger);
  font-size: 14px;
}

.ok {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 14px;
  font-weight: 500;
}

.row2 {
  display: flex;
  gap: 12px;
}

.row2 > * {
  flex: 1 1 0;
}

/* ---- Bottom tab bar ---- */
.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  display: flex;
  padding: 0 8px env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  view-transition-name: tabbar;
}

.tabbar a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.tabbar a.is-on {
  color: var(--ink);
  font-weight: 600;
}

.tabbar i {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.tabbar a.is-on i {
  background: var(--gold);
}

/* ---- Admin ---- */
.ahead {
  padding: 16px 16px 20px;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ahead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
}

.ahead__brand {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}

.ahead__pill {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgb(251 243 228 / 12%);
  font-size: 12px;
}

.ahead__title {
  font-size: 32px;
}

.atabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgb(251 243 228 / 10%);
  overflow-x: auto;
}

.atabs a {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--cream-2);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.atabs a.is-on {
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
}

.atabs__badge {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

.apage {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.ahead2 {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.previewbox {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: var(--soft);
}

.list {
  padding: 4px 14px;
  gap: 0;
}

.att,
.prow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border-bottom: 1px solid var(--hairline);
}

.list > :last-child {
  border-bottom: 0;
}

.att__text {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.att__text b,
.prow b {
  font-size: 15px;
  font-weight: 500;
}

.tick {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: transparent;
  cursor: pointer;
}

.tick::before {
  content: "";
  grid-area: 1 / 1;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1.5px solid var(--input-line);
  background: var(--surface);
}

.tick svg {
  grid-area: 1 / 1;
  z-index: 1;
}

.tick.is-on {
  color: var(--gold);
}

.tick.is-on::before {
  background: var(--ink);
  border-color: var(--ink);
}

.prow__main {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  color: inherit;
  text-decoration: none;
}

.prow__main > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.prow__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.hrow {
  border-bottom: 1px solid var(--hairline);
}

.iconbtn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  font-size: 22px;
  cursor: pointer;
}

.iconbtn--wa {
  background: var(--wa-bg);
  color: var(--wa);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.st {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.st--pending {
  background: #fbf0d9;
  color: #7a5900;
}

.st--accepted {
  background: var(--success-bg);
  color: var(--success);
}

.st--rejected {
  background: #f6e7e7;
  color: var(--danger);
}

.st--waitlist {
  background: var(--soft);
  color: var(--ink-2);
}

.addrow {
  width: 100%;
  min-height: 56px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}

@media (min-width: 720px) {
  .dawn__photo {
    object-position: 38% 30%;
  }
}
