/* ============================================================
   Castorflix · Rateio — "cinema noir fintech"
   Bricolage Grotesque (display) · Manrope (UI) · JetBrains Mono (valores)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg:        #0a0b0d;
  --bg-2:      #0e1014;
  --surface:   #15171d;
  --surface-2: #1b1e26;
  --line:      #262a33;
  --line-soft: #1e222a;
  --txt:       #eef0f4;
  --txt-dim:   #b3b9c4;
  --txt-faint: #8b93a1;
  --red:       #e50914;
  --red-hi:    #ff2233;
  --red-glow:  rgba(229, 9, 20, .35);
  --green:     #2fbf71;
  --green-bg:  rgba(47, 191, 113, .12);
  --amber:     #f0a500;
  --amber-bg:  rgba(240, 165, 0, .12);
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 18px 50px -22px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }

html, body { background: var(--bg); }

body {
  font-family: 'Manrope', -apple-system, sans-serif;
  color: var(--txt);
  min-height: 100vh;
  margin: 0;
  letter-spacing: .1px;
  position: relative;
  overflow-x: hidden;
}

/* atmosfera: brilhos radiais + leve vinheta */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(229,9,20,.16), transparent 60%),
    radial-gradient(1100px 600px at 100% 0%, rgba(60,70,110,.12), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}
/* grão de filme */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { max-width: 1080px; }

/* ---------- tipografia ---------- */
h1,h2,h3,h4,h5 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; letter-spacing: -.5px; color: #fff; }
h3 { font-size: 1.5rem; }
.eyebrow { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--txt-faint); font-weight: 700; }
.money { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-variant-numeric: tabular-nums; }
a { color: var(--red-hi); text-decoration: none; }
a:hover { color: #fff; }
.text-muted { color: var(--txt-dim) !important; }

/* ---------- navbar ---------- */
.navbar {
  background: rgba(12,13,16,.72) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  padding: .7rem 0;
  position: sticky; top: 0; z-index: 50;
}
.navbar-brand {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 1.15rem; color: #fff !important; letter-spacing: -.4px; margin-right: 1.25rem;
}
.navbar-brand .accent { color: var(--red); }
.navbar .container { gap: .5rem; }

/* menu colapsível (dropdown) */
.navbar .dropdown-toggle { font-weight: 700; }
.navbar .dropdown-menu {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .3rem; margin-top: .45rem;
}
.navbar .dropdown-item {
  color: var(--txt-dim); font-weight: 600; font-size: .92rem; padding: .5rem .8rem; border-radius: 8px;
}
.navbar .dropdown-item:hover, .navbar .dropdown-item:focus { background: var(--surface); color: #fff; }
.navbar .dropdown-divider { border-top-color: var(--line-soft); margin: .3rem 0; }

/* lista de grupos do WhatsApp */
.wa-grouplist { display: flex; flex-direction: column; gap: .4rem; }
.wa-grouprow {
  display: flex; align-items: center; gap: .6rem; cursor: pointer;
  padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); transition: border-color .15s, background .15s;
}
.wa-grouprow:hover { border-color: var(--line-soft); }
.wa-grouprow.sel { border-color: var(--red); background: rgba(229,9,20,.07); }
.wa-grouprow input { accent-color: var(--red); }
.wa-gname { font-weight: 600; }
.wa-gid { margin-left: auto; color: var(--txt-dim); font-size: .78rem; user-select: all; }

.navbar-nav { gap: .25rem; }
.nav-link {
  color: var(--txt-dim) !important; font-weight: 600; font-size: .92rem;
  padding: .45rem .85rem !important; border-radius: 999px; transition: .18s;
}
.nav-link:hover, .nav-link:focus, .nav-link.active { color: #fff !important; background: var(--surface-2); }

/* hambúrguer */
.navbar-toggler {
  border: 1px solid var(--line); border-radius: 10px; padding: .35rem .5rem;
  background: var(--surface);
}
.navbar-toggler:focus { box-shadow: 0 0 0 3px var(--red-glow); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(238,240,244,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-user { display: flex; align-items: center; gap: .5rem; }
.user-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--line);
  padding: .3rem .35rem .3rem .8rem; border-radius: 999px; white-space: nowrap;
}
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #7a0610);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .8rem;
  font-family: 'Bricolage Grotesque', sans-serif;
}

/* menu colapsado (mobile) */
@media (max-width: 991.98px) {
  .navbar-collapse {
    margin-top: .65rem; padding: .65rem; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
  }
  .navbar-nav { gap: .15rem; }
  .navbar-nav .nav-link { padding: .55rem .8rem !important; }
  .navbar-user { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line-soft); justify-content: space-between; }
}

/* ---------- cards / surfaces ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
  color: var(--txt);
}

/* stat cards do dashboard */
.stat {
  position: relative; padding: 1.15rem 1.25rem; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--red), #7a0610);
}
.stat .stat-label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-faint); font-weight: 700; }
.stat .stat-value { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.85rem; color: #fff; margin-top: .35rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .stat-value.accent { color: var(--red-hi); }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.5rem; }
.page-head h3 { margin: 0; }

/* ---------- tabelas ---------- */
.table {
  color: var(--txt); margin-bottom: 0;
  --bs-table-color: var(--txt);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line-soft);
}
.table > :not(caption) > * > * { background: transparent; color: var(--txt); border-bottom-color: var(--line-soft); padding: .8rem .75rem; }
.table thead th {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--txt-faint); font-weight: 700; border-bottom: 1px solid var(--line) !important;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover > * { background: rgba(255,255,255,.025); }
.table-wrap { background: linear-gradient(180deg, var(--surface), var(--surface-2)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-wrap .table thead th { background: rgba(0,0,0,.18); }
.table-wrap .table > :not(caption) > * > * { padding-left: 1.1rem; padding-right: 1.1rem; }

/* ---------- botões ---------- */
.btn { font-weight: 700; border-radius: 10px; letter-spacing: .2px; transition: .18s; }
.btn-primary, .btn-primary:focus {
  background: linear-gradient(180deg, var(--red-hi), var(--red));
  border: none; color: #fff; box-shadow: 0 8px 24px -10px var(--red-glow);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 30px -8px var(--red-glow); transform: translateY(-1px); }
.btn-outline-light { border-color: var(--line); color: var(--txt-dim); background: var(--surface); }
.btn-outline-light:hover { background: var(--surface-2); color: #fff; border-color: #3a3f4a; }
.btn-outline-danger { border-color: rgba(229,9,20,.4); color: var(--red-hi); }
.btn-outline-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }

/* ---------- forms ---------- */
.form-label { font-weight: 600; font-size: .85rem; color: var(--txt-dim); margin-bottom: .35rem; }
.form-control, .form-select {
  background: #0c0e12; color: var(--txt); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem;
}
.form-control::placeholder { color: var(--txt-faint); }
.form-control:focus, .form-select:focus {
  background: #0c0e12; color: #fff; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow);
}
.form-control-sm { padding: .35rem .6rem; font-size: .85rem; }
.form-check-input:checked { background-color: var(--red); border-color: var(--red); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--red-glow); border-color: var(--red); }

/* ---------- badges / pills ---------- */
.badge { font-weight: 700; font-size: .72rem; padding: .4em .7em; border-radius: 999px; letter-spacing: .02em; display: inline-flex; align-items: center; gap: .4em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-paid { background: var(--green-bg); color: var(--green); }
.badge-pending { background: var(--amber-bg); color: var(--amber); }

/* ---------- alerts ---------- */
.alert { border-radius: 12px; border: 1px solid var(--line); }
.alert-info { background: rgba(60,70,110,.14); color: #c7d0e6; border-color: rgba(90,110,170,.3); }
.alert-danger { background: rgba(229,9,20,.12); color: #ffb3b8; border-color: rgba(229,9,20,.35); }
.alert-warning { background: var(--amber-bg); color: #ffd97a; border-color: rgba(240,165,0,.3); }
.alert-secondary { background: var(--surface); color: var(--txt-dim); border-color: var(--line); }

/* ---------- PIX copia-e-cola ---------- */
.input-group .form-control { font-family: 'JetBrains Mono', monospace; font-size: .8rem; }
.pix-pay { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.pix-pay-side { flex: 1; min-width: 240px; }
.pix-qr { width: 132px; height: 132px; border-radius: 10px; background: #fff; padding: 7px; flex: 0 0 auto; }
code { color: var(--txt-dim); font-family: 'JetBrains Mono', monospace; }

/* ---------- cobranças (cards, mobile-first) ---------- */
.charge-list { display: flex; flex-direction: column; gap: .85rem; }
.charge-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.1rem;
}
.charge-card.is-paid { opacity: .8; }
.charge-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.charge-month { font-weight: 700; font-size: 1.05rem; text-transform: capitalize; }
.charge-due { color: var(--txt-faint); font-size: .8rem; margin-top: .12rem; }
.charge-amount { font-size: 1.7rem; font-weight: 800; letter-spacing: -.5px; margin: .35rem 0 .2rem; }
.charge-card .pix-pay { margin-top: .65rem; }
.pix-copy { display: flex; flex-direction: column; gap: .5rem; max-width: 520px; }
.pix-copy .form-control { font-family: 'JetBrains Mono', monospace; font-size: .78rem; }
.pix-actions { display: flex; gap: .5rem; }
.pix-actions .btn { flex: 1; }

@media (min-width: 577px) {
  .pix-copy { flex-direction: row; align-items: stretch; }
  .pix-actions { flex: 0 0 auto; }
  .pix-actions .btn { flex: 0 0 auto; }
}
@media (max-width: 576px) {
  .charge-card .pix-pay { justify-content: center; }
  .charge-card .pix-pay-side { min-width: 100%; }
  .charge-amount { font-size: 1.5rem; }
}

/* ---------- login ---------- */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.7rem; letter-spacing: -.6px; }
.auth-brand .accent { color: var(--red); }

/* ---------- relatório de arrecadação ---------- */
.meter { height: 12px; background: #0c0e12; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter > span {
  display: block; height: 100%; min-width: 6px;
  background: linear-gradient(90deg, #1e9e5a, var(--green));
  box-shadow: 0 0 16px -2px rgba(47,191,113,.5);
  border-radius: 999px; transition: width .7s cubic-bezier(.2,.7,.2,1);
}
.report-paid { color: var(--green); font-size: 1.25rem; }
.report-due { color: var(--amber); font-size: 1.25rem; }
.report-balance { color: #fff; font-size: 1.25rem; }

/* ---------- ajuda / tutorial ---------- */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.platform { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.platform .p-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.4rem; font-weight: 800; color: #fff; font-family: 'Bricolage Grotesque', sans-serif;
}
.platform .p-icon.jf { background: linear-gradient(135deg, #aa5cc3, #00a4dc); }
.platform .p-icon.sr { background: linear-gradient(135deg, var(--red-hi), #7a0610); }
.platform .p-icon.db { background: linear-gradient(135deg, #2fbf71, #0e7c8b); }
.platform h4 { font-family: 'Bricolage Grotesque', sans-serif; }

/* mini-cards de "outros serviços" */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.svc { padding: 1.05rem 1.15rem; display: flex; flex-direction: column; gap: .5rem; }
.svc .svc-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.svc h5 { margin: 0; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.02rem; color: #fff; }
.svc p { margin: 0; color: var(--txt-dim); font-size: .87rem; line-height: 1.45; flex: 1; }
.svc .svc-link { font-weight: 700; font-size: .85rem; }
.tag { font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: .28em .6em; border-radius: 999px; border: 1px solid var(--line); color: var(--txt-faint); white-space: nowrap; }
.tag.ok   { color: var(--green); border-color: rgba(47,191,113,.35); background: var(--green-bg); }
.tag.lock { color: var(--amber); border-color: rgba(240,165,0,.3); background: var(--amber-bg); }
.tag.warn { color: var(--red-hi); border-color: rgba(229,9,20,.35); background: rgba(229,9,20,.1); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; counter-reset: s; }
.steps li { position: relative; padding-left: 2.1rem; color: var(--txt-dim); line-height: 1.45; }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--txt);
  font-size: .72rem; font-weight: 700; display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- fluxo de configuração passo-a-passo (ex.: pareamento WhatsApp) ---------- */
.setup-page { max-width: 680px; }
.setup-page > * + * { margin-top: 2rem; }
.setup-flow { display: flex; flex-direction: column; gap: 1rem; }
.setup-step { display: flex; flex-direction: column; gap: .6rem; }
.setup-step > p, .setup-step > form { margin: 0; }
.setup-step.is-active { border-color: rgba(240,165,0,.4) !important; box-shadow: var(--shadow), 0 0 0 1px rgba(240,165,0,.14); }
.setup-step.is-done { border-color: rgba(47,191,113,.3) !important; }
.setup-title { display: flex; align-items: center; gap: .65rem; }
.setup-title h5 { font-size: 1.02rem; margin: 0; }
.setup-title .tag { margin-left: auto; }
.setup-num {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--txt);
  font-family: 'JetBrains Mono', monospace; font-size: .75rem; font-weight: 700;
}
.setup-step.is-done .setup-num { background: var(--green-bg); border-color: rgba(47,191,113,.4); color: var(--green); }
.setup-hint { color: var(--txt-dim); font-size: .85rem; }
.wa-success { display: flex; align-items: center; gap: .5rem; color: var(--green); font-weight: 700; }
.wa-qr-box { background: #fff; display: inline-block; padding: 1rem; border-radius: var(--radius-sm); }

.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: .6rem; overflow: hidden; }
.faq summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 600; color: var(--txt); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: 'JetBrains Mono', monospace; color: var(--txt-faint); font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; color: var(--red-hi); }
.faq details[open] summary { border-bottom: 1px solid var(--line-soft); }
.faq .faq-body { padding: .9rem 1.1rem; color: var(--txt-dim); line-height: 1.5; }

/* ---------- entrada escalonada ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) both; }
.reveal:nth-child(2) { animation-delay: .06s; }
.reveal:nth-child(3) { animation-delay: .12s; }
.reveal:nth-child(4) { animation-delay: .18s; }

@media (max-width: 576px) {
  .stat .stat-value { font-size: 1.5rem; }
  .navbar-brand { margin-right: .75rem; }
}
