/* ============================================================
   Aportize - Salário líquido (CLT)
   Carregar depois de chrome.css e calculator.css.
   Requer <main class="wrap calculator-page ns-page">.
   ============================================================ */

.calculator-page.ns-page {
  --ns-column-gap: clamp(56px, 6vw, 96px);
  padding-top: clamp(36px, 5vw, 72px);
  padding-bottom: clamp(64px, 8vw, 112px);
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  color-scheme: dark;
}

.ns-page [hidden] {
  display: none !important;
}

.ns-page button,
.ns-page input,
.ns-page summary {
  -webkit-tap-highlight-color: transparent;
}

.ns-page button,
.ns-page input {
  margin: 0;
  font-family: var(--sans);
}

.ns-page button {
  appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: color var(--t), background-color var(--t), border-color var(--t);
}

.ns-page button:focus-visible,
.ns-page summary:focus-visible,
.ns-page a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.ns-page input {
  caret-color: var(--green);
}
.ns-page input::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* ---------- Abertura ---------- */

.ns-page .intro {
  margin: 0 0 clamp(36px, 4.5vw, 60px);
}

.ns-page .intro .eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.ns-page .intro h1 {
  max-width: none;
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.052em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.ns-page .intro h1 span {
  color: var(--muted);
}

.ns-page .intro .intro__description {
  max-width: 52ch;
  margin: 22px 0 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  letter-spacing: -0.01em;
}

/* ---------- Estrutura ---------- */

.ns-page .calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 40px;
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px solid var(--hairline);
  background: none;
}

.ns-page #calculator-form {
  display: grid;
  min-width: 0;
  gap: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.ns-page .section-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.ns-page .field-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.ns-page .field-hint:empty {
  display: none;
}

/* ---------- Salário bruto em destaque ---------- */

.ns-page .primary-input {
  margin: 0;
}
.ns-page .primary-input .section-label {
  margin: 0;
}

.ns-page .primary-input__field {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
  transition: border-color var(--t);
}

.ns-page .primary-input__field:focus-within {
  border-color: var(--green);
}

.ns-page .primary-input__prefix {
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: -0.03em;
}

.ns-page #gross-salary {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-family: var(--mono);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---------- Demais campos ---------- */

.ns-page .fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.ns-page .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.ns-page .field-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.ns-page .field-label small {
  font-size: 0.6875rem;
}

.ns-page .input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  min-width: 0;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  transition: border-color var(--t), background-color var(--t);
}

.ns-page .input-shell:focus-within {
  border-color: var(--green);
}

.ns-page .input-shell__prefix {
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
  pointer-events: none;
}

.ns-page .input-shell input {
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-family: var(--mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---------- Resultado ---------- */

.ns-page .result,
.ns-page .result-empty {
  position: static;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 32px 0 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.ns-page .result > .section-label {
  margin: 0;
  color: var(--green);
  font-size: 0.8125rem;
  font-weight: 500;
}

.ns-page .net-salary {
  display: block;
  max-width: 100%;
  margin: 12px 0 0;
  padding-bottom: 3px;
  overflow-x: auto;
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(1.875rem, 2.7vw, 2.375rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  scrollbar-width: thin;
}

.ns-page .net-salary__note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}
.ns-page .net-salary__note:empty {
  display: none;
}

.ns-page .statement {
  margin: 24px 0 0;
  border-top: 1px solid var(--hairline);
}

.ns-page .statement__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  min-width: 0;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid var(--hairline);
}

.ns-page .statement__row dt {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.ns-page .statement__row dd {
  max-width: 60%;
  margin: 0;
  overflow-x: auto;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  scrollbar-width: thin;
}

.ns-page .statement__tag {
  margin-left: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.ns-page .statement__tag:empty {
  display: none;
}

.ns-page .statement__row--minus dd {
  color: var(--text-secondary);
}

.ns-page .statement__row--total {
  border-bottom: 0;
  padding-bottom: 0;
}

.ns-page .statement__row--total dt {
  color: var(--text);
  font-weight: 500;
}

.ns-page .statement__row--total dd {
  color: var(--green);
  font-size: 1.125rem;
}

.ns-page .aside-line {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.ns-page .aside-line:empty {
  display: none;
}

.ns-page #copy-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ---------- Notas ---------- */

.ns-page .note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.ns-page .note:empty {
  display: none;
}
.ns-page .note strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.ns-page .assumptions {
  margin-top: 20px;
  border-top: 1px solid var(--hairline);
}

.ns-page .assumptions summary {
  position: relative;
  display: block;
  min-height: 48px;
  padding: 15px 28px 15px 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
}

.ns-page .assumptions summary::-webkit-details-marker {
  display: none;
}

.ns-page .assumptions summary::after {
  content: "+";
  position: absolute;
  top: 11px;
  right: 2px;
  color: var(--muted);
  font-size: 1.25rem;
}

.ns-page .assumptions[open] summary::after {
  content: "\2212";
}
.ns-page .assumptions__content {
  padding-bottom: 10px;
}
.ns-page .assumptions__content .note:first-child {
  margin-top: 0;
}

.ns-page .next-step {
  margin: 18px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.ns-page .next-step a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--t);
}

.ns-page .result:not([hidden]) + .result-empty {
  display: none;
}

.ns-page .result-empty {
  min-height: 220px;
}

.ns-page .result-empty > .section-label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.ns-page .result-empty__title {
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.75rem, 2.7vw, 2.375rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.ns-page .result-empty__description {
  max-width: 34ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.ns-page .noscript {
  margin: 0 0 28px;
  padding: 16px 0;
  border-block: 1px solid var(--hairline);
  color: var(--text-secondary);
}

/* ---------- Interacao ---------- */

@media (hover: hover) {
  .ns-page .primary-input__field:hover:not(:focus-within) {
    border-color: var(--muted);
  }
  .ns-page .assumptions summary:hover,
  .ns-page .next-step a:hover,
  .ns-page #copy-result:hover {
    color: var(--text);
  }
}

/* ---------- Tablet e desktop ---------- */

@media (min-width: 620px) {
  .ns-page .fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ns-page .field--dependents {
    grid-column: 1 / -1;
    max-width: 12rem;
  }
}

@media (min-width: 1180px) {
  .ns-page .calculator-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    column-gap: var(--ns-column-gap);
    background-image: linear-gradient(var(--hairline), var(--hairline));
    background-size: 1px 100%;
    background-repeat: no-repeat;
    background-position: calc(52.5% - var(--ns-column-gap) * 0.025) 0;
  }

  .ns-page .result,
  .ns-page .result-empty {
    padding: 0;
    border-top: 0;
  }
}

@media (min-width: 1180px) and (min-height: 860px) {
  .ns-page .result:not(:has(.assumptions[open])),
  .ns-page .result-empty {
    position: sticky;
    top: calc(var(--nav-h) + 28px);
  }
}

@media (max-width: 619px) {
  .ns-page .intro h1 {
    font-size: clamp(1.875rem, 8.5vw, 3rem);
    line-height: 1.08;
  }
  .ns-page .intro .intro__description {
    margin-top: 18px;
    font-size: 0.9375rem;
  }
  .ns-page #gross-salary {
    font-size: clamp(2rem, 11vw, 3rem);
  }
  .ns-page .input-shell {
    height: 52px;
  }
  .ns-page .statement__row dd {
    max-width: 55%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ns-page *,
  .ns-page *::before,
  .ns-page *::after {
    transition-duration: 1ms !important;
  }
}

@media (forced-colors: active) {
  .ns-page .input-shell,
  .ns-page #copy-result {
    border: 1px solid ButtonText;
  }
  .ns-page button:focus-visible,
  .ns-page summary:focus-visible,
  .ns-page a:focus-visible {
    outline-color: Highlight;
  }
  .ns-page .primary-input__field:focus-within,
  .ns-page .input-shell:focus-within {
    border-color: Highlight;
  }
}
