/* ============================================================
   MegaCrédito — sistema visual
   Floresta profunda + papel quente + dourado (conquista).
   Display: Bricolage Grotesque · Texto: Plus Jakarta Sans
   ============================================================ */

:root {
  --paper:     #F3EFE4;
  --paper-2:   #EBE4D3;
  --card:      #FFFFFF;
  --ink:       #15211A;
  --forest:    #20402F;
  --forest-2:  #2B5640;
  --forest-ink:#0E2419;
  --muted:     #67756B;
  --line:      #E4DDCC;
  --gold:      #B5832B;
  --gold-2:    #CE9E3F;
  --gold-soft: #F4E8CA;
  --danger:    #B23A2E;
  --ok:        #2E6B45;

  --display: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  --body:    "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

  --radius:   18px;
  --radius-s: 12px;
  --shadow:   0 1px 2px rgba(20,33,26,.04), 0 12px 32px -16px rgba(20,33,26,.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; }

/* tipografia utilitária */
.eyebrow {
  font-family: var(--body);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ── botões ── */
.btn {
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-s);
  padding: 14px 20px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--forest);
  color: #F6F3EA;
  box-shadow: 0 8px 20px -10px rgba(32,64,47,.7);
}
.btn-primary:hover { background: var(--forest-2); }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-ghost {
  background: transparent;
  color: var(--forest);
  border: 1.5px solid var(--line);
  width: auto;
  padding: 10px 16px;
  font-size: .92rem;
}
.btn-ghost:hover { border-color: var(--forest); }

/* ── inputs ── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 7px;
  color: var(--ink);
}
.field input {
  width: 100%;
  font-family: var(--body);
  font-size: 1.05rem;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  background: #FCFAF4;
  color: var(--ink);
  transition: border .15s ease, box-shadow .15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--forest-2);
  box-shadow: 0 0 0 4px rgba(43,86,64,.12);
}

/* mensagem de erro/aviso inline */
.alert {
  border-radius: var(--radius-s);
  padding: 12px 14px;
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-danger { background: #F7E5E2; color: var(--danger); }
.alert-info   { background: var(--gold-soft); color: #7A5A12; }

/* =========================================================
   LOGIN
   ========================================================= */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.auth__brand {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(206,158,63,.16), transparent 60%),
    var(--forest);
  color: #EFEAD9;
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.brand__logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand__logo .mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(150deg, var(--gold-2), var(--gold));
  display: inline-block;
}
.brand__pitch {
  max-width: 30ch;
}
.brand__pitch h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}
.brand__pitch p {
  color: #C9CFBF;
  font-size: 1.02rem;
  margin: 0;
}
/* escada-assinatura no painel de marca */
.brand__ladder { display: flex; align-items: flex-end; gap: 8px; height: 92px; }
.brand__ladder span {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: rgba(239,234,217,.10);
}
.brand__ladder span:nth-child(1) { height: 28%; }
.brand__ladder span:nth-child(2) { height: 44%; }
.brand__ladder span:nth-child(3) { height: 62%; }
.brand__ladder span:nth-child(4) { height: 100%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); }

.auth__form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth__card { width: 100%; max-width: 380px; }
.auth__card h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -.01em;
  margin: 0 0 4px;
}
.auth__card .sub { color: var(--muted); margin: 0 0 26px; font-size: .96rem; }
.auth__foot { margin-top: 18px; font-size: .85rem; color: var(--muted); text-align: center; }

@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { padding: 32px 24px; gap: 28px; min-height: auto; }
  .brand__ladder { height: 60px; }
}

/* =========================================================
   APP / DASHBOARD
   ========================================================= */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar__in {
  max-width: 860px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand__logo { font-size: 1.1rem; color: var(--ink); }
.topbar .brand__logo .mark { width: 22px; height: 22px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 24px 20px 60px; }

.greet { margin: 6px 0 20px; }
.greet h1 {
  font-family: var(--display);
  font-weight: 700; font-size: 1.5rem; letter-spacing: -.01em;
  margin: 2px 0 0;
}

/* card base */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

/* hero do empréstimo (verde) */
.hero {
  background:
    radial-gradient(900px 400px at 110% -40%, rgba(206,158,63,.18), transparent 55%),
    var(--forest);
  color: #EFEAD9;
  border: none;
}
.hero .eyebrow { color: #A9C0AE; }
.hero__big {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  line-height: 1;
  letter-spacing: -.025em;
  margin: 8px 0 0;
  color: #FBF8EF;
}
.hero__row { display: flex; gap: 26px; margin-top: 20px; flex-wrap: wrap; }
.hero__row .cell .k {
  font-size: .76rem; color: #A9C0AE; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.hero__row .cell .v {
  font-weight: 700; font-size: 1.12rem; margin-top: 2px; color: #EFEAD9;
}
.hero__bar {
  margin-top: 22px; height: 10px; border-radius: 99px;
  background: rgba(239,234,217,.16); overflow: hidden;
}
.hero__bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  width: 0%; transition: width .9s cubic-bezier(.2,.7,.2,1);
}
.hero__barlabel { margin-top: 8px; font-size: .82rem; color: #C9CFBF; }

/* escada de crédito */
.ladder__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.ladder__now .k { color: var(--muted); font-size: .82rem; font-weight: 700; }
.ladder__now .v {
  font-family: var(--display); font-weight: 800; font-size: 1.7rem;
  letter-spacing: -.01em; margin-top: 2px;
}
.ladder__track {
  display: flex; gap: 6px; align-items: flex-end; height: 64px; margin: 4px 0 14px;
}
.ladder__track .rung {
  flex: 1; border-radius: 7px 7px 4px 4px;
  background: var(--paper-2);
  position: relative;
  transition: background .3s ease;
}
.ladder__track .rung.done { background: linear-gradient(180deg, var(--forest-2), var(--forest)); }
.ladder__track .rung.current {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 6px 16px -8px rgba(181,131,43,.8);
}
.ladder__track .rung b {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: .62rem; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.ladder__next {
  background: var(--gold-soft);
  border-radius: var(--radius-s);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  color: #6E5210;
}
.ladder__next .ic { font-size: 1.3rem; }
.ladder__next .t b { font-weight: 800; }
.ladder__next .t small { display: block; color: #8A6A1C; font-weight: 600; }

/* seção dois-painéis: a pagar / pagamentos */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; } }

.sec-title {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
  margin: 0 0 14px; letter-spacing: -.01em;
}

/* lista de pagamentos */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px;
}
.list li:last-child { border-bottom: none; }
.list .li-main { font-weight: 600; }
.list .li-sub { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.list .li-val { font-weight: 700; white-space: nowrap; }
.badge {
  font-size: .68rem; font-weight: 800; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 99px; text-transform: uppercase;
}
.badge-ok    { background: #E2EFE7; color: var(--ok); }
.badge-est   { background: #F7E5E2; color: var(--danger); }
.badge-open  { background: var(--gold-soft); color: #7A5A12; }

/* estado vazio */
.empty { text-align: center; padding: 18px 8px; color: var(--muted); }
.empty .ic { font-size: 1.6rem; }
.empty p { margin: 8px 0 0; font-size: .92rem; }

/* upload comprovante */
.upload {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-s);
  padding: 18px; text-align: center; cursor: pointer;
  transition: border .15s ease, background .15s ease;
}
.upload:hover { border-color: var(--forest-2); background: #FCFAF4; }
.upload input { display: none; }
.upload .ic { font-size: 1.5rem; }
.upload .t { font-weight: 700; margin-top: 6px; }
.upload .h { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.upload__name { font-weight: 700; color: var(--forest); }

/* carregando / erro de página */
.state { text-align: center; padding: 80px 20px; color: var(--muted); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--forest);
  margin: 0 auto 14px; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* reveal suave dos cards */
.reveal { opacity: 0; transform: translateY(10px); animation: rise .5s ease forwards; }
.reveal:nth-child(2) { animation-delay: .05s; }
.reveal:nth-child(3) { animation-delay: .1s; }
.reveal:nth-child(4) { animation-delay: .15s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   ADMIN — componentes adicionais
   ========================================================= */
.admin-tag {
  font-family: var(--body); font-weight: 800; font-size: .62rem;
  letter-spacing: .12em; text-transform: uppercase;
  background: var(--gold-soft); color: #7A5A12;
  padding: 3px 8px; border-radius: 99px; margin-left: 8px;
}

/* abas */
.tabs { display: flex; gap: 8px; margin: 4px 0 20px; }
.tab {
  font-family: var(--body); font-weight: 700; font-size: .95rem;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--muted); border-radius: 99px; padding: 9px 16px; cursor: pointer;
  transition: all .15s ease;
}
.tab.active { background: var(--forest); color: #F6F3EA; border-color: var(--forest); }
.tab .count {
  font-size: .78rem; margin-left: 6px; opacity: .8;
  font-variant-numeric: tabular-nums;
}

/* linha de cliente */
.crow {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: border .15s ease, box-shadow .15s ease, transform .08s ease;
}
.crow:hover { border-color: var(--forest-2); box-shadow: var(--shadow); }
.crow:active { transform: translateY(1px); }
.crow__main .nome { font-weight: 700; }
.crow__main .meta { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.crow__right { text-align: right; white-space: nowrap; }
.crow__right .v { font-weight: 700; font-variant-numeric: tabular-nums; }

.badge-pend { background: var(--gold-soft); color: #7A5A12; }
.badge-ativo { background: #E2EFE7; color: var(--ok); }

/* modal */
.overlay {
  position: fixed; inset: 0; background: rgba(14,36,25,.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 50; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.overlay.show { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius); width: 100%; max-width: 520px;
  box-shadow: 0 30px 80px -20px rgba(14,36,25,.5); overflow: hidden;
  animation: rise .25s ease;
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal__head h3 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin: 0; }
.modal__x {
  border: none; background: var(--paper-2); width: 32px; height: 32px; border-radius: 9px;
  cursor: pointer; font-size: 1.1rem; color: var(--ink); line-height: 1;
}
.modal__body { padding: 22px; }

/* grid de campos no formulário */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.field select {
  width: 100%; font-family: var(--body); font-size: 1.05rem; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: #FCFAF4; color: var(--ink);
}
.hint { font-size: .82rem; color: var(--muted); margin: -8px 0 14px; }

/* mini resumo no detalhe */
.minigrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.minigrid .box {
  background: var(--paper); border-radius: var(--radius-s); padding: 12px 14px;
}
.minigrid .box .k { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.minigrid .box .v { font-weight: 700; font-size: 1.05rem; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--forest); color: #F6F3EA; padding: 12px 20px; border-radius: 99px;
  font-weight: 700; font-size: .92rem; box-shadow: var(--shadow);
  opacity: 0; transition: all .3s ease; z-index: 60; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty-big { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-big .ic { font-size: 2.2rem; }
.empty-big p { margin-top: 10px; }

.divider { height: 1px; background: var(--line); margin: 18px 0; }
.section-label { font-weight: 800; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
