* {
  box-sizing: border-box;
}

:root {
  font-family: Inter, Arial, system-ui, sans-serif;
  color: #eefaff;
  background: #030507;
  font-synthesis: none;
}

html {
  min-height: 100%;
  background: #030507;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  color: #eefaff;
  background:
    radial-gradient(circle at 15% 18%, rgba(41, 222, 204, 0.12), transparent 30%),
    radial-gradient(circle at 82% 72%, rgba(38, 112, 255, 0.14), transparent 32%),
    radial-gradient(circle at 48% 108%, rgba(65, 114, 163, 0.09), transparent 38%),
    linear-gradient(145deg, #101319 0%, #090d13 38%, #05080d 68%, #010203 100%);
  background-size: 160% 160%, 160% 160%, 180% 180%, 220% 220%;
  animation: darkPageGlow 6s ease-in-out infinite alternate;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button,
input,
select,
summary {
  outline-offset: 4px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #177e69;
}

button {
  border: 0;
}

/* HEADER */

.site-header {
  position: relative;
  z-index: 30;
  min-height: 116px;
  padding: 9px clamp(20px, 3.1vw, 54px);
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
  background:
    radial-gradient(circle at 18% 2%, rgba(255,255,255,.10), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(45,151,199,.10), transparent 34%),
    radial-gradient(circle at 48% 110%, rgba(44,89,140,.13), transparent 40%),
    linear-gradient(180deg,#101217 0%,#080a0f 48%,#020305 100%);
  background-size:160% 160%,170% 170%,180% 180%,220% 220%;
  animation:headerGlow 4.4s ease-in-out infinite alternate;
  box-shadow:0 12px 36px rgba(0,0,0,.48),inset 0 -1px 0 rgba(255,255,255,.08);
}

.header-left { display:flex; align-items:center; gap:20px; min-width:0; }
.invicius-brand { position:relative; width:118px; min-width:118px; height:88px; display:flex; align-items:center; justify-content:center; text-decoration:none; }
.invicius-brand::before { content:none; }
.invicius-brand img { width:100%; height:100%; object-fit:contain; display:block; opacity:1; animation:logoChromatic 6s ease-in-out infinite alternate; filter:saturate(1.16) brightness(1.06) drop-shadow(0 9px 16px rgba(12,27,104,.24)); }

.calc-brand { display:flex; align-items:center; gap:12px; min-width:0; }
.calc-brand-mark { width:48px; height:48px; flex:0 0 auto; border-radius:14px; display:flex; align-items:flex-end; justify-content:center; gap:4px; padding:10px 9px; background:linear-gradient(135deg,#62f5dc 0%,#26dbea 28%,#258fe7 62%,#51efc8 100%); background-size:240% 240%; animation:brandFlow 6s ease-in-out infinite alternate; box-shadow:0 8px 18px rgba(23,94,177,.30),inset 0 1px 0 rgba(255,255,255,.28); }
.calc-brand-mark i { display:block; width:6px; border-radius:3px 3px 1px 1px; background:linear-gradient(135deg,#010203 0%,#0b1016 30%,#18303d 58%,#05070a 100%); background-size:240% 240%; animation:headerInkFlow 4.4s ease-in-out infinite alternate; box-shadow:0 1px 0 rgba(255,255,255,.08); }
.calc-brand-mark i:nth-child(1){height:17px}.calc-brand-mark i:nth-child(2){height:29px}.calc-brand-mark i:nth-child(3){height:23px}
.calc-brand-name { font-size:22px; font-weight:820; line-height:1.1; letter-spacing:-.7px; color:transparent; background:linear-gradient(135deg,#67f7de 0%,#27dce9 30%,#258ee6 64%,#54f0c8 100%); background-size:240% 240%; animation:brandFlow 6s ease-in-out infinite alternate; -webkit-background-clip:text; background-clip:text; white-space:nowrap; }

.header-actions { margin-left:auto; display:flex; align-items:center; justify-content:flex-end; gap:24px; }
.header-menu-wrap { position:relative; }
.header-menu-button { position:relative; min-width:136px; height:52px; display:inline-flex; align-items:center; justify-content:center; gap:12px; padding:0 21px; border:1px solid rgba(107,255,232,.34); border-radius:18px; background:linear-gradient(135deg,#52f2d6 0%,#25d7e8 26%,#248de4 58%,#385fe2 100%); background-size:240% 240%; animation:buttonFlow 6s ease-in-out infinite alternate; box-shadow:inset 0 1px 0 rgba(255,255,255,.16),inset 0 -1px 0 rgba(8,54,122,.16); color:transparent; font-family:"Rajdhani","Segoe UI",ui-sans-serif,sans-serif; font-weight:700; font-size:1.04rem; letter-spacing:.005em; text-transform:uppercase; cursor:pointer; transition:transform .18s ease,filter .18s ease,box-shadow .18s ease; }
.header-menu-button:hover,.header-menu-button:focus-visible { transform:translateY(-3px); filter:brightness(1.1) saturate(1.08); outline:none; box-shadow:inset 0 1px 0 rgba(255,255,255,.18),inset 0 -1px 0 rgba(8,54,122,.18); }
.header-menu-button:active{transform:translateY(2px);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),inset 0 -1px 0 rgba(8,54,122,.20)}
.header-menu-button>span:first-child,.header-chevron { color:transparent; background:linear-gradient(135deg,#010203 0%,#0b1016 28%,#18303d 55%,#070a0e 78%,#010203 100%); background-size:240% 240%; -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; animation:headerInkFlow 4.4s ease-in-out infinite alternate; }
.header-menu-button>span:first-child{font-weight:700;letter-spacing:-.01em}.header-chevron { font-size:13px; transition:transform .16s ease; }
.header-menu-wrap.open .header-chevron { transform:rotate(180deg); }
.header-menu-panel { position:absolute; top:calc(100% + 10px); left:0; min-width:250px; padding:9px; border:1px solid rgba(75,218,239,.34); border-radius:17px; background:radial-gradient(circle at 18% 8%,rgba(255,255,255,.08),transparent 28%),radial-gradient(circle at 82% 22%,rgba(46,164,210,.08),transparent 30%),linear-gradient(160deg,rgba(18,21,27,.98),rgba(7,9,13,.99) 58%,rgba(1,2,4,.995)); backdrop-filter:blur(18px); box-shadow:0 22px 50px rgba(0,0,0,.48),inset 0 1px 0 rgba(115,230,255,.10); opacity:0; visibility:hidden; transform:translateY(-7px); transition:opacity .15s ease,transform .15s ease,visibility .15s ease; }
.header-menu-wrap.open .header-menu-panel { opacity:1; visibility:visible; transform:translateY(0); }
.header-menu-panel a,.header-menu-panel button { width:100%; min-height:45px; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:10px 13px; border:0; border-radius:11px; color:transparent; text-decoration:none; text-align:start; background:linear-gradient(135deg,#7bffe8 0%,#3dd8ee 38%,#4ba7ff 72%,#7882ff 100%); -webkit-background-clip:text; background-clip:text; cursor:pointer; font-family:Bahnschrift,"Arial Narrow","Segoe UI",ui-sans-serif,sans-serif; font-weight:680; letter-spacing:.025em; }
.header-menu-panel a:hover,.header-menu-panel a:focus-visible,.header-menu-panel button:hover,.header-menu-panel button:focus-visible { background-color:rgba(58,204,235,.10); outline:none; }
.header-menu-panel small { color:#58dce9; -webkit-text-fill-color:#58dce9; }
.header-language-wrap .header-menu-panel { left:auto; right:0; width:280px; max-height:420px; overflow:auto; }
.header-language-option.active { background-color:rgba(84,215,255,.10); box-shadow:inset 0 0 0 1px rgba(91,228,239,.22); }

@keyframes pageGlow { 0%{background-position:0% 0%,100% 100%,0% 50%} 50%{background-position:26% 18%,74% 82%,52% 50%} 100%{background-position:48% 34%,58% 66%,100% 50%} }
@keyframes brandFlow { 0%{background-position:0% 42%}50%{background-position:58% 58%}100%{background-position:100% 42%} }
@keyframes buttonFlow { 0%{background-position:0% 45%}50%{background-position:58% 55%}100%{background-position:100% 45%} }
@keyframes headerGlow { 0%{background-position:0% 20%,100% 0%,0% 50%,0% 50%}100%{background-position:25% 5%,72% 24%,100% 50%,100% 50%} }

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.layout {
  width: 100%;
  max-width: none;

  margin: 28px 0;
  padding: 0 20px;

  display: grid;

  /*
    Todo o espaço que sobra é dividido igualmente
    entre a coluna esquerda e a coluna direita.

    A calculadora pode chegar no máximo a 920px.
  */
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 920px)
    minmax(0, 1fr);

  gap: 20px;

  /*
    Faz as duas colunas laterais acompanharem
    a altura total da coluna central.
  */
  align-items: stretch;
}

main {
  min-width: 0;
}

/* =========================================================
   DESKTOP AD RAILS
   ========================================================= */

.side-rail {
  width: 100%;
  min-width: 0;

  height: auto;
  min-height: 600px;

  align-self: stretch;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  border: 1px dashed rgba(235, 249, 255, 0.48);
  border-radius: 10px;

  color: rgba(242, 250, 255, 0.82);
  gap: 8px;

  text-align: center;
  font-size: 12px;

  margin: 0;
}

.side-rail span {
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 11px;
}

.side-rail small {
  color: rgba(235, 248, 255, 0.68);
}

/* TYPOGRAPHY */

.eyebrow {
  color: #52716f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1 {
  font-size: 36px;
  letter-spacing: -1.3px;
  line-height: 1.15;
  margin: 9px 0 12px;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
  margin: 0;
}

h3 {
  font-size: 16px;
  margin: 0;
}

.intro {
  color: #63757d;
  margin: 0 0 27px;
  max-width: 620px;
}

/* CARDS */

.card {
  background: white;
  border: 1px solid #dce5e8;
  border-radius: 16px;

  padding: 25px;
  margin-bottom: 20px;

  box-shadow: 0 3px 8px #17343d03;
}

/* PREFERENCES */

.preferences {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;

  margin-bottom: 23px;
}

label,
.label {
  display: block;

  font-size: 14px;
  font-weight: 600;

  margin-bottom: 7px;
}

input,
select {
  width: 100%;
  height: 46px;

  border: 1px solid #cbd7db;
  border-radius: 8px;

  color: #17343d;
  background: #fff;

  padding: 9px 11px;

  min-width: 0;
}

input {
  font-variant-numeric: tabular-nums;
}

select {
  padding-inline-end: 24px;
}

/* SECTIONS */

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title small {
  font-size: 12px;
  color: #6a7b82;
}

/* LOANS */

.loan {
  border-top: 1px solid #e6ecee;
  padding-top: 18px;
  margin-top: 18px;
}

.loan-title {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 12px;
}

.loan-title h3 {
  display: flex;
  align-items: center;
  gap: 9px;
}

.loan-number {
  display: inline-grid;
  place-items: center;

  background: #eaf3f1;
  color: #276553;

  width: 27px;
  height: 27px;

  border-radius: 7px;
  font-size: 13px;
}

.remove {
  background: transparent;
  color: #697d84;

  padding: 6px 8px;

  font-size: 13px;
  border-radius: 6px;
}

.remove:hover {
  background: #fff0ef;
  color: #ae3535;
}

/* FIELDS */

.fields {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 15px;
}

.pair {
  display: flex;
  gap: 6px;
}

.pair input {
  width: 47%;
}

.pair select {
  width: 53%;
  font-size: 14px;
}

.amount-wrap {
  position: relative;
}

.amount-wrap input {
  padding-inline-end: 52px;
}

.currency-tag {
  position: absolute;

  inset-inline-end: 12px;
  top: 13px;

  font-size: 12px;
  color: #697e83;
  font-weight: 600;

  pointer-events: none;
}

/* ADD LOAN */

.add {
  background: white;
  color: #22765c;

  border: 1px dashed #9cbfb2;

  width: 100%;

  border-radius: 8px;

  padding: 11px;
  margin-top: 20px;

  font-weight: 600;
  font-size: 14px;
}

.add:hover {
  background: #f1faf6;
}

/* PAYMENT MODE */

.mode-row {
  margin-top: 24px;
}

.segments {
  display: flex;

  background: #eff3f4;

  border-radius: 9px;

  padding: 4px;
  gap: 4px;

  margin-top: 9px;
}

.segments label {
  position: relative;

  flex: 1;

  text-align: center;

  padding: 9px 10px;
  margin: 0;

  border-radius: 7px;

  cursor: pointer;

  font-size: 14px;
  font-weight: 500;
}

.segments input {
  position: absolute;

  opacity: 0;

  width: 1px;
  height: 1px;
}

.segments label:has(input:checked) {
  background: #fff;

  box-shadow: 0 1px 4px #17343d1a;

  color: #19654f;
  font-weight: 650;
}

.segments label:has(input:focus-visible) {
  outline: 3px solid #177e69;
}

/* TEXT */

.hint {
  font-size: 13px;
  color: #697d84;

  margin: 11px 0 0;

  line-height: 1.6;
}

/* BUTTONS */

.calculate {
  width: 100%;

  background: #183d45;
  color: #fff;

  border-radius: 9px;

  padding: 14px 20px;
  margin-top: 20px;

  font-weight: 650;

  display: flex;
  justify-content: center;
  gap: 12px;
}

.calculate:hover {
  background: #24535c;
}

/* ERRORS */

.error {
  color: #a12b2b;
  background: #fff0ef;

  padding: 12px;

  border-radius: 8px;

  font-size: 14px;

  margin-top: 16px;
}

.error:empty {
  display: none;
}

/* RESULTS */

.result {
  border: 1px solid #badbce;
  background: #e7f5ee;

  border-radius: 16px;

  padding: 25px;

  margin-bottom: 20px;
}

.result-top {
  display: flex;
  justify-content: space-between;

  gap: 20px;

  align-items: start;
  flex-wrap: wrap;
}

.result-top > div {
  min-width: 0;
  max-width: 100%;
}

.result .eyebrow {
  letter-spacing: 1.3px;
}

.payment {
  font-size: 42px;
  font-weight: 650;

  letter-spacing: -1.8px;
  line-height: 1.2;

  margin: 10px 0 4px;

  overflow-wrap: anywhere;
}

.payment small {
  font-size: 15px;

  letter-spacing: 0;
  font-weight: 400;

  color: #53776a;
}

.badge {
  font-size: 12px;

  background: #d1eade;
  color: #285e4a;

  border-radius: 25px;

  padding: 6px 10px;

  white-space: nowrap;
}

/* STATS */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  gap: 15px;

  border-top: 1px solid #c4ded1;

  margin-top: 23px;
  padding-top: 19px;
}

.stats dt {
  color: #53776a;
  font-size: 13px;
}

.stats dd {
  margin: 4px 0 0;

  font-size: 18px;
  font-weight: 600;

  overflow-wrap: anywhere;
}

/* PERIODS */

.period {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  padding: 15px 0;

  border-bottom: 1px solid #e4ecee;
}

.period:last-child {
  border: 0;
}

.period span {
  font-size: 14px;
  color: #60757c;
}

.period strong {
  font-size: 16px;
}

.period-bar {
  height: 5px;

  background: #e4efec;

  border-radius: 8px;

  margin-top: 8px;

  overflow: hidden;
}

.period-bar i {
  display: block;

  height: 100%;

  background: #5eab91;

  border-radius: 8px;
}

.period-label {
  flex: 1;
}

/* TABLE */

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-header {
  padding: 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 14px;
}

.table-scroll {
  overflow: auto;
  max-height: 530px;
}

table {
  width: 100%;

  border-collapse: collapse;

  font-variant-numeric: tabular-nums;
  font-size: 14px;

  white-space: nowrap;
}

th,
td {
  text-align: end;

  padding: 13px 20px;

  border-bottom: 1px solid #e7edef;
}

th:first-child,
td:first-child {
  text-align: start;
}

th {
  background: #f6f8f9;
  color: #63777e;

  font-size: 12px;
  font-weight: 600;

  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover {
  background: #f3f9f6;
}

tfoot {
  font-weight: 650;
  background: #f6f8f9;
}

/* PAGINATION */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 16px 23px;

  gap: 10px;

  color: #63777e;
  font-size: 13px;
}

.pagination button {
  padding: 7px 12px;

  border-radius: 6px;

  background: #edf3f1;
  color: #245c49;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* DETAILS */

details {
  font-size: 13px;
  color: #63777e;
}

summary {
  cursor: pointer;

  color: #335e61;

  font-weight: 600;
}

details p {
  line-height: 1.7;
}

/* FOOTER */

footer {
  text-align: center;

  font-size: 12px;
  color: #72858b;

  padding: 8px 0 28px;
}

a {
  color: #226851;
}

/* EMPTY */

.empty {
  border: 1px dashed #c7d7d9;

  padding: 25px;

  text-align: center;

  color: #677d84;

  border-radius: 12px;

  margin-bottom: 20px;
}

[hidden] {
  display: none !important;
}

/* RTL */

[dir="rtl"] .brand {
  letter-spacing: 0;
}

[dir="rtl"] h1,
[dir="rtl"] .payment {
  letter-spacing: 0;
}

/* TARGET */

.target-control {
  margin-bottom: 24px;
}

.target-control select {
  font-weight: 600;

  background: #f4f9f7;
  border-color: #a9c9bd;
}

/* INVERSE */

.inverse-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.computed {
  display: flex;
  align-items: center;

  height: 46px;

  border: 1px dashed #a9c9bd;
  border-radius: 8px;

  color: #37765e;
  background: #f2faf6;

  padding: 9px 11px;

  font-size: 14px;

  flex: 1;
  min-width: 0;
}

.solved-list {
  margin-top: 18px;
}

.solved-list > div {
  display: flex;
  justify-content: space-between;

  gap: 14px;

  padding: 9px 0;

  border-top: 1px solid #c4ded1;
}

.solved-list span {
  font-size: 14px;
}

.solved-list strong {
  text-align: end;
}

.unknown-field label {
  color: #37765e;
}

/* NOTICES */

.amortization-notice {
  padding: 14px;

  border: 1px solid #dfc782;

  background: #fff7df;

  border-radius: 8px;

  color: #614a12;

  font-size: 14px;
  line-height: 1.6;
}

.global-payment {
  margin-bottom: 24px;

  padding: 18px;

  background: #f3f8f6;

  border-radius: 10px;
  border: 1px solid #dce8e1;
}

.payment-field {
  margin-bottom: 24px;
  max-width: 100%;
}

/* DOWNLOADS */

.download {
  margin: 0 0 20px;
}

.download:disabled {
  opacity: 0.65;
  cursor: wait;
}

a.download {
  text-decoration: none;
}

.download-actions {
  display: flex;

  gap: 12px;

  margin: 0 0 20px;
}

.download-actions .download {
  flex: 1;
  min-width: 0;

  margin: 0;
}

/* =========================================================
   MOBILE AD
   ========================================================= */

.ad-mobile {
  display: none;
}


@media (max-width: 1050px) {
  .site-header { flex-wrap:wrap; }
  .header-actions { flex:1 1 520px; gap:12px; }
  .header-menu-button { min-width:136px; height:52px; padding:0 21px; }
}

@media (max-width: 760px) {
  .site-header { padding:10px 14px 15px; gap:10px; }
  .header-left { gap:10px; }
  .invicius-brand { width:82px; min-width:82px; height:64px; }
  .calc-brand-mark { width:40px; height:40px; border-radius:12px; padding:8px; }
  .calc-brand-mark i { width:5px; }
  .calc-brand-mark i:nth-child(1){height:14px}.calc-brand-mark i:nth-child(2){height:24px}.calc-brand-mark i:nth-child(3){height:19px}
  .calc-brand-name { font-size:17px; white-space:normal; max-width:150px; }
  .header-actions { flex:1 1 100%; display:grid; grid-template-columns:1fr 1fr 1fr; gap:7px; }
  .header-menu-button { min-width:0; width:100%; height:43px; border-radius:13px; padding:0 12px; font-size:1rem; gap:12px; }
  .header-menu-panel { min-width:210px; }
}


/* =========================================================
   INVICIUS DARK THEME
   ========================================================= */

.card,
.table-card,
details.card {
  background: rgba(8, 12, 18, 0.91);
  border-color: rgba(95, 221, 232, 0.18);
  color: #eefaff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255,255,255,0.025);
  backdrop-filter: blur(12px);
}

h1, h2, h3,
.label, label,
.loan-title h3,
.table-header h2,
.period strong,
.stats dd,
.solved-list strong,
summary {
  color: #f1fbff;
}

.intro,
.hint,
.section-title small,
.period span,
.stats dt,
details,
details p,
footer {
  color: rgba(222, 241, 248, 0.72);
}

input,
select {
  color: #eefaff;
  background: rgba(15, 22, 31, 0.94);
  border-color: rgba(101, 216, 228, 0.28);
}

input::placeholder { color: rgba(219, 239, 246, 0.38); }
select option { color: #eefaff; background: #0c121a; }

.target-control select,
.computed,
.global-payment {
  color: #8ff4e3;
  background: rgba(11, 28, 34, 0.82);
  border-color: rgba(93, 236, 215, 0.26);
}

.loan { border-top-color: rgba(116, 202, 218, 0.13); }
.loan-number {
  color: #a8f9e7;
  background: rgba(43, 186, 178, 0.13);
}
.remove { color: rgba(221, 240, 247, 0.64); }
.remove:hover { color: #ffaaa5; background: rgba(190, 52, 52, 0.13); }

.add {
  color: #89f2dc;
  background: rgba(8, 18, 25, 0.78);
  border-color: rgba(95, 224, 207, 0.42);
}
.add:hover { background: rgba(34, 175, 166, 0.12); }

.segments { background: rgba(18, 27, 36, 0.94); }
.segments label { color: rgba(227, 243, 249, 0.72); }
.segments label:has(input:checked) {
  color: #071014;
  background: linear-gradient(135deg,#64f3dc,#2bd7e8 45%,#2d91e9);
  box-shadow: 0 6px 18px rgba(11, 128, 158, 0.18);
}

.calculate {
  color: #020608;
  background: linear-gradient(135deg,#61f4dc 0%,#2bd8e8 42%,#2b94e8 100%);
  box-shadow: 0 8px 0 rgba(23, 74, 142, 0.36), 0 16px 28px rgba(0,0,0,0.26);
}
.calculate:hover { background: linear-gradient(135deg,#79ffe9 0%,#39e6f4 42%,#41a4f5 100%); }

.error { color: #ffbbb5; background: rgba(130, 35, 35, 0.22); }

.result {
  color: #effffb;
  background:
    radial-gradient(circle at 15% 0%, rgba(61, 238, 212, 0.12), transparent 38%),
    linear-gradient(145deg, rgba(9, 34, 36, 0.94), rgba(5, 18, 27, 0.96));
  border-color: rgba(82, 230, 203, 0.26);
  box-shadow: 0 18px 42px rgba(0,0,0,0.26);
}
.result .eyebrow,
.payment small,
.stats dt { color: rgba(169, 235, 216, 0.76); }
.payment { color: #f4fffc; }
.badge { color: #9bf8df; background: rgba(55, 191, 163, 0.15); }
.stats { border-top-color: rgba(112, 222, 198, 0.17); }

.period { border-bottom-color: rgba(106, 192, 204, 0.13); }
.period-bar { background: rgba(105, 176, 182, 0.15); }
.period-bar i { background: linear-gradient(90deg,#47d9c2,#3baeea); }

.table-scroll { scrollbar-color: rgba(83, 215, 210, .42) rgba(5, 9, 13, .55); }
table { color: #eaf7fb; }
th, td { border-bottom-color: rgba(105, 180, 196, 0.12); }
th {
  color: rgba(219, 239, 247, 0.72);
  background: #101720;
}
tbody tr:hover { background: rgba(47, 181, 184, 0.08); }
tfoot { background: #101720; }

.pagination { color: rgba(218, 239, 246, 0.68); }
.pagination button { color: #93f1dd; background: rgba(41, 171, 160, 0.13); }

a { color: #6fead8; }
.empty { color: rgba(219, 239, 247, 0.70); border-color: rgba(104, 201, 214, 0.22); background: rgba(7,12,18,.55); }

.amortization-notice {
  color: #ffe8aa;
  border-color: rgba(234, 198, 112, 0.28);
  background: rgba(121, 91, 23, 0.18);
}

.side-rail,
.ad-mobile {
  color: rgba(225, 244, 250, 0.70);
  border-color: rgba(196, 231, 240, 0.25);
  background: rgba(4, 8, 13, 0.18);
}

.currency-tag { color: rgba(185, 224, 232, 0.62); }

@keyframes darkPageGlow {
  0% { background-position: 0% 0%, 100% 100%, 50% 100%, 0% 50%; }
  50% { background-position: 24% 16%, 76% 82%, 48% 74%, 52% 50%; }
  100% { background-position: 44% 30%, 60% 64%, 52% 48%, 100% 50%; }
}

@keyframes logoChromatic {
  0% { filter: hue-rotate(-8deg) saturate(1.12) brightness(1.04) drop-shadow(0 9px 16px rgba(12,27,104,.24)); }
  50% { filter: hue-rotate(12deg) saturate(1.28) brightness(1.10) drop-shadow(0 9px 18px rgba(22,177,205,.24)); }
  100% { filter: hue-rotate(30deg) saturate(1.30) brightness(1.08) drop-shadow(0 9px 18px rgba(33,193,163,.24)); }
}

@keyframes headerInkFlow {
  0% { background-position: 0% 42%; }
  50% { background-position: 58% 58%; }
  100% { background-position: 100% 42%; }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1150px) and (min-width: 901px) {
  .layout {
    gap: 12px;
    padding: 0 12px;
  }

  .side-rail {
    font-size: 11px;
  }

  .fields {
    gap: 10px;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {
  .layout {
    display: block;

    max-width: 800px;

    margin: 25px auto 0;

    padding: 0 20px;
  }

  .side-rail {
    display: none;
  }

  .ad-mobile {
    display: flex;

    min-height: 100px;
    width: 100%;

    margin: 0 0 20px;

    border: 1px dashed #c9d4d9;
    border-radius: 10px;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 8px;

    color: #7c8b92;

    text-align: center;
    font-size: 12px;
  }

  .ad-mobile span {
    text-transform: uppercase;
    letter-spacing: 1.5px;

    font-size: 11px;
  }

  header {
    padding: 0 22px;
    height: 72px;
  }

  .header-note {
    font-size: 12px;
  }
}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 560px) {
  .layout {
    padding: 0 14px;
  }

  .card,
  .result {
    padding: 20px;
  }

  h1 {
    font-size: 30px;
  }

  .intro {
    font-size: 14px;
  }

  .preferences {
    gap: 12px;
  }

  .fields {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pair input {
    width: 60%;
  }

  .pair select {
    width: 40%;
  }

  .payment {
    font-size: 30px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stats div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
  }

  .stats dd {
    font-size: 16px;
    margin: 0;
  }

  .badge {
    white-space: normal;
    text-align: center;
  }

  .header-note {
    display: none;
  }

  .table-header {
    padding: 20px;
  }

  .segments label {
    font-size: 13px;
    padding: 9px 6px;
  }

  .preferences select {
    font-size: 14px;
  }

  th,
  td {
    padding: 12px;
  }

  .result-top {
    gap: 8px;
  }

  .pagination {
    padding: 15px 12px;
  }

  .section-title {
    align-items: start;
  }

  .inverse-fields {
    grid-template-columns: 1fr;
  }

  .solved-list > div {
    flex-wrap: wrap;
  }

  .brand {
    white-space: nowrap;
  }

  .download-actions {
    flex-direction: column;
  }
}

/* ANIMATION */

@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background 0.15s ease;
  }
}


@media (prefers-reduced-motion: reduce) {
  body, .invicius-brand::before, .invicius-brand img, .calc-brand-mark, .calc-brand-mark i, .calc-brand-name, .header-menu-button, .header-menu-button>span:first-child, .header-chevron, .site-header { animation: none !important; }
}


/* =========================================================
   SHARED INVICIUS HEADER — exact home header on calculator
   The only calculator-specific addition is .calc-brand.
   ========================================================= */
.site-header {
  position: relative;
  z-index: 30;
  min-height: 116px;
  padding: 9px clamp(20px, 3.1vw, 54px);
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
  background:
    radial-gradient(circle at 18% 2%, rgba(255, 255, 255, 0.10), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(45, 151, 199, 0.10), transparent 34%),
    radial-gradient(circle at 48% 110%, rgba(44, 89, 140, 0.13), transparent 40%),
    linear-gradient(180deg, #101217 0%, #080a0f 48%, #020305 100%);
  background-size: 160% 160%, 170% 170%, 180% 180%, 220% 220%;
  animation: headerGlow 4.4s ease-in-out infinite alternate;
  box-shadow: 0 12px 36px rgba(0,0,0,.48), inset 0 -1px 0 rgba(255,255,255,.08);
}

.brand-link {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  min-width: 118px;
  height: 88px;
  margin: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  text-decoration: none;
}
.brand-link::before { content: none; }
.brand-link img {
  width: 100%; height: 100%; object-fit: contain; display: block; opacity: 1;
  animation: logoChromatic 6s ease-in-out infinite alternate;
  filter: saturate(1.16) brightness(1.06) drop-shadow(0 9px 16px rgba(12,27,104,.24));
}

/* Calculator identity is the only extra element in this header. */
.calc-brand { display:flex; align-items:center; gap:12px; min-width:0; flex:0 1 auto; }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}
.nav-cluster { display:flex; align-items:center; gap:24px; }
.menu-wrap { position:relative; }

.menu-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 136px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 21px;
  border: 1px solid rgba(107,255,232,.34);
  border-radius: 18px;
  background: linear-gradient(135deg,#52f2d6 0%,#25d7e8 26%,#248de4 58%,#385fe2 100%);
  background-size: 240% 240%;
  background-position: 0% 50%;
  animation: buttonFlow 6s ease-in-out infinite alternate;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(8,54,122,.16);
  font-family: "Rajdhani", "Segoe UI", ui-sans-serif, sans-serif;
  font-weight: 700;
  font-size: 1.04rem;
  letter-spacing: .005em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}
.menu-button > span:first-child,
.menu-button .chevron {
  color: transparent;
  background: linear-gradient(135deg,#010203 0%,#0b1016 28%,#18303d 55%,#070a0e 78%,#010203 100%);
  background-size: 240% 240%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: headerInkFlow 4.4s ease-in-out infinite alternate;
  text-shadow: none;
}
.menu-button > span:first-child { font-size:1em; font-weight:700; letter-spacing:-.01em; }
.menu-button:hover,.menu-button:focus-visible {
  transform: translateY(-3px);
  filter: brightness(1.10) saturate(1.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -1px 0 rgba(8,54,122,.18);
  outline: none;
}
.menu-button:active {
  transform: translateY(4px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -1px 0 rgba(8,54,122,.20);
}
.menu-button .chevron { font-size:13px; transition:transform 160ms ease; }
.menu-wrap.open .menu-button .chevron { transform:rotate(180deg); }

.menu-panel {
  position:absolute;
  top:calc(100% + 10px);
  left:0;
  min-width:250px;
  padding:9px;
  border:1px solid rgba(75,218,239,.38);
  border-radius:17px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.08), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(46,164,210,.08), transparent 30%),
    linear-gradient(160deg, rgba(18,21,27,.98), rgba(7,9,13,.99) 58%, rgba(1,2,4,.995));
  backdrop-filter:blur(18px);
  box-shadow:0 22px 50px rgba(0,0,0,.48), inset 0 1px 0 rgba(115,230,255,.10);
  opacity:0;
  visibility:hidden;
  transform:translateY(-7px);
  transition:opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}
.menu-wrap.open .menu-panel { opacity:1; visibility:visible; transform:translateY(0); }
.menu-panel a,.menu-panel button {
  width:100%; min-height:45px;
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  padding:10px 13px;
  color:transparent;
  text-decoration:none;
  text-align:start;
  border:0;
  border-radius:11px;
  background:linear-gradient(135deg,#7bffe8 0%,#3dd8ee 38%,#4ba7ff 72%,#7882ff 100%);
  -webkit-background-clip:text;
  background-clip:text;
  cursor:pointer;
  font-family:Inter,Arial,system-ui,sans-serif;
  font-size:15px;
  font-weight:700;
  line-height:1.25;
}
.menu-panel a:hover,.menu-panel a:focus-visible,.menu-panel button:hover,.menu-panel button:focus-visible {
  background-color:rgba(58,204,235,.10);
  outline:none;
}
.menu-panel small { color:#58dce9; -webkit-text-fill-color:#58dce9; }
.language-wrap { justify-self:end; }
.language-wrap .menu-panel { left:auto; right:0; width:280px; max-height:420px; overflow:auto; }
.language-option.active { background-color:rgba(84,215,255,.10); box-shadow:inset 0 0 0 1px rgba(91,228,239,.22); }

@media (max-width:1100px) {
  .site-header { flex-wrap:nowrap; }
  .header-actions { flex:0 1 auto; gap:12px; }
  .nav-cluster { gap:12px; }
}
@media (max-width:900px) {
  .site-header { min-height:auto; flex-wrap:wrap; gap:12px; padding:12px 14px 17px; }
  .brand-link { width:92px; min-width:92px; height:72px; margin:0; border-radius:0; }
  .calc-brand { gap:10px; }
  .calc-brand-mark { width:40px; height:40px; border-radius:12px; padding:8px; }
  .calc-brand-mark i { width:5px; }
  .calc-brand-mark i:nth-child(1){height:14px}.calc-brand-mark i:nth-child(2){height:24px}.calc-brand-mark i:nth-child(3){height:19px}
  .calc-brand-name { font-size:17px; white-space:normal; max-width:150px; }
  .header-actions { margin-left:auto; flex:1 1 520px; display:grid; grid-template-columns:minmax(0,2fr) minmax(150px,1fr); gap:8px; }
  .nav-cluster { display:grid; grid-template-columns:1fr; gap:8px; }
  .language-wrap { justify-self:stretch; }
  .language-wrap .menu-button { width:100%; }
  .language-wrap .menu-panel { right:0; left:0; width:auto; }
  .menu-button { min-width:0; width:100%; height:43px; border-radius:13px; padding:0 12px; }
  .menu-panel { min-width:220px; }
}
@media (max-width:520px) {
  .brand-link { width:80px; min-width:80px; height:64px; border-radius:0; }
  .nav-cluster { gap:6px; }
  .menu-button { font-size:13px; }
}
@media (prefers-reduced-motion:reduce) {
  .site-header,.brand-link img,.menu-button,.menu-button>span:first-child,.menu-button .chevron { animation:none !important; }
}

/* Consistent separation after Add loan. */
#down-payment-section{margin-top:28px;margin-bottom:28px;}

/* Payment phases belong to the main result card. */
.payment-periods{display:grid;gap:24px;margin-top:10px;}
.payment-period .hint{margin-bottom:6px;}
.result-periods{margin-top:24px;}
.result-top>div:first-child{min-width:0;flex:1;}
@media(max-width:600px){.payment-periods .payment{font-size:clamp(25px,7vw,38px);overflow-wrap:anywhere;}}

/* One guide, below the results, using the current page language. */
.calculator-guide .guide-content { padding-top: 1rem; }
.calculator-guide .guide-content section + section { margin-top: 1.5rem; }
.calculator-guide h3 { margin: 0 0 .65rem; font-size: 1.05rem; }
.calculator-guide p { margin: .65rem 0; line-height: 1.7; overflow-wrap: anywhere; }
