/* v1.5.0 member lifecycle: the /activate page (includes/views/activate.php) and, in the Sangat portal, the mandatory
   profile interceptor and the Request Account Deletion drawer (assets/js/member-lifecycle.js). Self-contained tokens:
   the portal's own classes don't exist on the public site and vice versa. Light: parchment; Temple Dark: onyx + gold
   hairlines (html.dark in the portal, [data-theme="dark"] on djjs.us). Body text ≥ 7:1, targets ≥ 44 px. */
.djml, .djml-page {
  --djml-bg: #FCFBF7; --djml-surface: #FFFFFF; --djml-sunken: #F5EFE4; --djml-ink: #1E1412; --djml-muted: #57453E;
  --djml-line: rgba(217, 119, 6, 0.32); --djml-gold: #7A410A; --djml-crimson: #78122B; --djml-on-crimson: #FFF7EE;
  --djml-danger: #9F1D14; --djml-focus: #78122B; --djml-field: #FFFFFF;
  --djml-shadow: 0 2px 4px rgba(58, 10, 24, 0.07), 0 18px 40px -16px rgba(58, 10, 24, 0.28), 0 36px 70px -34px rgba(120, 18, 43, 0.35);
  --djml-serif: "Cormorant Garamond", "Cormorant Fallback", Georgia, serif;
  color: var(--djml-ink);
}
:is(.dark, [data-theme="dark"]) :is(.djml, .djml-page) {
  --djml-bg: #0D0B09; --djml-surface: #161311; --djml-sunken: #110E0B; --djml-ink: #FCFBF7; --djml-muted: #BBA996;
  --djml-line: rgba(245, 158, 11, 0.3); --djml-gold: #F2B54C; --djml-danger: #FCA5A5; --djml-focus: #FCD34D; --djml-field: #1F1A16;
  --djml-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 20px 44px -16px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(245, 158, 11, 0.08);
}

/* ---------- shared pieces ---------- */
.djml-card__mark { width: 56px; height: 56px; filter: drop-shadow(0 6px 18px rgba(217, 119, 6, 0.35)); }
.djml-eyebrow { margin: 0; color: var(--djml-gold); font-weight: 600; letter-spacing: 0.03em; }
.djml-title { margin: 0; font-family: var(--djml-serif); font-weight: 600; font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.4rem); line-height: 1.12; color: var(--djml-ink); }
.djml-lead { margin: 0; color: var(--djml-ink); font-size: 1.0625rem; line-height: 1.6; }
.djml-hint { margin: 0; color: var(--djml-muted); font-size: 0.9375rem; line-height: 1.5; }
.djml-error, .djml-field__err { margin: 0; min-height: 0; color: var(--djml-danger); font-size: 0.9375rem; font-weight: 500; }
.djml-error:empty, .djml-field__err:empty { display: none; }
.djml-form { display: grid; gap: 14px; }
.djml-field { display: grid; gap: 6px; min-width: 0; }
.djml-field > span, .djml-field > label { font-weight: 600; font-size: 0.9375rem; color: var(--djml-ink); }
.djml-field input, .djml-field select, .djml-field textarea {
  width: 100%; box-sizing: border-box; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--djml-line);
  background: var(--djml-field); color: var(--djml-ink); font: inherit; font-size: 16px; /* 16 px: no zoom on iOS */
}
.djml-field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.djml-field :is(input, select, textarea):focus-visible { outline: 2px solid var(--djml-focus); outline-offset: 2px; border-color: transparent; }
.djml-field [aria-invalid="true"] { border-color: var(--djml-danger); }
.djml-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-top: 10px; box-sizing: border-box; font-size: 0.9375rem; color: var(--djml-ink); cursor: pointer; }
.djml-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--djml-crimson); }
.djml-check a { color: var(--djml-gold); }
.djml-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.djml-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--djml-line); background: transparent; color: var(--djml-ink); font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none;
}
.djml-btn--primary { border-color: rgba(245, 158, 11, 0.6); background: linear-gradient(180deg, #8F1636, #78122B); color: var(--djml-on-crimson); box-shadow: 0 10px 24px -12px rgba(120, 18, 43, 0.8); }
.djml-btn--danger { border-color: transparent; background: linear-gradient(180deg, #9B1844, #6E0F26); color: var(--djml-on-crimson); }
.djml-btn:focus-visible, .djml-link:focus-visible, .djml-x:focus-visible { outline: 2px solid var(--djml-focus); outline-offset: 2px; }
.djml-btn[disabled] { opacity: 0.65; cursor: progress; }
.djml-link { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--djml-muted); font: inherit; font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: center; }
.djml-link:hover { color: var(--djml-ink); }

/* ---------- /activate ---------- */
.djml-page { padding: clamp(28px, 6vw, 72px) 0 clamp(48px, 8vw, 96px); }
.djml-page__wrap { display: grid; justify-items: center; }
.djml-page .djml-card {
  display: grid; gap: 14px; justify-items: stretch; width: min(560px, 100%); box-sizing: border-box; padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--djml-line); border-radius: 22px; background: var(--djml-surface); box-shadow: var(--djml-shadow); text-align: left;
}
.djml-page .djml-card__mark, .djml-page .djml-eyebrow, .djml-page .djml-title { justify-self: center; text-align: center; }
.djml-page [data-act-state] { display: grid; gap: 14px; }
.djml-page [data-act-state][hidden] { display: none; }
.djml-details { display: grid; gap: 0; margin: 0; border: 1px solid var(--djml-line); border-radius: 14px; background: var(--djml-sunken); overflow: hidden; }
.djml-details > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 10px; padding: 10px 14px; border-top: 1px solid var(--djml-line); }
.djml-details > div:first-child { border-top: 0; }
.djml-details dt { color: var(--djml-muted); font-size: 0.9375rem; }
.djml-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.djml-go { justify-self: stretch; min-height: 52px; }
.djml-renew-msg { margin: 0; color: var(--djml-ink); font-weight: 500; }
.djml-renew-msg:empty { display: none; }
.djml-page .djml-actions .btn { min-height: 48px; }
@media (max-width: 479.98px) { .djml-page .djml-actions > * { flex: 1 1 100%; justify-content: center; } }

/* ---------- the portal interceptor (non-dismissible modal) ---------- */
.djml-gate {
  width: min(600px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--djml-line); border-radius: 22px; background: var(--djml-surface); color: var(--djml-ink); box-shadow: var(--djml-shadow);
}
.djml-gate::backdrop, .djml-drawer::backdrop { background: rgba(13, 11, 9, 0.74); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.djml-gate__body { display: grid; gap: 14px; padding: clamp(22px, 5vw, 36px); text-align: left; }
.djml-gate__body > .djml-card__mark, .djml-gate__body > .djml-eyebrow, .djml-gate__body > .djml-title { justify-self: center; text-align: center; }
.djml-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.djml-grid .djml-field[data-field="street"], .djml-grid .djml-field[data-field="whatsapp"] { grid-column: 1 / -1; }
.djml-gate [type="submit"] { width: 100%; min-height: 52px; }
@media (max-width: 559.98px) {
  .djml-gate { width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .djml-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- the deletion drawer ---------- */
.djml-drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0; box-sizing: border-box;
  border: 0; border-left: 1px solid var(--djml-line); background: var(--djml-surface); color: var(--djml-ink); box-shadow: var(--djml-shadow); overflow: auto;
}
.djml-drawer[open] { animation: djml-in 220ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes djml-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.djml-drawer__body { display: grid; gap: 16px; padding: clamp(20px, 5vw, 32px); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.djml-drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.djml-x { flex: none; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--djml-line); background: transparent; color: var(--djml-ink); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.djml-sent { display: grid; gap: 14px; }
.djml-sent__msg { font-weight: 600; }
.djml-drawer .djml-actions > * { flex: 1 1 auto; }

/* ---------- toast ---------- */
.djml-toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 2147483000; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 14px; border: 1px solid var(--djml-line); background: var(--djml-surface); color: var(--djml-ink); box-shadow: var(--djml-shadow);
  font-weight: 600; transition: opacity 300ms ease;
}
.djml-toast.is-out { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .djml-drawer[open] { animation: none; } .djml-toast { transition: none; } }
