/* ============================================================
   RIO - Igreja Jerusalem  (tema escuro + dourado)
   ============================================================ */

:root {
  --bg: #0e0c08;
  --bg-2: #14110b;
  --card: #1a160f;
  --card-2: #211b12;
  --gold: #c9a24b;
  --gold-soft: #e3c987;
  --gold-strong: #b8892f;
  --text: #f4efe6;
  --muted: #a49a8a;
  --border: rgba(201, 162, 75, 0.18);
  --border-soft: rgba(201, 162, 75, 0.10);
  --success: #10b981;
  --danger: #ef4444;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 50% -8%, #231a0e 0%, var(--bg) 55%) fixed,
    var(--bg);
  color: var(--text);
  font-family: 'Jost', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.12;
}

a { color: var(--gold-soft); text-decoration: none; }

::selection { background: rgba(201, 162, 75, 0.35); }

/* ---------- Botoes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  font-family: 'Jost', sans-serif; font-size: 15px; font-weight: 500;
  letter-spacing: .01em; cursor: pointer; transition: all .18s ease;
  text-decoration: none;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: #1a1206; box-shadow: 0 8px 24px rgba(201, 162, 75, .22);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(201, 162, 75, .32); }
.btn-ghost {
  background: transparent; color: var(--gold-soft);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--gold); background: rgba(201, 162, 75, .07); }
.btn-sm { padding: 8px 15px; font-size: 13px; }

/* ---------- Campos ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="password"],
.field input[type="email"],
.field input[type="number"] {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border);
  color: var(--text); font-family: 'Jost', sans-serif; font-size: 16px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #1a160f inset;
  box-shadow: 0 0 0 1000px #1a160f inset;
  transition: background-color 9999s ease-out 0s;
}
.field input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, .15);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
input.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, .15) !important; }

/* ============================================================
   Pagina publica - QR
   ============================================================ */
.public-hero {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
}
.hero-card {
  width: 100%; max-width: 460px; text-align: center;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border); border-radius: 24px;
  padding: 44px 34px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 200px at 50% 0%, rgba(201, 162, 75, .10), transparent 70%);
}
.mono-mark {
  width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: #1a1206; font-family: 'Cormorant Garamond', serif;
  font-weight: 700; font-size: 26px; letter-spacing: .02em;
  box-shadow: 0 0 0 1px rgba(201, 162, 75, .4), 0 0 44px rgba(201, 162, 75, .25);
}
.eyebrow {
  font-size: 11px; letter-spacing: .5em; text-transform: uppercase;
  color: var(--gold-soft); margin-bottom: 10px;
}
.hero-card h1 { font-size: clamp(30px, 7vw, 40px); margin-bottom: 10px; }
.hero-card .lead { color: var(--muted); font-size: 15px; margin-bottom: 30px; }

.qr-frame {
  background: #fff; border-radius: 20px; padding: 16px;
  display: inline-block; margin: 0 auto 26px;
  box-shadow: 0 0 0 1px rgba(201, 162, 75, .25), 0 18px 50px rgba(0, 0, 0, .45);
}
.qr-frame img { display: block; width: 220px; height: 220px; border-radius: 8px; }
.qr-url { font-size: 12px; color: var(--muted); word-break: break-all; margin-bottom: 26px; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; }

.footer-note {
  margin-top: 30px; font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: rgba(164, 154, 138, .6);
}

/* ============================================================
   Pagina publica - Formulario / Sucesso
   ============================================================ */
.form-shell { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.form-card {
  width: 100%; max-width: 520px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border); border-radius: 24px;
  padding: 42px 36px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  position: relative; overflow: hidden;
}
.form-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(460px 210px at 50% 0%, rgba(201, 162, 75, .10), transparent 70%);
}
.form-card .head { text-align: center; margin-bottom: 30px; }
.form-card .head h1 { font-size: clamp(26px, 6vw, 34px); margin-bottom: 6px; }
.form-card .head p { color: var(--muted); font-size: 14px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--muted); margin-bottom: 22px;
}
.back-link:hover { color: var(--gold-soft); }

/* radio cards (Sim / Nao) */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card {
  position: relative; display: block; padding: 16px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, .22);
  cursor: pointer; text-align: center; transition: all .18s ease;
}
.radio-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-card span { font-size: 15px; font-weight: 500; color: var(--text); }
.radio-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.radio-card:has(input:checked) {
  border-color: var(--gold); background: rgba(201, 162, 75, .10);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, .12);
}
.radio-card:has(input:checked) span { color: var(--gold-soft); }

#campo-ministerio {
  display: none; margin-top: 18px;
  animation: fadeUp .3s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.submit-row { margin-top: 26px; }
.submit-row .btn { width: 100%; font-size: 16px; padding: 15px 24px; }

.success-icon {
  width: 78px; height: 78px; margin: 0 auto 22px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .4); font-size: 36px;
}
.form-card.success { text-align: center; }

/* ============================================================
   Admin
   ============================================================ */
.admin {
  min-height: 100vh; padding: 0 0 60px;
}
.admin-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px;
  background: rgba(14, 12, 8, .86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.admin-topbar .brand { display: flex; align-items: center; gap: 12px; }
.brand .dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: #1a1206; font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 16px;
}
.admin-topbar .brand h1 { font-size: 20px; font-weight: 600; }
.admin-topbar .brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: -3px; }
.admin-topbar .top-actions { display: flex; align-items: center; gap: 10px; }

.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 30px 24px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px;
}
.stat .num { font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 700; color: var(--gold-soft); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-top: 6px; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px;
}
.searchbox { flex: 1; min-width: 220px; position: relative; }
.searchbox input {
  width: 100%; padding: 12px 16px 12px 42px; border-radius: 999px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
  color: var(--text); font-family: 'Jost', sans-serif; font-size: 15px;
}
.searchbox input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 75, .12); }
.searchbox .ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lead-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border); border-radius: 18px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px; position: relative;
  transition: border-color .18s ease, transform .18s ease;
}
.lead-card:hover { border-color: var(--border); transform: translateY(-2px); }
.lead-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lead-card .nome { font-size: 19px; font-weight: 500; }
.lead-card .nome .avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(201, 162, 75, .12); color: var(--gold-soft);
  font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 17px; margin-right: 10px;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 999px; font-size: 11px; letter-spacing: .04em; white-space: nowrap;
}
.badge-sim { background: rgba(16, 185, 129, .12); color: #34d399; border: 1px solid rgba(16, 185, 129, .3); }
.badge-nao { background: rgba(164, 154, 138, .12); color: var(--muted); border: 1px solid var(--border); }
.badge-min { background: rgba(201, 162, 75, .14); color: var(--gold-soft); border: 1px solid var(--border); }

.lead-card .info { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.lead-card .info .row { display: flex; align-items: flex-start; gap: 9px; }
.lead-card .info .row .k { width: 18px; color: var(--gold); flex-shrink: 0; text-align: center; }
.lead-card .info .row .v { word-break: break-word; }
.lead-card .date { font-size: 11px; color: rgba(164, 154, 138, .65); letter-spacing: .04em; }

.lead-card .actions { display: flex; gap: 10px; margin-top: auto; }
.wa-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 12px; text-decoration: none;
  background: rgba(16, 185, 129, .14); color: #34d399;
  border: 1px solid rgba(16, 185, 129, .35); font-size: 14px; font-weight: 500;
  transition: all .16s ease;
}
.wa-btn:hover { background: rgba(16, 185, 129, .22); }
.del-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 14px; border-radius: 12px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  font-size: 15px; transition: all .16s ease;
}
.del-btn:hover { color: var(--danger); border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .08); }

.empty {
  text-align: center; padding: 70px 20px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 18px;
}
.empty .big { font-size: 42px; margin-bottom: 12px; }

/* Login */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; }
.login-card {
  width: 100%; max-width: 400px; text-align: center;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border); border-radius: 22px; padding: 44px 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.login-card .field { text-align: left; }
.login-card .btn { width: 100%; }
.login-error {
  background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .35);
  color: #fca5a5; font-size: 13px; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px;
}

@media (max-width: 560px) {
  .form-card, .hero-card { padding: 34px 22px; }
  .admin-wrap { padding: 22px 16px; }
  .admin-topbar { padding: 14px 16px; }
}
