/* Portal do Investidor Sette — identidade visual da marca */
:root {
  --purple: #6B00F0;
  --violet: #772EEB;
  --magenta: #FC789B;
  --orchid: #E381BA;
  --plum: #B961C9;
  --navy: #113067;
  --royal: #204299;
  --cream: #FFF9E8;
  --ink: #1d1d22;
  --body: #1d1d22;
  --muted: #737373;
  --line: #DCDCDC;
  --card: #F0F0F0;
  --white: #fff;
  --lilac: #F3EEFD;
  --bg: #fbfbfd;
  --grad: linear-gradient(135deg, #6B00F0 0%, #772EEB 35%, #B961C9 70%, #FC789B 100%);
  --grad-bar: linear-gradient(90deg, #6B00F0 0%, #772EEB 38%, #B961C9 72%, #FC789B 100%);
  --grad-dark: linear-gradient(135deg, #160024 0%, #33006e 55%, #5a00cc 100%);
  --radius: 16px;
  --shadow: 0 14px 40px -20px rgba(20, 10, 40, 0.28);
  --shadow-lg: 0 24px 70px -28px rgba(20, 10, 40, 0.45);
  --maxw: 1080px;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --hexmask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20260%20290'%3E%3Cpath%20d='M130%2028L232%2087L232%20203L130%20262L28%20203L28%2087Z'%20fill='%23fff'%20stroke='%23fff'%20stroke-width='36'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  --ok: #1b9e5a;
  --bad: #d23b53;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.68;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); font-weight: 800; line-height: 1.14; letter-spacing: -0.015em; margin: 0; }
a { color: var(--purple); }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; }
.brand .logo { height: 26px; width: auto; display: block; }
.auth-side .brand .logo { height: 34px; }
.brand-mobile .logo { height: 32px; }
.so-desktop { display: flex; }

.tag {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 100px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
}

/* ---------- Login ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth-side {
  position: relative;
  overflow: hidden;
  background: #15001f;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
}

.auth-side .bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(820px 500px at 86% -16%, rgba(252, 120, 155, 0.52), transparent 60%),
    radial-gradient(760px 560px at 4% 118%, rgba(119, 46, 235, 0.64), transparent 60%),
    var(--grad-dark);
}

.auth-side .hero-hex {
  position: absolute;
  right: -80px; bottom: -60px;
  width: 340px; height: 376px;
  background: var(--grad);
  -webkit-mask: var(--hexmask) center/contain no-repeat;
  mask: var(--hexmask) center/contain no-repeat;
  opacity: 0.55;
}

.auth-side .hero-hex.two { right: 190px; bottom: 230px; width: 104px; height: 116px; opacity: 0.3; }
.auth-side > * { position: relative; z-index: 1; }

.auth-side h2 {
  color: #fff;
  font-size: clamp(28px, 3.4vw, 40px);
  max-width: 19ch;
  margin: 0 0 16px;
}

.auth-side p { color: rgba(255, 255, 255, 0.78); max-width: 34ch; font-size: 15px; margin: 0; }
.auth-side .foot { font-size: 12.5px; color: rgba(255, 255, 255, 0.5); }

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--white);
}

.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand-mobile { display: none; margin-bottom: 30px; }

h1.form-title { font-size: 25px; margin: 0 0 8px; }
p.form-help { color: var(--muted); font-size: 14.5px; margin: 0 0 26px; line-height: 1.55; }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 7px; letter-spacing: 0.01em; }

input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 13px 15px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(119, 46, 235, 0.13); }
.field { margin-bottom: 18px; }

.btn-primary {
  width: 100%;
  padding: 14px 18px;
  background: var(--grad-bar);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 26px -12px rgba(107, 0, 240, 0.6);
  transition: filter 0.15s, opacity 0.15s, transform 0.15s;
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: default; box-shadow: none; }

.btn-link {
  background: none; border: none;
  color: var(--muted);
  font-size: 13.5px; font-weight: 500;
  padding: 8px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover { color: var(--purple); }
.auth-foot { margin-top: 16px; text-align: center; }

.msg { padding: 12px 15px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; display: none; line-height: 1.5; }
.msg.show { display: block; }
.msg.error { background: rgba(210, 59, 83, 0.08); border: 1px solid rgba(210, 59, 83, 0.3); color: #a82339; }
.msg.ok { background: rgba(27, 158, 90, 0.08); border: 1px solid rgba(27, 158, 90, 0.3); color: #157345; }
.msg.info { background: var(--lilac); border: 1px solid rgba(119, 46, 235, 0.25); color: #4b1a9e; }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* ---------- App ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar::after { content: ""; display: block; height: 3px; background: var(--grad-bar); position: absolute; left: 0; right: 0; bottom: -3px; }

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar .who { font-size: 12.5px; color: var(--muted); text-align: right; line-height: 1.4; }
.topbar .who b { color: var(--ink); font-weight: 600; display: block; font-size: 13.5px; }

.btn-ghost {
  background: var(--white);
  border: 1.5px solid var(--line);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-ghost:hover { border-color: var(--violet); color: var(--purple); }

main { max-width: var(--maxw); margin: 0 auto; padding: 52px 30px 72px; }

.page-title { font-size: clamp(28px, 4vw, 38px); margin: 0 0 10px; }
.page-sub { color: var(--muted); margin: 0 0 40px; font-size: 16px; max-width: 56ch; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  text-align: left;
  color: var(--ink);
  width: 100%;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad-bar);
  opacity: 0;
  transition: opacity 0.18s;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(119, 46, 235, 0.35); }
.card:hover::before { opacity: 1; }

.card .hexnum {
  width: 38px; height: 42px;
  background: var(--grad);
  -webkit-mask: var(--hexmask) center/contain no-repeat;
  mask: var(--hexmask) center/contain no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
  flex: none;
}

.card .t { font-size: 17.5px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.card .d { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.card .count { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--purple); text-transform: uppercase; letter-spacing: 0.05em; }
.card .count.vazio { color: var(--muted); }

.section-panel {
  margin-top: 38px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.section-panel h2 {
  font-size: 17px;
  margin: 0;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  width: 100%;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.14s, color 0.14s;
}

.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: var(--lilac); color: var(--purple); }
.doc-row .meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-weight: 400; }
.empty { padding: 24px; color: var(--muted); font-size: 14.5px; }

/* ---------- Viewer ---------- */
.viewer-frame { width: 100%; height: calc(100vh - 68px); border: none; background: #fff; display: block; }

.center-note { display: flex; align-items: center; justify-content: center; height: 60vh; color: var(--muted); font-size: 15px; padding: 24px; text-align: center; }

.doc-title { font-weight: 600; font-size: 14.5px; color: var(--ink); }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--purple);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 9px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1040px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-card .brand-mobile { display: flex; }
  .auth-panel { min-height: 100vh; align-items: flex-start; padding-top: 56px; }
}

@media (max-width: 700px) {
  .so-desktop { display: none; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .topbar-inner { padding: 14px 18px; }
  main { padding: 32px 18px 56px; }
  .topbar .who { display: none; }
}

/* ---------- Administração ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }

.tab {
  background: none; border: none;
  padding: 12px 20px;
  font-size: 14.5px; font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.tab:hover { color: var(--ink); }
.tab.ativa { color: var(--purple); border-bottom-color: var(--purple); }

.painel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 26px;
}

.painel h3 { font-size: 16px; margin: 0 0 6px; }
.painel .painel-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }

.linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; align-items: end; }

select {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: inherit; font-size: 15px;
  color: var(--ink); background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23737373' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; background-size: 11px;
}

select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(119, 46, 235, 0.13); }

input[type="file"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  font-family: inherit; font-size: 13.5px;
  background: var(--white); color: var(--muted);
}

input[type="file"]::file-selector-button {
  font-family: inherit; font-size: 13px; font-weight: 600;
  border: none; border-radius: 100px;
  padding: 8px 15px; margin-right: 12px;
  background: var(--lilac); color: var(--purple);
  cursor: pointer;
}

.btn-primary.compacto { width: auto; padding: 13px 28px; }

.tabela { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tabela th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; padding: 0 14px 12px; border-bottom: 1px solid var(--line);
}
.tabela td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: none; }
.tabela .nome { font-weight: 600; }
.tabela .sub { color: var(--muted); font-size: 12.5px; }
.tabela .acoes { text-align: right; white-space: nowrap; }
.tabela .acoes button { margin-left: 6px; }

.pill {
  display: inline-block; padding: 4px 11px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
}
.pill.ok { background: rgba(27, 158, 90, 0.12); color: #157345; }
.pill.pend { background: rgba(201, 162, 39, 0.14); color: #8a6d10; }
.pill.adm { background: var(--lilac); color: var(--purple); }

.btn-mini {
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: 100px; padding: 6px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.btn-mini:hover { border-color: var(--violet); color: var(--purple); }
.btn-mini.perigo:hover { border-color: var(--bad); color: var(--bad); }

.aviso {
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.32);
  color: #7a6210;
  border-radius: 10px; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.55; margin-bottom: 24px;
}

.doc-admin {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.doc-admin:last-child { border-bottom: none; }
.doc-admin .secao { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--purple); font-weight: 600; }

@media (max-width: 640px) {
  .tabela thead { display: none; }
  .tabela td { display: block; padding: 6px 0; border: none; }
  .tabela tr { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .tabela .acoes { text-align: left; margin-top: 10px; }
  .tabela .acoes button { margin: 0 6px 0 0; }
}
