/* ============================================================================
   Confidencial Imobiliário — tema visual do "Inbound" (inbound)
   ---------------------------------------------------------------------------
   Alinhado ao padrão das aplicações CI (ver ci_users / siteci):
   tipografia Kanit + Raleway, azul institucional #00528d, sombras azuladas
   suaves, cartões arredondados, botões em pílula. Assenta sobre Bootstrap 5.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@200;300;400;500;600;700&family=Raleway:wght@400;600;700;800;900&display=swap');

:root {
  /* Paleta institucional CI */
  --ci-blue: #00528d;
  --ci-blue-bright: #1275c9;
  --ci-blue-deep: #0f1f6f;
  --ci-navy: #06264a;
  --ci-orange: #e74e00;
  --ci-grey: #7b7c7b;

  --ci-ink: #16222e;
  --ci-muted: #6b7787;
  --ci-line: #e3e9f2;
  --ci-bg: #eef3f9;
  --ci-card: #ffffff;

  /* Estados de submissão */
  --st-queued: #6b7787;
  --st-processing: #1275c9;
  --st-done: #1a8a5a;
  --st-error: #d23b2e;

  --ci-radius: 16px;
  --ci-radius-sm: 10px;
  --ci-shadow-sm: 0 4px 14px -6px rgba(0, 82, 141, .22);
  --ci-shadow: 0 22px 55px -24px rgba(0, 82, 141, .38);
  --ci-shadow-hover: 0 30px 70px -26px rgba(0, 82, 141, .48);

  --font-ui: 'Kanit', system-ui, -apple-system, sans-serif;
  --font-display: 'Raleway', 'Kanit', sans-serif;
}

/* ---------------------------------------------------------------- base ---- */

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  font-weight: 300;
  color: var(--ci-ink);
  background-color: var(--ci-bg);
  /* Atmosfera: brilhos azulados + malha "blueprint" muito subtil. */
  background-image:
    radial-gradient(1100px 620px at 88% -8%, rgba(18, 117, 201, .14), transparent 60%),
    radial-gradient(900px 520px at -6% 4%, rgba(0, 82, 141, .10), transparent 55%),
    linear-gradient(rgba(0, 82, 141, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 82, 141, .035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 46px 46px, 46px 46px;
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, .display, .navbar-brand {
  font-family: var(--font-display);
}

a { color: var(--ci-blue-bright); text-decoration: none; }
a:hover { color: var(--ci-blue); }

.container { max-width: 1140px; }

.eyebrow {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ci-blue-bright);
}

.text-ci-blue { color: var(--ci-blue) !important; }
.text-ci-muted { color: var(--ci-muted) !important; }

/* utilitários de ícone/estado (evitam estilos inline — djlint H021) */
.ci-i-blue { color: var(--ci-blue-bright); }
.ci-i-done { color: var(--st-done); }
.ci-i-error { color: var(--st-error); }
.ci-i-warn { color: var(--ci-orange); }
.ci-i-lg { font-size: 1.8rem; }
.ci-inline-title { font-family: var(--font-display); font-weight: 800; color: var(--ci-navy); }
.ci-fs-sm { font-size: .92rem; }

/* -------------------------------------------------------------- navbar ---- */

.navbar.ci-nav {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 2px solid var(--ci-blue);
  box-shadow: 0 6px 22px -18px rgba(0, 82, 141, .55);
  padding-top: .55rem;
  padding-bottom: .55rem;
}

.ci-nav .navbar-brand { display: inline-flex; align-items: center; gap: .7rem; }
.ci-nav .navbar-brand img { height: 34px; width: auto; }
.ci-nav .brand-tag {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ci-grey);
  padding-left: .7rem;
  border-left: 1px solid var(--ci-line);
  line-height: 1;
}

.ci-nav .nav-link {
  font-family: var(--font-ui);
  font-weight: 400;
  color: var(--ci-ink) !important;
  letter-spacing: .01em;
  padding: .35rem .9rem !important;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.ci-nav .nav-link:hover { color: var(--ci-blue) !important; background: rgba(18, 117, 201, .08); }
.ci-nav .nav-item.active .nav-link,
.ci-nav .nav-link.active {
  color: var(--ci-blue) !important;
  background: rgba(18, 117, 201, .10);
  font-weight: 500;
}
.ci-nav .nav-link.signout { color: var(--ci-grey) !important; }
.ci-nav .navbar-toggler { border-color: var(--ci-line); }

/* --------------------------------------------------------------- shell ---- */

.ci-main { padding-top: 2.2rem; padding-bottom: 3.5rem; }

.page-head { margin-bottom: 1.6rem; }
.page-head h1, .page-head h2 {
  font-weight: 800;
  color: var(--ci-navy);
  letter-spacing: -.01em;
  margin: .35rem 0 0;
}
.page-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.page-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.page-head .lead { color: var(--ci-muted); font-weight: 300; max-width: 60ch; }

/* --------------------------------------------------------------- cards ---- */

.ci-card {
  background: var(--ci-card);
  border: 1px solid var(--ci-line);
  border-radius: var(--ci-radius);
  box-shadow: var(--ci-shadow);
  padding: 1.75rem;
}
.ci-card--tight { padding: 1.25rem 1.4rem; }

.ci-card-h {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ci-navy);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 1rem;
  margin-bottom: 1.1rem;
}
.ci-card-h .bi { color: var(--ci-blue-bright); font-size: 1.15rem; }

/* -------------------------------------------------------------- buttons --- */

.btn {
  font-family: var(--font-ui);
  font-weight: 500;
  border-radius: 999px;
  letter-spacing: .02em;
  padding: .58rem 1.5rem;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary,
.btn-ci {
  --bs-btn-bg: var(--ci-blue);
  background: linear-gradient(135deg, var(--ci-blue-bright), var(--ci-blue));
  border: none;
  color: #fff;
  box-shadow: 0 14px 26px -14px rgba(0, 82, 141, .8);
}
.btn-primary:hover,
.btn-ci:hover {
  background: linear-gradient(135deg, var(--ci-blue), var(--ci-blue-deep));
  color: #fff;
  box-shadow: var(--ci-shadow-hover);
  transform: translateY(-1px);
}

.btn-ci-accent {
  background: linear-gradient(135deg, #ff6a1a, var(--ci-orange));
  border: none;
  color: #fff;
  box-shadow: 0 14px 26px -14px rgba(231, 78, 0, .7);
}
.btn-ci-accent:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 20px 40px -18px rgba(231, 78, 0, .75); }

.btn-outline-ci,
.btn-secondary {
  background: #fff;
  border: 1.5px solid var(--ci-line);
  color: var(--ci-blue);
}
.btn-outline-ci:hover,
.btn-secondary:hover {
  background: #fff;
  border-color: var(--ci-blue-bright);
  color: var(--ci-blue);
  box-shadow: var(--ci-shadow-sm);
}

.btn-lg { padding: .8rem 2rem; font-size: 1.05rem; }

/* -------------------------------------------------------------- badges ---- */

.ci-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.ci-badge::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: currentColor; flex: none;
}
.ci-badge--queued     { color: var(--st-queued);     background: rgba(107, 119, 135, .12); border-color: rgba(107, 119, 135, .22); }
.ci-badge--processing { color: var(--st-processing); background: rgba(18, 117, 201, .12);  border-color: rgba(18, 117, 201, .25); }
.ci-badge--processing::before { animation: ci-pulse 1.1s ease-in-out infinite; }
.ci-badge--done       { color: var(--st-done);       background: rgba(26, 138, 90, .12);   border-color: rgba(26, 138, 90, .25); }
.ci-badge--error      { color: var(--st-error);      background: rgba(210, 59, 46, .12);   border-color: rgba(210, 59, 46, .25); }

@keyframes ci-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

/* ---------------------------------------------------------- stat tiles ---- */

.ci-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.ci-stat {
  background: var(--ci-card);
  border: 1px solid var(--ci-line);
  border-radius: var(--ci-radius-sm);
  box-shadow: var(--ci-shadow-sm);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
}
.ci-stat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--ci-blue-bright);
}
.ci-stat.is-done::after   { background: var(--st-done); }
.ci-stat.is-error::after  { background: var(--st-error); }
.ci-stat.is-warn::after   { background: var(--ci-orange); }
.ci-stat .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  color: var(--ci-navy);
}
.ci-stat .lbl {
  text-transform: uppercase; letter-spacing: .12em; font-size: .68rem;
  font-weight: 500; color: var(--ci-muted); margin-top: .4rem;
}

/* -------------------------------------------------------------- tables ---- */

.ci-table-wrap {
  background: var(--ci-card);
  border: 1px solid var(--ci-line);
  border-radius: var(--ci-radius);
  box-shadow: var(--ci-shadow);
  overflow: hidden;
}
.ci-table { margin: 0; width: 100%; border-collapse: collapse; }
.ci-table thead th {
  background: #f7fafd;
  font-family: var(--font-ui);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .68rem;
  color: var(--ci-muted);
  padding: .95rem 1.25rem;
  border-bottom: 1px solid var(--ci-line);
  text-align: left;
}
.ci-table tbody td {
  padding: .95rem 1.25rem;
  border-bottom: 1px solid var(--ci-line);
  font-weight: 300;
  vertical-align: middle;
}
.ci-table tbody tr:last-child td { border-bottom: none; }
.ci-table tbody tr { transition: background .12s ease; }
.ci-table tbody tr:hover { background: rgba(18, 117, 201, .045); }
.ci-table .type-link { font-weight: 500; color: var(--ci-blue); }
.ci-table .type-link:hover { color: var(--ci-blue-bright); text-decoration: underline; }
.ci-table .muted { color: var(--ci-muted); }
.ci-table .num { font-variant-numeric: tabular-nums; font-family: var(--font-ui); }

.ci-empty { text-align: center; padding: 3.5rem 1rem; color: var(--ci-muted); }
.ci-empty .bi { font-size: 2.6rem; color: var(--ci-line); display: block; margin-bottom: .6rem; }

/* --------------------------------------------------------- definition ----- */

.ci-dl { display: grid; grid-template-columns: 1fr; gap: 0; }
.ci-dl .row-item {
  display: grid; grid-template-columns: 200px 1fr; gap: 1rem;
  padding: .85rem 0; border-bottom: 1px dashed var(--ci-line);
}
.ci-dl .row-item:last-child { border-bottom: none; }
.ci-dl dt {
  text-transform: uppercase; letter-spacing: .1em; font-size: .72rem;
  font-weight: 500; color: var(--ci-muted); align-self: center;
}
.ci-dl dd { margin: 0; font-weight: 400; align-self: center; }
@media (max-width: 576px) { .ci-dl .row-item { grid-template-columns: 1fr; gap: .2rem; } }

/* ------------------------------------------------------------- dropzone --- */

.ci-field-label {
  display: block;
  text-transform: uppercase; letter-spacing: .1em; font-size: .72rem;
  font-weight: 600; color: var(--ci-muted); margin-bottom: .5rem;
}

.form-select, .form-control {
  font-family: var(--font-ui);
  font-weight: 300;
  border: 1.5px solid var(--ci-line);
  border-radius: var(--ci-radius-sm);
  padding: .7rem .9rem;
  color: var(--ci-ink);
}
.form-select:focus, .form-control:focus {
  border-color: var(--ci-blue-bright);
  box-shadow: 0 0 0 4px rgba(18, 117, 201, .14);
}

.ci-dropzone {
  position: relative;
  border: 2px dashed rgba(0, 82, 141, .3);
  border-radius: var(--ci-radius);
  background:
    radial-gradient(420px 160px at 50% 0%, rgba(18, 117, 201, .07), transparent 70%),
    #fbfdff;
  padding: 2.4rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.ci-dropzone:hover { border-color: var(--ci-blue-bright); transform: translateY(-1px); }
.ci-dropzone.is-drag { border-color: var(--ci-blue-bright); background: rgba(18, 117, 201, .08); }
.ci-dropzone.has-file { border-style: solid; border-color: var(--st-done); background: rgba(26, 138, 90, .06); }
.ci-dropzone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.ci-dropzone .dz-icon { font-size: 2.4rem; color: var(--ci-blue-bright); }
.ci-dropzone.has-file .dz-icon { color: var(--st-done); }
.ci-dropzone .dz-title { font-family: var(--font-ui); font-weight: 500; color: var(--ci-ink); margin-top: .5rem; }
.ci-dropzone .dz-hint { font-size: .82rem; color: var(--ci-muted); }

/* --------------------------------------------------------- alerts / list -- */

.alert { border-radius: var(--ci-radius-sm); border: 1px solid transparent; font-weight: 300; }
.alert-success { background: rgba(26, 138, 90, .1);  border-color: rgba(26, 138, 90, .28);  color: #10603e; }
.alert-danger  { background: rgba(210, 59, 46, .1);  border-color: rgba(210, 59, 46, .28);  color: #8e241b; }
.alert-warning { background: rgba(231, 78, 0, .1);   border-color: rgba(231, 78, 0, .28);   color: #8a3400; }
.alert-primary, .alert-info { background: rgba(18, 117, 201, .1); border-color: rgba(18, 117, 201, .28); color: var(--ci-blue); }

.ci-report { list-style: none; padding: 0; margin: 0; border-radius: var(--ci-radius-sm); overflow: hidden; border: 1px solid var(--ci-line); }
.ci-report li {
  padding: .7rem 1rem; font-weight: 300; font-size: .92rem;
  border-bottom: 1px solid var(--ci-line); display: flex; gap: .6rem; align-items: baseline;
}
.ci-report li:last-child { border-bottom: none; }
.ci-report li::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; flex: none; margin-top: .5rem; }
.ci-report.is-error li { background: rgba(210, 59, 46, .04); }
.ci-report.is-error li::before { background: var(--st-error); }
.ci-report.is-warn li { background: rgba(231, 78, 0, .04); }
.ci-report.is-warn li::before { background: var(--ci-orange); }

.ci-report-title {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; font-size: .78rem; margin: .9rem 0 .5rem;
}
#upload-result .ci-report { background: #fff; }

.alert-debug { background: #fff; border-color: #d6e9c6; color: #000; }
.alert-error { background: rgba(210, 59, 46, .1); border-color: rgba(210, 59, 46, .28); color: #8e241b; }

/* ----------------------------------------------------------- pagination --- */

.pagination { gap: .4rem; }
.pagination .page-link {
  border: 1px solid var(--ci-line); border-radius: var(--ci-radius-sm);
  color: var(--ci-blue); font-family: var(--font-ui); font-weight: 400;
}
.pagination .page-link:hover { background: rgba(18, 117, 201, .08); border-color: var(--ci-blue-bright); }
.pagination .page-item.disabled .page-link { color: var(--ci-muted); background: #f7fafd; }

/* --------------------------------------------------------------- footer --- */

.ci-footer {
  border-top: 1px solid var(--ci-line);
  background: rgba(255, 255, 255, .6);
  padding: 1.8rem 0;
  margin-top: auto;
  color: var(--ci-muted);
  font-size: .86rem;
}
.ci-footer a { color: var(--ci-grey); }
.ci-footer a:hover { color: var(--ci-blue); }
.ci-footer .sep { color: var(--ci-line); margin: 0 .5rem; }

/* ----------------------------------------------------------------- hero --- */

.ci-hero {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  color: #fff;
  padding: clamp(2.4rem, 5vw, 4rem);
  background:
    radial-gradient(700px 380px at 88% -20%, rgba(18, 117, 201, .55), transparent 60%),
    linear-gradient(140deg, var(--ci-blue) 0%, var(--ci-navy) 62%, var(--ci-blue-deep) 100%);
  box-shadow: var(--ci-shadow);
}
.ci-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(120% 120% at 80% 0%, #000, transparent 70%);
  mask-image: radial-gradient(120% 120% at 80% 0%, #000, transparent 70%);
}
.ci-hero > * { position: relative; }
.ci-hero .eyebrow { color: #9fd0ff; }
.ci-hero h1 {
  font-weight: 900;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.03;
  letter-spacing: -.015em;
  margin: .5rem 0 0;
}
.ci-hero p.lead { color: rgba(255, 255, 255, .82); font-weight: 300; max-width: 54ch; margin-top: 1rem; }
.ci-hero .hero-logo { height: 40px; margin-bottom: 1.4rem; opacity: .95; }

/* ---------------------------------------------------------- feature row --- */

.ci-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }
.ci-step {
  background: var(--ci-card);
  border: 1px solid var(--ci-line);
  border-radius: var(--ci-radius);
  box-shadow: var(--ci-shadow-sm);
  padding: 1.5rem;
  transition: transform .15s ease, box-shadow .2s ease;
}
.ci-step:hover { transform: translateY(-3px); box-shadow: var(--ci-shadow); }
.ci-step .step-n {
  width: 2.6rem; height: 2.6rem; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ci-blue-bright), var(--ci-blue));
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
  box-shadow: 0 10px 20px -10px rgba(0, 82, 141, .7);
}
.ci-step h3 { font-size: 1.05rem; font-weight: 800; color: var(--ci-navy); margin: .9rem 0 .35rem; }
.ci-step p { color: var(--ci-muted); font-weight: 300; font-size: .92rem; margin: 0; }

/* ---------------------------------------------------------- page reveal --- */

@keyframes ci-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { animation: ci-rise .55s cubic-bezier(.22, .61, .36, 1) both; }
.reveal-1 { animation-delay: .05s; }
.reveal-2 { animation-delay: .13s; }
.reveal-3 { animation-delay: .21s; }
.reveal-4 { animation-delay: .29s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-1, .reveal-2, .reveal-3, .reveal-4 { animation: none; }
  html { scroll-behavior: auto; }
}
