/* 07 · Công cụ tính lãi — 1680 × 900 (Figma 4019:3204) */
.tools { position: relative; height: 900px; background: #fff; color: #fff; }
.tools__bg { position: absolute; inset: 0; overflow: hidden; }
.tools__bg img { position: absolute; left: 0; top: -40px; width: 100%; height: calc(100% + 80px); object-fit: cover; max-width: none; }
/* Lớp tối góc trái dưới (radial gradient Figma) để chữ trắng dễ đọc */
.tools__bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 760px 340px at 201.5px 900px, rgba(40, 64, 54, .9) 0%, rgba(38, 63, 53, .7) 47.6%, rgba(31, 59, 47, 0) 100%);
}

/* Thẻ máy tính */
.calc {
  position: absolute; left: 50%; top: 50%; width: 400px; height: 640px; margin: -320px 0 0 -200px;
  background: rgba(0, 0, 0, .35); border-radius: 12px; overflow: hidden;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .5);
}
.calc__top { position: absolute; left: 24px; right: 24px; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.calc__head { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; }
.calc__head h2 { font-size: 24px; line-height: 1; font-weight: 700; }
.calc__head .arrow-badge { transition: transform .35s var(--ease-out-expo); }
.calc__head .arrow-badge:hover { transform: translateX(3px); }

/* Tabs: nền trắng trượt theo tab đang chọn; icon nét trung tính theo currentColor */
.calc__tabs { position: relative; display: flex; gap: 4px; padding: 4px; background: rgba(248, 250, 252, .05); border-radius: 12px; }
.calc__tab-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 16px) / 3); border-radius: 8px;
  background: #fff; box-shadow: 0 1px 3px rgba(10, 13, 18, .1), 0 1px 2px -1px rgba(10, 13, 18, .1);
  transform: translateX(calc(var(--tab, 0) * (100% + 4px)));
  transition: transform .55s cubic-bezier(.34, 1.25, .5, 1);
}
.calc__tab {
  position: relative; z-index: 1; flex: 1 0 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 8px; border-radius: 8px; color: #fff; font-weight: 600; font-size: 14px; line-height: 20px;
  transition: background .3s, color .35s;
}
.calc__tab-ic { width: 24px; height: 24px; flex-shrink: 0; color: rgba(255, 255, 255, .85); transition: color .35s; }
.calc__tab:hover:not(.is-active) { background: rgba(255, 255, 255, .08); }
.calc__tab.is-active { color: var(--c-text-secondary); }
.calc__tab.is-active .calc__tab-ic { color: var(--c-primary); animation: tab-pop .55s var(--ease-out-expo); }
@keyframes tab-pop { 0% { transform: scale(.7) rotate(-12deg); } 60% { transform: scale(1.12) rotate(4deg); } 100% { transform: none; } }

/* Vùng nội dung từng tab (chồng lên nhau, script.js điều khiển chuyển cảnh) */
.calc__panels { position: absolute; left: 24px; right: 24px; top: 140px; height: 432px; }
.calc-panel { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.calc-panel[hidden] { display: none; }
/* Độ dài cung vàng của gauge theo lãi suất (script.js set --gfill) */
.calc .gauge.is-in .gauge__fill { clip-path: inset(0 0 0 calc((1 - var(--gfill, 1)) * 100%)); transition: clip-path 1s var(--ease-out-expo); }

.calc__fields { display: flex; flex-direction: column; gap: 8px; }
.field {
  position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%;
  height: 48px; padding: 1px 16px; overflow: hidden; border-radius: 999px;
  background: rgba(255, 255, 255, .05); color: #fff; font-weight: 600; font-size: 12px; line-height: 16px;
  transition: background .3s;
}
.field:hover { background: rgba(255, 255, 255, .09); }
.field__label { position: relative; opacity: .6; white-space: nowrap; }
.field__value { position: relative; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.field__value img { width: 6.689px; height: 11.025px; }
.field--box { border-radius: 8px; flex: 1 0 0; }
.field--unit { flex: 0 0 141px; }
.calc__row { display: flex; gap: 8px; border-radius: 999px; overflow: hidden; }
.field[aria-expanded="true"] { background: rgba(255, 255, 255, .14); }

/* Menu chọn cho các ô select (script.js đặt vị trí theo nút đang mở) */
.calc-menu {
  position: absolute; z-index: 10; max-height: 240px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: rgba(24, 40, 34, .92); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .5);
}
.calc-menu[hidden] { display: none; }
.calc-menu__opt {
  padding: 8px 12px; border-radius: 8px; color: #fff; font-weight: 600; font-size: 12px; line-height: 16px;
  cursor: pointer; outline: none; transition: background .2s;
}
.calc-menu__opt:hover, .calc-menu__opt:focus { background: rgba(255, 255, 255, .1); }
.calc-menu__opt.is-active { color: var(--c-yellow); }

/* Thanh trượt: phần fill trắng mờ + tay nắm 4px */
.field__fill {
  position: absolute; left: 0; top: 0; height: 48px; width: 234px; padding: 6px;
  display: flex; justify-content: flex-end; border-radius: 99px 8px 8px 99px;
  background: rgba(255, 255, 255, .2); transition: width .25s var(--ease-out-expo);
}
.field__handle { width: 4px; height: 100%; background: #fff; border-radius: 12px; transition: transform .25s; }
.field--range:hover .field__handle { transform: scaleY(1.1); box-shadow: 0 0 12px rgba(255, 255, 255, .8); }
.field__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.field--range .field__value { font-variant-numeric: tabular-nums; }

.calc__submit {
  height: 40px; border-radius: 999px; background: var(--c-yellow); color: var(--c-primary);
  font-weight: 700; font-size: 14px; line-height: 24px; position: relative; overflow: hidden;
  transition: filter .2s, transform .2s;
}
.calc__submit:hover { filter: brightness(.96); }
.calc__submit:active { transform: scale(.98); }

.calc__result { display: flex; gap: 40px; align-items: flex-end; padding-left: 7px; }
.calc__rate { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 112px; }
.calc__rate p { font-weight: 700; font-size: 14px; line-height: 1; text-align: center; }
.calc__total { display: flex; flex-direction: column; gap: 14px; width: 196px; }
.calc__total-label { font-weight: 600; font-size: 14px; line-height: 1; color: rgba(255, 255, 255, .6); }
.calc__total-sub { margin-top: -6px; font-size: 12px; color: rgba(255, 255, 255, .65); white-space: nowrap; }
.calc__total-sub strong { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.calc__total-value { font-weight: 700; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc__total-value.is-flash { animation: total-flash .9s var(--ease-out-expo); }
@keyframes total-flash { 0% { color: var(--c-yellow); text-shadow: 0 0 18px rgba(252, 221, 8, .7); } 100% { color: #fff; text-shadow: none; } }
/* Figma: nền #f4f9f6 + chữ trắng (không đọc được) → dùng nền kính mờ để chữ hiển thị */
.calc__share {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px; border-radius: 999px;
  background: rgba(244, 249, 246, .16); color: #fff; font-size: 14px; letter-spacing: -0.28px;
  transition: background .3s;
}
.calc__share:hover { background: rgba(244, 249, 246, .28); }
.calc__share img { width: 16px; height: 16px; }

.calc__divider { position: absolute; left: 28px; top: 585px; width: 348px; height: 1px; max-width: none; }
.calc__note { position: absolute; left: 198px; top: 603px; width: 416px; transform: translateX(-50%); text-align: center; font-size: 12px; line-height: 1.5; letter-spacing: -0.24px; color: rgba(255, 255, 255, .5); }

/* ---------- Tiết kiệm ---------- */
.seg { display: flex; gap: 4px; height: 48px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .05); }
.seg__btn { flex: 1; border-radius: 999px; font-weight: 600; font-size: 12px; color: rgba(255, 255, 255, .7); transition: background .35s var(--ease-out-expo), color .3s; }
.seg__btn:hover:not(.is-active) { color: #fff; background: rgba(255, 255, 255, .06); }
.seg__btn.is-active { background: rgba(255, 255, 255, .2); color: #fff; }

.term { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 14px; border-radius: 20px; background: rgba(255, 255, 255, .05); }
.term__label { font-weight: 600; font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, .6); }
.term__chips { display: flex; gap: 6px; }
.chip-term {
  flex: 1; height: 32px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  font-weight: 700; font-size: 12px; color: #fff; background: rgba(255, 255, 255, .04);
  transition: background .3s, color .3s, border-color .3s, transform .35s var(--ease-out-expo);
}
.chip-term:hover:not(.is-active) { background: rgba(255, 255, 255, .12); }
.chip-term.is-active { background: var(--c-yellow); border-color: var(--c-yellow); color: var(--c-primary); transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(252, 221, 8, .7); }

/* ---------- Tỷ giá ---------- */
.fx-cur { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .05); }
.fx-cur__btn { flex: 1; height: 32px; border-radius: 999px; font-weight: 700; font-size: 12px; letter-spacing: .02em; color: rgba(255, 255, 255, .75); transition: background .35s var(--ease-out-expo), color .3s; }
.fx-cur__btn:hover:not(.is-active) { color: #fff; background: rgba(255, 255, 255, .08); }
.fx-cur__btn.is-active { background: #fff; color: var(--c-primary); }

.fx-convert { position: relative; display: flex; flex-direction: column; gap: 6px; }
.fx-field {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; height: 60px; padding: 0 64px 0 16px;
  border-radius: 16px; background: rgba(255, 255, 255, .05); transition: background .3s, box-shadow .3s;
}
.fx-field:focus-within { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(252, 221, 8, .6); }
.fx-field .field__label { font-weight: 600; font-size: 12px; line-height: 16px; }
.fx-field__input, .fx-field__out {
  width: 100%; border: 0; outline: 0; padding: 0; background: none; color: #fff;
  font: 700 20px/24px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx-field--out .fx-field__out { color: var(--c-yellow); }
.fx-swap {
  position: absolute; right: 14px; top: 50%; width: 36px; height: 36px; margin-top: -18px; z-index: 1;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--c-yellow); color: var(--c-primary); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5);
  transition: transform .5s var(--ease-out-expo);
}
.fx-swap:hover { transform: scale(1.08); }
.fx-swap.is-flipped { transform: rotate(180deg); }
.fx-swap.is-flipped:hover { transform: rotate(180deg) scale(1.08); }

.fx-table { padding: 6px 14px 8px; border-radius: 16px; background: rgba(255, 255, 255, .05); }
.fx-table__head, .fx-row { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; }
.fx-table__head { height: 26px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.fx-table__head span:not(:first-child), .fx-row span:not(:first-child) { text-align: right; }
.fx-row { height: 30px; margin: 0 -8px; padding: 0 8px; border-radius: 8px; font-size: 13px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .85); cursor: pointer; transition: background .3s, color .3s; }
.fx-row strong { font-weight: 700; }
.fx-row:hover { background: rgba(255, 255, 255, .06); }
.fx-row.is-active { background: rgba(252, 221, 8, .14); color: #fff; }
.fx-row.is-active strong { color: var(--c-yellow); }
.fx-note { font-size: 11px; line-height: 16px; text-align: center; color: rgba(255, 255, 255, .45); }

/* Gói vay gợi ý */
.tools__caption { position: absolute; left: 40px; top: 716px; width: 365px; font-size: 14px; line-height: 1.5; }
.promo {
  position: absolute; left: 40px; top: 747px; width: 383.5px; padding: 20px; overflow: hidden;
  display: flex; gap: 20px; align-items: flex-start;
  transition: background .35s, transform .45s var(--ease-out-expo);
}
.promo:hover { background: rgba(0, 0, 0, .38); transform: translateY(-3px); }
.promo__gauge { zoom: 0.7545; }
.promo__gauge .gauge__label { left: 31.1px; top: 79.5px; color: #fff; font-size: 13px; letter-spacing: -0.26px; }
.promo__text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.promo__text strong { font-size: 18px; line-height: 1.25; color: rgba(255, 255, 255, .96); }
.promo__text p { font-size: 14px; line-height: 1.5; }
.promo__arrow { position: absolute; left: 339.5px; top: 19.25px; transition: transform .4s var(--ease-out-expo); }
.promo:hover .promo__arrow { transform: translateX(3px); }
