:root {
  --brand: #1e3a8a;
  --brand-deep: #0f1d45;
  --brand-ink: #ffffff;
  --link: #1e3a8a;
  --card: #ffffff;
  --ink: #0b1220;
  --muted: #5b6475;
  --faint: #8a93a3;
  --line: #e6e8ec;
  --chip: #f2f4f7;
  --ok: #12a150;
  --err: #c62828;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  line-height: 1.5;
  background: var(--brand-deep);
  -webkit-font-smoothing: antialiased;
}
.bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255,255,255,.18), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  background-size: cover; background-position: center;
}
.has-hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), var(--brand-deep) 75%); }

.top { position: relative; z-index: 1; width: 100%; max-width: 420px; text-align: center; padding: 8px 0 20px; min-height: 64px; }
.lang {
  position: absolute; right: 0; top: 4px;
  background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tile {
  width: 76px; height: 76px; margin: 28px auto 12px; padding: 10px;
  background: #fff; border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
}
.logo { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.church { margin: 0; color: rgba(255,255,255,.85); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.tile[hidden] + .church { margin-top: 52px; }

.card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: var(--card);
  border-radius: 28px;
  padding: 28px 24px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
h1 { font-size: 1.65rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; font-weight: 700; }
.message { color: var(--muted); margin: 0 0 18px; font-size: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.info { margin: 0 0 22px; }
.times { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.times li { background: var(--chip); border-radius: 999px; padding: 6px 12px; font-size: .85rem; color: var(--muted); }
.times strong { color: var(--ink); font-weight: 600; }
.address { margin: 12px 0 0; color: var(--muted); font-size: .88rem; display: flex; gap: 6px; align-items: flex-start; }
.address::before {
  content: ""; flex: none; width: 14px; height: 14px; margin-top: 3px; background: currentColor; opacity: .7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.3 7 13 7 13s7-7.7 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.3 7 13 7 13s7-7.7 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.agree { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--muted); margin: 0 0 16px; cursor: pointer; }
.agree input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
a { color: var(--link); font-weight: 600; text-decoration: none; }
.primary {
  display: block; width: 100%; text-align: center;
  background: var(--brand); color: var(--brand-ink);
  border: 0; border-radius: 16px;
  padding: 16px 18px; font: inherit; font-size: 1.05rem; font-weight: 600;
  text-decoration: none; cursor: pointer; min-height: 54px;
  box-shadow: 0 8px 20px rgba(0,0,0,.14);
  transition: transform .15s ease, opacity .15s ease;
}
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.fine { color: var(--faint); font-size: .8rem; margin: 12px 0 0; text-align: center; }

.ghost { display: block; width: 100%; margin: 10px 0 0; background: none; border: 0; padding: 10px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--link); cursor: pointer; }
.pv-list { margin: 0 0 16px; padding-left: 18px; color: var(--ink); font-size: .92rem; line-height: 1.5; }
.pv-list li { margin: 0 0 8px; }
.powered a { color: inherit; text-decoration: underline; margin-left: 2px; }
.ask-title { font-size: 1.2rem; margin: 0 0 4px; }
.ask-sub { color: var(--muted); margin: 0 0 14px; font-size: .92rem; }
.field { display: block; margin: 0 0 12px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,58,138,.15); }
.state { text-align: center; padding: 8px 0; }
.check { width: 56px; height: 56px; margin: 4px auto 10px; border-radius: 50%; background: #e8f7ee; color: var(--ok); display: flex; align-items: center; justify-content: center; }
.success { font-weight: 600; font-size: 1.1rem; margin: 0 0 14px; }
.error { color: var(--err); font-weight: 600; margin: 0 0 14px; }
.links { list-style: none; padding: 0; margin: 0 0 14px; text-align: left; }
.links li a { display: block; padding: 14px 16px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 500; }
.spinner { width: 34px; height: 34px; margin: 10px auto 12px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .primary { transition: none; } }

.badge { display: flex; justify-content: center; align-items: flex-start; gap: 6px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: .78rem; text-align: left; }
.badge svg { flex: none; margin-top: 2px; }

dialog { border: 0; border-radius: 22px; padding: 22px; max-width: 400px; text-align: left; box-shadow: 0 20px 50px rgba(0,0,0,.3); color: var(--ink); }
dialog::backdrop { background: rgba(11,18,32,.5); }
dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
dialog p { color: var(--muted); font-size: .92rem; }
.powered { position: relative; z-index: 1; margin-top: 16px; display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.55); font-size: .75rem; }

@media (prefers-color-scheme: dark) {
  :root { --card: #121a2b; --ink: #eef2fa; --muted: #aab3c5; --faint: #7d879a; --line: #243049; --chip: #1c2740; }
  dialog { background: var(--card); }
  a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
  .primary:disabled { opacity: .5; }
}
.ask-title:focus, .success:focus { outline: none; }
