/* Nikah Simple */
:root {
  --green: #0F4A43;
  --green-dark: #0A332E;
  --green-mid: #14594F;
  --gold: #B8862B;
  --gold-text: #8A6418;
  --gold-light: #E8C877;
  --mint: #EEF4F1;
  --page: #F6F9F8;
  --ink: #1D2B28;
  --ink-2: #33433F;
  --muted: #4D5B57;
  --line: #E3E9E6;
  --line-2: #C9D4D0;
  --warn-bg: #FFF6E0;
  --warn-ink: #5C420C;
  --err-bg: #FBE9E7;
  --err-ink: #8A2A20;
  --ok-bg: #E2F1EA;
  --ok-ink: #0F5A3E;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: #FFFFFF;
}
body.app { background: var(--page); }
img { max-width: 100%; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
h1, h2, h3 { line-height: 1.2; }
.serif, h1.page-title, .section-title { font-family: 'Marcellus', serif; font-weight: 400; color: var(--green); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 900px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); font-family: 'Marcellus', serif; font-size: 24px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-weight: 700; }
.main-nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.main-nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions form { margin: 0; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #fff; font-size: 12px; text-align: center; }
.chip { display: inline-flex; align-items: center; background: var(--mint); color: var(--green); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1.5px solid var(--green);
  background: var(--green); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--green); }
.btn-outline:hover { background: var(--mint); color: var(--green-dark); }
.btn-gold { background: var(--gold-light); border-color: var(--gold-light); color: var(--ink); }
.btn-gold:hover { background: #DDB960; color: var(--ink); }
.btn-danger { background: #fff; color: var(--err-ink); border-color: #E8B4AE; }
.btn-danger:hover { background: var(--err-bg); color: var(--err-ink); }
.btn-small { min-height: 34px; padding: 5px 11px; font-size: 14px; border-radius: 8px; }
.btn-link { background: none; border: none; color: var(--green); padding: 8px; min-height: 0; text-decoration: underline; }
.btn-link:hover { background: none; color: var(--green-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Flash messages */
.flashes { padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.flash { border-radius: 10px; padding: 12px 16px; font-weight: 600; }
.flash-ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash-warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--gold-light); }
.flash-error { background: var(--err-bg); color: var(--err-ink); }

/* Generic layout */
.page { padding: 32px 0 64px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 36px; }
.page-head p { margin: 0; color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card + .card { margin-top: 20px; }
.card h2 { margin: 0 0 6px; font-size: 20px; }
.card .hint { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; }
.col-side { flex: 1 1 300px; min-width: 0; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.note { display: flex; gap: 10px; background: var(--mint); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.note-warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--gold-light); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.badge-approved, .badge-verified { background: var(--ok-bg); color: var(--ok-ink); }
.badge-pending { background: var(--warn-bg); color: var(--warn-ink); }
.badge-disabled, .badge-rejected { background: var(--err-bg); color: var(--err-ink); }
.badge-hidden, .badge-none { background: #E9ECEB; color: #3B4643; }

/* Forms */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label.field .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=search], select, textarea {
  font: inherit; font-weight: 400; font-size: 16px; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; width: 100%;
}
textarea { resize: vertical; }
input[disabled] { background: #F0F3F2; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.check-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.form-error { color: var(--err-ink); font-size: 14px; font-weight: 600; }
.auth { max-width: 520px; margin: 0 auto; }

/* Switch list (what others can see) */
.switch-list { list-style: none; margin: 0; padding: 0; }
.switch-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #EEF2F0; }
.switch-list .state { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #B7C3BF; border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { left: 25px; }
.switch input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.switch input:disabled + span { opacity: .45; }

/* Photo */
.avatar { width: 64px; height: 64px; border-radius: 14px; background: var(--mint); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 160px; height: 160px; border-radius: 18px; }
.upload-box { border: 2px dashed var(--line-2); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.upload-box input[type=file] { font: inherit; font-size: 14px; max-width: 100%; }

/* Member cards */
.filters { display: flex; flex-direction: column; gap: 16px; }
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.member-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.member-card h2 { margin: 0; font-size: 18px; }
.member-top { display: flex; gap: 14px; align-items: center; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; font-size: 15px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.member-card .btn-row .btn { flex: 1; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }

/* Messages */
.inbox { display: flex; flex-direction: column; gap: 4px; }
.inbox a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.inbox a[aria-current="true"] { background: var(--mint); }
.inbox a:hover { background: var(--page); }
.inbox .preview { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: flex; flex-direction: column; gap: 12px; padding: 18px 0; max-height: 520px; overflow-y: auto; }
.bubble { max-width: 78%; padding: 12px 16px; border-radius: 16px; overflow-wrap: anywhere; }
.bubble p { margin: 0; white-space: pre-line; }
.bubble .meta { font-size: 12px; color: var(--muted); }
.bubble.them { align-self: flex-start; background: var(--mint); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.bubble.me .meta { color: #C4DAD4; }
.stage-panel { background: var(--green); color: #fff; border-radius: 14px; padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.stage-panel .sub { font-size: 14px; color: #DCEAE6; }
.send-form { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.send-form label { flex: 1; }

/* Stage two steps */
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.steps li.done .dot { background: var(--green); color: #fff; }
.steps li.now { border: 2px solid var(--gold); padding: 15px; }
.steps li.now .dot { background: var(--gold); color: #fff; }
.steps .dot { width: 30px; height: 30px; border-radius: 50%; background: #E3E9E6; color: var(--ink-2); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.shared dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.shared dt { color: var(--muted); }
.shared dd { margin: 0; font-weight: 700; }

/* Home page */
.hero { background: var(--green); color: #fff; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .08; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.5'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E"); }
.hero .wrap { position: relative; padding-top: 80px; padding-bottom: 88px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.eyebrow { margin: 0; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; color: var(--gold-text); }
.hero .eyebrow { color: var(--gold-light); }
.hero h1 { margin: 0; font-family: 'Marcellus', serif; font-weight: 400; font-size: clamp(36px, 5vw, 58px); line-height: 1.12; }
.hero .lead { margin: 0; font-size: 20px; color: #DCEAE6; max-width: 560px; }
.hero .fine { margin: 0; font-size: 15px; color: #C4DAD4; }
.hero .btn-outline { background: transparent; color: #fff; border-color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.1); }
.hero-card-wrap { flex: 1 1 340px; min-width: 0; display: flex; justify-content: center; }
.hero-card { width: 100%; max-width: 400px; background: #fff; color: var(--ink); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 48px rgba(0,0,0,.25); }
.section { padding: 88px 0; }
.section-mint { background: var(--mint); }
.section-title { margin: 0; font-size: clamp(30px, 4vw, 42px); }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin-bottom: 40px; }
.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.step { border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.step h3 { margin: 0; font-size: 21px; }
.step p { margin: 0; color: var(--muted); }
.num { width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.num.gold { background: var(--gold); }
.stage-cards { display: flex; flex-wrap: wrap; gap: 22px; }
.stage-card { flex: 1 1 400px; min-width: 0; background: #fff; border-radius: 18px; padding: 34px; display: flex; flex-direction: column; gap: 14px; }
.stage-card h3 { margin: 0; font-size: 26px; }
.stage-card ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.stage-card.dark { background: var(--green); color: #fff; }
.stage-card.dark ul { color: #DCEAE6; }
.stage-card.dark .eyebrow { color: var(--gold-light); }
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.split > * { min-width: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.feature { display: flex; gap: 14px; }
.feature svg { flex-shrink: 0; }
.feature h3 { margin: 0 0 4px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); }
.reminder { max-width: 860px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.reminder .quote { margin: 0; font-family: 'Marcellus', serif; font-size: clamp(24px, 3vw, 34px); line-height: 1.35; color: var(--green); }
.cta { background: var(--green); color: #fff; }
.cta .wrap { padding-top: 72px; padding-bottom: 72px; display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; }
.cta h2 { margin: 0 0 8px; font-family: 'Marcellus', serif; font-weight: 400; font-size: clamp(30px, 4vw, 44px); }
.cta p { margin: 0; color: #DCEAE6; font-size: 18px; }

/* Footer */
.site-footer { background: var(--green-dark); color: #C4DAD4; font-size: 15px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; padding-top: 28px; padding-bottom: 28px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: #DCEAE6; }

/* Tables (admin) */
.table-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 760px; }
table.data th { text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; padding: 13px 16px; border-bottom: 1px solid var(--line); }
table.data td { padding: 13px 16px; border-bottom: 1px solid #EEF2F0; vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data form { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Admin layout */
.admin-shell { display: flex; flex-wrap: wrap; min-height: calc(100vh - 140px); }
.admin-nav { flex: 1 1 210px; background: var(--green-dark); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.admin-nav a { padding: 10px 12px; border-radius: 10px; color: #DCEAE6; text-decoration: none; font-weight: 600; }
.admin-nav a:hover { background: var(--green-mid); color: #fff; }
.admin-nav a[aria-current="page"] { background: var(--green-mid); color: #fff; font-weight: 700; }
.admin-nav .count { margin-left: 6px; }
.admin-main { flex: 999 1 640px; min-width: 0; padding: 28px 24px 56px; }
.admin-main .page-head h1 { font-size: 30px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14px; }
.tabs a[aria-current="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.id-preview { max-width: 100%; max-height: 520px; border: 1px solid var(--line); border-radius: 10px; }

/* Prose pages */
.prose { max-width: 760px; }
.prose h2 { font-size: 22px; margin-top: 28px; }

@media (max-width: 640px) {
  .page-head h1 { font-size: 30px; }
  .card { padding: 18px; }
  .section { padding: 64px 0; }
  .bubble { max-width: 90%; }
  .send-form { flex-direction: column; align-items: stretch; }
}
