:root{
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;

  --brand: #7f1515;
  --btn-primary: #6f1414;
  --btn-primary-text: #ffffff;

  --btn-outline: #ffffff;
  --btn-outline-text: #111827;

  --tint-lav: #f3f1ff;
  --tint-sand: #fbf3e7;
  --tint-white: #ffffff;
  --tint-blue: #ecf6ff;
  --tint-yellow: #fbf7df;
  --tint-green: #ecf9f1;

  --btn-test: #2563eb;
  --btn-catequista: #f59e0b;
  --btn-wa: #16a34a;

  --radius-xl: 18px;
  --container: 1100px;

  --streak-accent: #92400e;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Inter", sans-serif;
  overflow-x: hidden;
}

a{ color: inherit; text-decoration: none; }
.no-scroll{ overflow: hidden !important; }

.app{ width: 100%; }

/* LOGIN */
.login-wrap{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(980px 520px at 18% 12%, rgba(127,21,21,0.20), rgba(127,21,21,0) 60%),
    radial-gradient(820px 460px at 82% 28%, rgba(220,38,38,0.14), rgba(220,38,38,0) 55%),
    linear-gradient(#ffffff, #ffffff);
}
.login-wrap::before{
  content: "";
  position: absolute;
  inset: -120px;
  background-image: url('imgs/simbolo-apoios.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 420px;
  opacity: 0.06;
  transform: rotate(-8deg);
  pointer-events: none;
}
.login-card{
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.96);
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}
.login-brand{
  text-align: center;
  margin-bottom: 12px;
}
.login-brand img{
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px auto;
}
.login-title{
  font-weight: 1000;
  font-size: 18px;
}
.login-sub{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.login-error{
  margin: 10px 0;
  border: 1px solid rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.08);
  color: #991b1b;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 900;
  font-size: 13px;
}
.login-form{ display: grid; gap: 10px; }

.field{
  display: grid;
  gap: 6px;
}
.field-label{
  font-weight: 1000;
  font-size: 12px;
  color: rgba(17,24,39,0.70);
}
.input-wrap{
  position: relative;
}
.field-ico{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.65;
  pointer-events: none;
}
.field input{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px 12px 38px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.btn-full{ width: 100%; justify-content: center; }

/* TOPBAR */
.topbar{
  width: min(var(--container), calc(100% - 24px));
  margin: 14px auto 10px auto;
  background: var(--brand);
  border-radius: var(--radius-xl);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.topbar-left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand{ display: flex; align-items: center; }
.brand-logo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.pill-words{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.pill-word{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}
.pill-word i{ font-size: 12px; opacity: 0.95; }

.topbar-center{ display: flex; justify-content: center; }

.pill-datetime{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  white-space: nowrap;
}

.topbar-right{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.hello{
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.92);
  min-width: 0;
}
.hello span{
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar{
  width: 30px;
  height: 30px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.18);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.avatar img{ width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback{
  color: rgba(255,255,255,0.92);
  font-weight: 800;
  font-size: 12px;
}

.icon-exit{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
}
.icon-exit i{ font-size: 14px; }

/* TABS */
.tabs{
  width: min(var(--container), calc(100% - 24px));
  margin: 0 auto 12px auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
}
.tab i{ opacity: 0.9; }
.tab.active{
  border-color: rgba(127,21,21,0.25);
  background: rgba(127,21,21,0.06);
}

.container{
  width: min(var(--container), calc(100% - 24px));
  margin: 0 auto 18px auto;
}

/* GRIDS */
.grid-top{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.grid-bottom{
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.right-stack{
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 12px;
}

/* CARDS */
.card{
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 14px;
  overflow: hidden;
  background: var(--tint-white);
}

.card .wm{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-45%);
  font-size: 78px;
  line-height: 1;
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
  color: #111827;
}

.card-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.head-left{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.head-left i{ opacity: 0.9; }

.muted{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.small{ font-size: 12px; }

/* BUTTONS */
.btn{
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: #fff;
}
.btn i{ font-size: 13px; }
.btn-sm{ padding: 7px 9px; font-size: 12.5px; border-radius: 11px; }
.btn-sm i{ font-size: 12px; }
.btn-primary{ background: var(--btn-primary); color: var(--btn-primary-text); }
.btn-outline{ background: var(--btn-outline); color: var(--btn-outline-text); border-color: var(--border); }
.btn-test{ background: var(--btn-test); color: #fff; }
.btn-test:disabled{ opacity: 0.55; cursor: not-allowed; }
.btn-catequista{
  background: #ffffff;
  color: #111827;
  border-color: rgba(17,24,39,0.14);
}
.btn-catequista:hover{
  border-color: rgba(17,24,39,0.18);
  filter: brightness(0.98);
}
.btn-wa{ background: var(--btn-wa); color: #fff; }

/* SAINT */
.card-saint{ background: var(--tint-lav); }
.saint-quote{
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  padding-right: 82px;
}
.saint-author{
  margin-top: 10px;
  color: rgba(17,24,39,0.55);
  font-size: 12.5px;
  font-weight: 800;
}

/* STREAK */
.card-streak{ background: var(--tint-sand); }

.streak-row{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.streak-badge{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  flex: 0 0 auto;
}
.streak-badge i{
  font-size: 16px;
  animation: flame 1.25s ease-in-out infinite;
}
@keyframes flame{
  0%{ transform: translateY(0) scale(1); opacity: 0.9; }
  50%{ transform: translateY(-1px) scale(1.06); opacity: 1; }
  100%{ transform: translateY(0) scale(1); opacity: 0.9; }
}

.streak-metrics{ min-width: 0; }

.streak-main{
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.streak-number{
  font-size: 24px;
  font-weight: 1000;
  color: var(--streak-accent);
}

.streak-label{
  font-weight: 1000;
  color: var(--streak-accent);
}

.streak-line{
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: rgba(17,24,39,0.55);
  font-size: 12px;
  font-weight: 800;
}
.streak-line strong{
  color: rgba(17,24,39,0.78);
  font-weight: 1000;
}
.dot{ opacity: 0.55; }

.streak-msg{
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: rgba(17,24,39,0.68);
}

.streak-progress{ margin-top: 10px; }

.bar{
  height: 8px;
  border-radius: 999px;
  background: rgba(17,24,39,0.08);
  overflow: hidden;
}
.fill{
  height: 100%;
  background: rgba(180, 83, 9, 0.65);
  border-radius: 999px;
}
.fill-freq{
  background: rgba(127,21,21,0.62);
}

/* FREQUENCY */
.card-freq{ background: #fff; }
.freq-mini{
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.freq-mini-val{
  font-weight: 1000;
  color: rgba(17,24,39,0.72);
  font-size: 12px;
}
.freq-mini-pct{
  font-weight: 1000;
  font-size: 12px;
  color: rgba(127,21,21,0.85);
}
.freq-body{ display: grid; gap: 10px; }
.freq-line{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.freq-line strong{
  font-weight: 1000;
}
.freq-progress{ margin-top: -2px; }

/* PRESENCE ACTIONS */
.presence-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* CALENDAR (no watermark) */
.card-calendar{ background: #fff; }

.calendar-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-item{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 10px;
  align-items: center;
  background: #fff;
}

.cal-date{
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(37,99,235,0.18);
  background: rgba(37,99,235,0.06);
  text-align: center;
}

.cal-weekday{ font-weight: 900; font-size: 12px; color: #1f2937; }
.cal-day{ font-weight: 900; font-size: 12px; color: #1f2937; margin-top: 2px; }

/* menos bold como você pediu */
.cal-title{
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  padding-right: 10px;
  color: rgba(17,24,39,0.86);
}

.cal-tag{
  font-weight: 1000;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(127,21,21,0.18);
  background: rgba(127,21,21,0.06);
  color: #6f1414;
  white-space: nowrap;
}
.cal-tag.today{
  background: rgba(22,163,74,0.10);
  border-color: rgba(22,163,74,0.22);
  color: #166534;
}

/* STACK CARDS */
.card-test{ background: var(--tint-blue); }

.row-actions{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card-catequista{ background: var(--tint-yellow); }

.catequista-head{
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
}
.agent-img{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
}

.card-whatsapp{ background: var(--tint-green); }

/* FOOTER */
.bible-footer{
  align-items: center;
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0 2px 0;
}
.bible-ref{
  font-weight: 1000;
  color: rgba(17,24,39,0.55);
}

/* DRAWER */
.drawer{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999;
}
.drawer.open{ display: block; }
.drawer-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,0.34);
  backdrop-filter: blur(6px);
}
.drawer-panel{
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(520px, 94vw);
  background: #fff;
  border-left: 1px solid var(--border);
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  box-shadow: 0 22px 52px rgba(17,24,39,0.18);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.drawer-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(127,21,21,0.06), rgba(127,21,21,0));
}
.drawer-title{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 1000;
}
.drawer-close{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.drawer-iframe{
  width: 100%;
  height: 100%;
  border: 0;
}
.drawer-body{
  padding: 12px;
  overflow: auto;
}

/* FORM INSIDE DRAWER */
.form{ display: grid; gap: 12px; }
.field-label{
  font-weight: 1000;
  font-size: 12px;
  color: rgba(17,24,39,0.70);
}
.select-wrap, .textarea-wrap{
  position: relative;
}
.select-wrap i, .textarea-wrap i{
  position: absolute;
  left: 12px;
  top: 12px;
  opacity: 0.6;
}
.select-wrap select{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px 12px 38px;
  font-size: 14px;
  background: #fff;
  outline: none;
}
.textarea-wrap textarea{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px 12px 38px;
  font-size: 14px;
  background: #fff;
  outline: none;
  resize: vertical;
}
.form-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.form-feedback{
  margin-top: 6px;
  font-weight: 1000;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
}
.form-feedback.ok{
  border-color: rgba(22,163,74,0.25);
  background: rgba(22,163,74,0.08);
  color: #166534;
}
.form-feedback.bad{
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.08);
  color: #991b1b;
}

/* FREQUENCY LIST */
.freq-list{
  display: grid;
  gap: 10px;
}
.freq-item{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
}
.freq-date{
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(127,21,21,0.18);
  background: rgba(127,21,21,0.06);
  text-align: center;
}
.freq-day{ font-weight: 1000; font-size: 12px; }
.freq-week{ font-weight: 900; font-size: 11px; color: rgba(17,24,39,0.55); margin-top: 2px; }
.freq-desc{ font-weight: 900; font-size: 13px; color: rgba(17,24,39,0.86); }
.freq-tag{
  font-weight: 1000;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  white-space: nowrap;
}
.freq-tag.ok{
  border-color: rgba(22,163,74,0.25);
  background: rgba(22,163,74,0.10);
  color: #166534;
}
.freq-tag.warn{
  border-color: rgba(245,158,11,0.25);
  background: rgba(245,158,11,0.12);
  color: #92400e;
}
.freq-tag.bad{
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.10);
  color: #991b1b;
}

/* SOON */
.soon{ padding: 40px 0; }
.soon-card{
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
}
.soon-icon{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(127,21,21,0.08);
  color: var(--brand);
}
.soon-title{ font-weight: 1000; }

/* RESPONSIVE */
@media (max-width: 980px){
  .grid-top{ grid-template-columns: 1fr; }
  .grid-bottom{ grid-template-columns: 1fr; }
  .card .wm{ font-size: 70px; right: 10px; }
}

@media (max-width: 560px){
  .topbar{
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .topbar-center{ justify-content: flex-start; }
  .topbar-right{ justify-content: space-between; }

  .tabs{ gap: 8px; }
  .tab{ padding: 8px 10px; font-size: 13px; }

  .card{ padding: 12px; }
  .card .wm{ font-size: 64px; right: 10px; }

  .saint-quote{ font-size: 23px; padding-right: 70px; }
  .cal-item{ grid-template-columns: 62px 1fr auto; }
  .btn{ padding: 8px 10px; font-size: 13px; }
}

.bible-ico{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(127,21,21,0.18);
  background: rgba(127,21,21,0.07);
  display: grid;
  place-items: center;
  color: rgba(127,21,21,0.95);
  flex: 0 0 auto;
}
.bible-text{
  max-width: 760px;
}
