:root {
  color-scheme: light;
  --ink: #071821;
  --muted: #5c7180;
  --line: #d5e2e8;
  --soft: #f3f8fa;
  --panel: #ffffff;
  --brand: #00bfd6;
  --brand-dark: #082636;
  --blue: #0065a8;
  --warn: #806018;
  --error: #a3372a;
  --shadow: 0 20px 60px rgba(3, 20, 30, 0.12);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #071821 0%, #0d3444 18%, #eef7f8 42%, #ffffff 100%);
  color: var(--ink);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 10px 0 30px;
  color: #ffffff;
}

.brand-link {
  display: inline-flex;
  width: min(280px, 72vw);
  margin-bottom: 22px;
}

.brand-link img {
  display: block;
  width: 100%;
  height: auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.intro-text {
  max-width: 720px;
  color: #d7eef4;
  font-size: 1.04rem;
  line-height: 1.55;
}

.official-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 18px;
  color: #d7eef4;
  font-size: 0.9rem;
}

.official-sources a {
  border: 1px solid rgba(0, 191, 214, 0.45);
  border-radius: 999px;
  color: #ffffff;
  padding: 7px 10px;
  text-decoration: none;
}

.official-sources a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.api-status {
  min-width: 220px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(7, 24, 33, 0.64);
  padding: 12px 14px;
  color: #d7eef4;
  font-size: 0.9rem;
  text-align: center;
}

.api-status.ok {
  border-color: rgba(0, 191, 214, 0.65);
  color: #ffffff;
}

.api-status.error {
  border-color: #e3b2ab;
  color: var(--error);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(340px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #304039;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd7d1;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  font-weight: 400;
}

select[multiple] {
  min-height: 210px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  white-space: nowrap;
}

select[multiple] option {
  min-width: max-content;
  padding: 4px 6px;
  white-space: nowrap;
}

input:focus,
select:focus {
  outline: 2px solid rgba(31, 111, 74, 0.22);
  border-color: var(--brand);
}

.span-2 {
  grid-column: 1 / -1;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.purpose-filter {
  align-items: stretch;
}

button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.inline-control button {
  background: #e6eee9;
  color: var(--brand-dark);
  padding: 0 14px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
}

.primary-action {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  background: var(--brand);
  color: #06161d;
  font-size: 1rem;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.recaptcha-wrap {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.lgpd-box,
.form-note {
  margin-top: 16px;
  border-left: 4px solid var(--blue);
  background: #f1f6f9;
  padding: 12px 14px;
  color: #385060;
  font-size: 0.9rem;
  line-height: 1.45;
}

.lgpd-box p,
.form-note {
  margin-bottom: 0;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 16px;
}

.check-grid label,
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 600;
  line-height: 1.35;
}

.check-grid input,
.checkbox-label input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 1px;
}

.check-grid label.is-disabled {
  color: #8a9690;
}

.check-grid label.is-disabled input {
  cursor: not-allowed;
}

.result-panel {
  margin-top: 18px;
}

.hidden {
  display: none;
}

#lead-form[data-applicant-rural="true"] #associated_working_capital_label {
  display: none !important;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.lead-id {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.rate-stack {
  display: grid;
  gap: 9px;
  margin-top: 7px;
}

.rate-stack strong {
  margin-top: 2px;
}

.rate-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.simulation-panel {
  margin: 4px 0 22px;
}

.simulation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.simulation-rate-button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--brand-dark);
  padding: 0 14px;
}

.simulation-rate-button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #06161d;
}

.simulation-rate-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h3 {
  margin: 0;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.result-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.result-list {
  margin: 0;
  padding-left: 18px;
  color: #324139;
  line-height: 1.45;
}

.warning {
  border-left-color: var(--warn);
  background: #fff8e8;
  color: #5d4613;
}

.admin-login {
  max-width: 760px;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.admin-summary {
  margin-bottom: 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-actions button {
  min-height: 40px;
  border: 1px solid #cbd7d1;
  background: #e6eee9;
  color: var(--brand-dark);
  padding: 0 14px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: #eef4ef;
  color: #304039;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .intro,
  .form-grid,
  .result-header,
  .result-columns,
  .metric-grid,
  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .api-status,
  .lead-id {
    text-align: left;
  }

  .admin-toolbar {
    display: grid;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .field-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .panel,
  .result-panel {
    padding: 16px;
  }
}
