/* Crédito Casa — componentes do simulador (prefixo cc-). Só tokens; nada de Bootstrap. */

/* ---------- base ---------- */
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 24px; background: var(--surface); color: var(--ink-body); -webkit-font-smoothing: antialiased; }
[class^="cc-"], [class*=" cc-"] { text-shadow: none; box-sizing: border-box; }
[class^="cc-"] *, [class*=" cc-"] * { box-sizing: border-box; }
.cc-num { font-variant-numeric: tabular-nums; }
.cc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cc-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.cc-icon--sm { width: 16px; height: 16px; }

/* ---------- Button ---------- */
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-6);
  font-family: var(--font-heading); font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
  border: 0; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background-color .15s ease, color .15s ease, filter .2s ease;
}
.cc-btn--primary { color: var(--on-brand); background: linear-gradient(to right, var(--brand-navy) 0%, var(--brand-blue) 100%); box-shadow: var(--shadow-button); }
.cc-btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-button-hover); filter: brightness(1.08); }
.cc-btn--primary:active { transform: translateY(0); box-shadow: var(--shadow-button); filter: brightness(.96); }
.cc-btn--secondary { color: var(--brand-navy); background: var(--surface-raised); border: 2px solid var(--brand-navy); padding: 0 calc(var(--space-6) - 2px); }
.cc-btn--secondary:hover { background: var(--surface-tint); }
.cc-btn--ghost { color: var(--brand-navy); background: transparent; }
.cc-btn--ghost:hover { background: var(--surface-tint); }
.cc-btn--sm { min-height: 36px; padding: 0 var(--space-4); font-size: 13px; line-height: 18px; }
.cc-btn--secondary.cc-btn--sm { padding: 0 calc(var(--space-4) - 2px); }
.cc-btn--icon { min-width: 40px; min-height: 40px; padding: 0; border-radius: var(--radius-md); }
.cc-btn--block { width: 100%; }
.cc-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cc-btn[disabled], .cc-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; filter: none; }
.cc-btn .cc-icon { width: 18px; height: 18px; }

/* ---------- Badge ---------- */
.cc-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill); font-family: var(--font-body); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-tint-strong); color: var(--brand-navy);
}
.cc-badge .cc-icon { width: 14px; height: 14px; }
.cc-badge--success { background: var(--success-soft); color: var(--success-ink); }
.cc-badge--warning { background: var(--warning-soft); color: var(--warning-ink); }
.cc-badge--danger { background: var(--danger-soft); color: var(--danger-strong); }
.cc-badge--brand { background: var(--brand-navy); color: var(--on-brand); }

/* ---------- Notice (observações da oferta) ---------- */
.cc-notice { border: 1px solid var(--warning); border-left-width: 1px; border-radius: var(--radius-md); background: var(--warning-soft); color: var(--warning-ink); text-align: left; }
.cc-notice__summary { display: flex; align-items: center; gap: var(--space-2); padding: 10px var(--space-3); font-family: var(--font-body); font-size: 13px; line-height: 20px; font-weight: 700; cursor: pointer; list-style: none; border-radius: var(--radius-md); }
.cc-notice__summary::-webkit-details-marker { display: none; }
.cc-notice__summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.cc-notice__summary .cc-icon { width: 18px; height: 18px; }
.cc-notice__chevron { margin-left: auto; transition: transform .15s ease; }
.cc-notice[open] .cc-notice__chevron { transform: rotate(180deg); }
.cc-notice__body { padding: 0 var(--space-3) var(--space-3) calc(var(--space-3) + 18px + var(--space-2)); font-size: 13px; line-height: 20px; color: var(--ink-body); }
.cc-notice__body p, .cc-notice__body ul { margin: 0; }
.cc-notice__body ul { padding-left: 16px; }
.cc-notice__body li + li { margin-top: var(--space-1); }
.cc-notice--danger { border-color: var(--danger); background: var(--danger-soft); color: var(--danger-strong); }
.cc-notice--info { border-color: var(--line-strong); background: var(--surface-muted); color: var(--ink-body); }
.cc-notice--info .cc-notice__summary .cc-icon { color: var(--ink-muted); }
.cc-notice--static .cc-notice__summary { cursor: default; }

/* ---------- Disclaimer (aviso legal) ---------- */
.cc-disclaimer { display: flex; gap: var(--space-3); max-width: 760px; margin: 0 auto; padding: 14px var(--space-4); border: 1px solid var(--line-tint); border-radius: var(--radius-md); background: var(--surface-tint); color: var(--ink-body); font-size: 13px; line-height: 20px; text-align: left; }
.cc-disclaimer .cc-icon { color: var(--brand-blue); margin-top: 1px; }
.cc-disclaimer__title { font-weight: 700; color: var(--brand-navy); }
.cc-disclaimer p { margin: 0; }
.cc-disclaimer p + p { margin-top: var(--space-1); }

/* ---------- SectionHeading ---------- */
.cc-section-heading { text-align: center; margin: 0 0 var(--space-8); }
.cc-section-heading__eyebrow { display: inline-block; margin: 0 0 var(--space-4); padding: 8px 20px; border-radius: var(--radius-pill); background: var(--surface-tint-strong); color: var(--brand-navy); font-family: var(--font-heading); font-size: 13px; line-height: 20px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.cc-section-heading__title { margin: 0; font-family: var(--font-heading); font-size: 32px; line-height: 40px; font-weight: 700; color: var(--brand-navy); }
.cc-section-heading__lead { max-width: 640px; margin: var(--space-3) auto 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--ink-body); }
.cc-section-heading__extra { margin-top: var(--space-5); }

/* ---------- SimulationSummary ---------- */
.cc-summary { background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-5) var(--space-6); }
.cc-summary__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.cc-summary__title { margin: 0; font-family: var(--font-heading); font-size: 20px; line-height: 28px; font-weight: 700; color: var(--ink); }
.cc-summary__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-4) var(--space-6); }
.cc-summary__item { min-width: 0; }
.cc-summary__label { display: block; margin-bottom: var(--space-1); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.cc-summary__value { display: block; font-size: 20px; line-height: 28px; font-weight: 800; color: var(--brand-navy); font-variant-numeric: tabular-nums; }
.cc-summary__hint { display: block; font-size: 13px; line-height: 20px; color: var(--ink-muted); }
@media (max-width: 575.98px) {
  .cc-summary { padding: var(--space-4); }
  .cc-summary__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
  .cc-summary__value { font-size: 18px; line-height: 26px; }
  .cc-summary__head .cc-btn { width: 100%; }
}

/* ---------- OfferCard ---------- */
.cc-offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-5); align-items: stretch; }
.cc-offer { display: flex; flex-direction: column; min-width: 0; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); transition: box-shadow .2s ease; }
.cc-offer:hover { box-shadow: var(--shadow-card-hover); }
.cc-offer--highlight { border-color: var(--brand-blue); }
.cc-offer__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5) var(--space-3); }
.cc-offer__logo { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--line-tint); border-radius: var(--radius-md); background: var(--surface-tint-strong); overflow: hidden; }
.cc-offer__logo img { max-width: 32px; max-height: 32px; width: auto; height: auto; object-fit: contain; }
.cc-offer__logo span { font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: var(--brand-navy); }
.cc-offer__id { min-width: 0; flex: 1 1 auto; }
.cc-offer__bank { margin: 0; font-family: var(--font-heading); font-size: 18px; line-height: 24px; font-weight: 700; color: var(--brand-navy); overflow-wrap: anywhere; }
.cc-offer__line { margin: 0; font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.cc-offer__badges { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--space-5) var(--space-3); }
.cc-offer__badges:empty { display: none; }
.cc-offer__hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-5); padding: var(--space-3) var(--space-5) var(--space-4); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.cc-offer__stat { min-width: 0; flex: 1 1 120px; }
.cc-offer__stat--main { flex: 0 1 auto; }
.cc-offer__stat-label { display: block; margin-bottom: 2px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; }
.cc-offer__stat-value { display: block; font-size: 16px; line-height: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-offer__stat--main .cc-offer__stat-value { font-size: 28px; line-height: 34px; color: var(--brand-navy); }
.cc-offer__stat-hint { display: block; font-size: 12px; line-height: 16px; color: var(--ink-muted); white-space: nowrap; }
.cc-offer__details { margin: 0; padding: var(--space-2) var(--space-5) 0; }
.cc-offer__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: 7px 0; border-bottom: 1px solid var(--line); }
.cc-offer__row:last-child { border-bottom: 0; }
.cc-offer__row dt { margin: 0; font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.cc-offer__row dd { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.cc-offer__notice { padding: var(--space-3) var(--space-5) 0; }
.cc-offer__actions { display: flex; gap: var(--space-2); padding: var(--space-4) var(--space-5) var(--space-5); margin-top: auto; }
.cc-offer__actions .cc-btn { flex: 1 1 0; min-width: 0; padding-left: var(--space-3); padding-right: var(--space-3); }
@media (max-width: 400px) {
  .cc-offer__actions { flex-direction: column; }
}

/* ---------- InstallmentTable + Modal ---------- */
.cc-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: var(--space-6) var(--space-4); background: var(--overlay); }
.cc-modal--inline { position: relative; inset: auto; z-index: auto; border-radius: var(--radius-lg); }
.cc-modal__dialog { display: flex; flex-direction: column; width: 100%; max-width: 960px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); overflow: hidden; }
.cc-modal--inline .cc-modal__dialog { max-height: 600px; }
.cc-modal__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.cc-modal__titles { min-width: 0; flex: 1 1 auto; }
.cc-modal__title { margin: 0; font-family: var(--font-heading); font-size: 20px; line-height: 28px; font-weight: 700; color: var(--brand-navy); }
.cc-modal__subtitle { margin: 0; font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.cc-modal__close { margin-left: auto; color: var(--ink-muted); }
.cc-modal__close:hover { color: var(--brand-navy); }
.cc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.cc-stat { padding: 10px 14px; border-radius: var(--radius-md); background: var(--surface-tint); min-width: 0; }
.cc-stat__label { display: block; margin-bottom: 2px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }
.cc-stat__value { display: block; font-size: 18px; line-height: 26px; font-weight: 800; color: var(--brand-navy); font-variant-numeric: tabular-nums; }
.cc-stat__hint { display: block; font-size: 12px; line-height: 16px; color: var(--ink-body); }
.cc-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.cc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.cc-table th, .cc-table td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.cc-table th { position: sticky; top: 0; z-index: 2; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--line-strong); padding-top: 10px; padding-bottom: 10px; }
.cc-table th:first-child, .cc-table td:first-child { text-align: left; position: sticky; left: 0; z-index: 1; }
.cc-table th:first-child { z-index: 3; }
.cc-table td:first-child { font-weight: 600; color: var(--ink); }
.cc-table td.cc-table__main { font-weight: 700; color: var(--ink); }
.cc-table tbody tr:nth-child(even) td { background: var(--surface-muted); }
.cc-table tr.cc-table__year td { padding: 6px 12px; text-align: left; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-navy); background: var(--surface-tint); }
.cc-modal__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); background: var(--surface-raised); }
.cc-modal__totals { font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.cc-modal__totals strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.cc-modal__actions { display: flex; gap: var(--space-2); margin-left: auto; }
@media (max-width: 575.98px) {
  .cc-modal { padding: 0; align-items: stretch; }
  .cc-modal__dialog { max-width: none; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .cc-modal--inline .cc-modal__dialog { border-radius: var(--radius-lg); }
  .cc-modal__head, .cc-stats, .cc-modal__foot { padding-left: var(--space-4); padding-right: var(--space-4); }
  .cc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-modal__actions { width: 100%; }
  .cc-modal__actions .cc-btn { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-btn, .cc-offer, .cc-notice__chevron { transition: none; }
  .cc-btn--primary:hover { transform: none; }
}
