/* Islamic Souls — "Thursday Night" theme.
   Night-teal ground (the Thursday-night tradition of remembering the dead), shrine gold accents,
   mihrab-arch photo frames as the signature element. */
:root {
  --bg: #0E1B1C;
  --surface: #16292A;
  --surface-2: #1B3233;
  --line: #2A4142;
  --line-2: #3B5455;
  --text: #EFE7D8;
  --soft: #D4CCBC;
  --muted: #B5AE9F;
  --gold: #CDA955;
  --gold-hi: #E2C47A;
  --on-gold: #0E1B1C;
  --danger: #F0A899;
  --ok: #93D1AE;
  --radius: 14px;
  --display: "Amiri", "Times New Roman", serif;
  --ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 16px; line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(34px, 7vw, 54px); }
h2 { font-size: clamp(26px, 4.6vw, 34px); }
h3 { font-size: 22px; }
p { margin: 0; }
.ar { font-family: var(--display); direction: rtl; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.section { padding: 48px 0; }
.section-tight { padding: 28px 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand span { font-family: var(--display); font-size: 24px; font-weight: 700; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { color: var(--soft); text-decoration: none; padding: 10px 12px; border-radius: 22px; font-size: 15px; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav .btn { padding: 10px 18px; }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: transparent; border-radius: 10px; color: var(--text); align-items: center; justify-content: center; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 20px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 10px; font-size: 17px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: 26px; border: 1px solid transparent; font: 600 17px/1 var(--ui); text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hi); color: var(--on-gold); }
.btn-line { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-line:hover { border-color: var(--gold); color: var(--text); }
.btn-ghost { background: transparent; color: var(--gold); border: 0; min-height: 44px; padding: 0 8px; }
.btn-sm { min-height: 44px; font-size: 15px; padding: 0 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; }
.btn-danger { background: transparent; color: var(--danger); border-color: #6b3b33; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-gold { border-color: var(--gold); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 1.2px; color: var(--gold); text-transform: uppercase; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Arch frames — the signature element */
.arch { border-radius: 999px 999px 10px 10px / 46% 46% 10px 10px; overflow: hidden; background: var(--surface); border: 1.5px solid var(--gold); position: relative; }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.arch-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.arch-empty svg { width: 34%; opacity: .55; }

/* Forms */
label { font-size: 15px; font-weight: 500; color: var(--soft); }
.field { display: flex; flex-direction: column; gap: 6px; }
.hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=date], input[type=password], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--text); font: 16px var(--ui);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(205,169,85,.18); }
input::placeholder, textarea::placeholder { color: #8C978F; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.85); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--gold); background: var(--surface-2); }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--gold); flex-shrink: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); margin: 1px 0 0; flex-shrink: 0; }

.alert { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 15px; }
.alert-error { border-color: #7a4036; color: var(--danger); }
.alert-ok { border-color: #2f6a4c; color: var(--ok); }
.alert:empty { display: none; }

/* Search */
.searchbar { display: flex; gap: 8px; }
.searchbar input { border-radius: 26px; padding-left: 18px; min-height: 54px; }
.searchbar button { width: 54px; height: 54px; flex-shrink: 0; border-radius: 27px; border: 1px solid var(--gold); background: transparent; color: var(--gold); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.searchbar button:hover { background: var(--gold); color: var(--on-gold); }

/* Memorial grid */
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.m-card { text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 8px; }
.m-card:hover { color: var(--text); }
.m-card .arch { aspect-ratio: 3 / 4; }
.m-card:hover .arch { border-color: var(--gold-hi); }
.m-card .name { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2; }
.m-card .dates { font-size: 13px; color: var(--muted); }
.empty-note { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* Pricing */
.price { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; }
.price small { font-family: var(--ui); font-size: 16px; font-weight: 500; color: var(--muted); }
.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }

/* Hero */
.hero { padding: 52px 0 40px; text-align: center; }
.hero .verse { font-size: clamp(26px, 5vw, 34px); color: var(--gold); line-height: 1.7; }
.hero h1 { max-width: 760px; margin: 14px auto 0; }
.hero .lede { max-width: 620px; margin: 16px auto 0; font-size: 18px; color: var(--muted); }
.hero .ctas { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 26px; }
@media (min-width: 640px) { .hero .ctas { flex-direction: row; justify-content: center; } }
.ornament { display: flex; align-items: center; gap: 14px; color: var(--gold); justify-content: center; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 60px; background: var(--line-2); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step-num { width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--gold); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }

/* Memorial page */
.mem-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 36px 0 8px; }
.mem-photo { width: min(260px, 70vw); aspect-ratio: 3 / 4; }
.mem-head .ar { font-size: 30px; color: var(--gold); }
.mem-dates { font-size: 17px; color: var(--soft); }
.fatiha-box { text-align: center; }
.rem-list { display: flex; flex-direction: column; }
.rem-item { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rem-item .when { text-align: right; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gallery button { padding: 0; border: 1px solid var(--line); border-radius: 60px 60px 6px 6px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface); cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.story { font-size: 17px; line-height: 1.7; color: var(--soft); white-space: pre-line; }
.paused-block { position: relative; }
.paused-blur { filter: blur(9px); user-select: none; pointer-events: none; }
.paused-blur .ph { height: 14px; background: var(--line-2); border-radius: 7px; margin: 10px 0; }
.paused-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }

/* Lightbox / dialogs */
dialog { border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); color: var(--text); padding: 0; max-width: min(560px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(5, 12, 12, .78); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.lightbox { max-width: 96vw; background: #000; border: 0; }
.lightbox img { max-height: 86vh; width: auto; margin: 0 auto; }

/* Wizard */
.progress { display: flex; gap: 6px; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); }
.progress span.on { background: var(--gold); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 48px 48px 6px 6px; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 16px; border: 0; background: rgba(14,27,28,.85); color: var(--text); cursor: pointer; }
.thumb .tag { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: var(--gold); color: var(--on-gold); padding: 2px 7px; border-radius: 9px; font-weight: 600; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; }
.dropzone:hover { border-color: var(--gold); }
.pay-methods { display: flex; flex-direction: column; gap: 10px; }
#card-container { min-height: 90px; }
.wallet-btn { min-height: 50px; }
.apple-pay-button { -webkit-appearance: -apple-pay-button; -apple-pay-button-type: plain; -apple-pay-button-style: white; height: 50px; width: 100%; border-radius: 26px; cursor: pointer; display: none; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; margin-top: 40px; color: var(--muted); font-size: 14px; }
.site-footer .cols { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.site-footer a { color: var(--soft); }

/* Tables (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: var(--surface); position: sticky; top: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); }
.pill-active { color: var(--ok); border-color: #2f6a4c; }
.pill-lapsed { color: var(--danger); border-color: #7a4036; }
.pill-pending { color: var(--gold); border-color: #6e5a2b; }
.pill-muted { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat b { display: block; font-family: var(--display); font-size: 32px; }
