:root {
  /* Mono palette */
  --mono-1: #000000;
  --mono-2: #5e5c62;
  --mono-3: #aaaaaa;
  --mono-4: #e4e4e4;
  --mono-5: #f2f2f2;
  --mono-6: #fafafa;
  --mono-7: #ffffff;

  /* Brand */
  --brand-blue: #0066b3;
  --brand-orange: #f7941f;
  --brand-dark-orange: #f47920;
  --brand-light-orange: #fdb814;

  /* Addination color */
  --additional-error-color: #f42020;

  /* Gradients */
  --grad-deposit: linear-gradient(90deg, #f39423 0.14%, #ee511d 99.86%);
  --grad-rate: linear-gradient(90deg, #f39423 0.14%, #ee511d 99.86%);

  --grad-withdraw: linear-gradient(90deg, #f39423 0.14%, #ee511d 99.86%);
  --grad-tag-best: linear-gradient(90deg, #ff8000 0%, #ec4524 100%);
  --grad-plan: linear-gradient(180deg, #f4f4f4 0%, #ffffff 100%);

  /* Radius */
  --radius-15: 15px;
  --radius-5: 5px;

  /* Shadow (Drop Shadow 3) */
  --shadow-3: 0 5px 10px rgba(188, 188, 188, 0.5);

  /* Spacing */
  --sp-5: 5px;

  --sp-10: 10px;
  --sp-20: 20px;
  --sp-30: 30px;

  /* Type */
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--mono-1);
  background: var(--mono-7);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.calculator .vib-v2-wrapper_new {
  display: flex;
  flex-direction: column;
  /* gap: 30px; */
}

.card--inputs,
.card--inputs .slider,
.card--inputs .slider * {
  pointer-events: auto;
}

.card--inputs input[type="range"] {
  pointer-events: auto;
  cursor: pointer;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 48px 20px;
}

/* ============================================================
   SECTION
   ============================================================ */
.calculator {
  width: 100%;
  max-width: 1102px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-30);
  opacity: 0;
  transform: translateY(24px);
  animation: section-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  margin: 0 auto;
  margin-top: 80px;
}

@keyframes section-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calculator__title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--mono-1);
  margin-bottom: 30px;
}

.calculator__grid {
  display: grid;
  grid-template-columns: 415px 1fr;
  gap: var(--sp-20);
  align-items: start;
}

/* ============================================================
   CARD (shared)
   ============================================================ */
.results-wrapper {
  display: grid;
  grid-template-areas: "stack";
  width: 100%;
  align-items: start;
}

.card--empty,
.card--results {
  grid-area: stack;
  width: 100%;
  box-sizing: border-box;
  transition:
    opacity 0.3s ease-in-out,
    transform 0.3s ease-in-out,
    visibility 0.3s;
}

.card--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-20);
  min-height: 563px;
}

.card--empty:not(.is-hidden),
.card--results:not(.is-hidden) {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.card--empty.is-hidden,
.card--results.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.card--results.is-hidden {
  max-height: 560px;
}

.card--results:not(.is-hidden),
.card--empty:not(.is-hidden) {
  animation: cardFadeIn 0.35s ease-out forwards;
}

@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.card--empty {
  box-shadow:
    0 40px 60px 0 rgba(0, 0, 0, 0.05),
    0 15.407px 15.48px 0 rgba(0, 0, 0, 0.02),
    0 3.259px 6.519px 0 rgba(0, 0, 0, 0.01);
}

.empty-state__title {
  color: var(--Mono-Mono-1, var(--mono-1, #000));
  text-align: center;
  font-feature-settings:
    "liga" off,
    "clig" off;

  /* Title/Title 3 */
  font-family: var(--Font-name, Inter);
  font-size: var(--font-size-heading-title-title-3125-rem, 20px);
  font-style: normal;
  font-weight: var(--Font-weight-Semibold, 600);
  line-height: 120%; /* 24px */
  margin: 0;
}

.empty-state__desc {
  color: var(--mono-2, #5e5c62);
  text-align: center;
  font-feature-settings:
    "liga" off,
    "clig" off;
  /* Body 16/Regular */
  font-family: var(--Font-name, Inter);
  font-size: var(--font-size-base-body-161-rem, 16px);
  font-style: normal;
  font-weight: var(--Font-weight-Regular, 400);
  line-height: 160%; /* 25.6px */
  margin: 0;
  margin-top: 10px;
}

.card {
  position: relative;
  background: var(--mono-7);
  border-radius: var(--radius-15);
  opacity: 0;
  animation: card-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.card.card--results, .card.card--inputs {
  border: 1px solid var(--mono-4);
}

.card--inputs {
  padding: var(--sp-30);
  display: flex;
  flex-direction: column;
  gap: var(--sp-30);
  animation-delay: 0.08s;
  /* min-height: 583px; */
}

.card--results {
  /* padding-bottom: var(--sp-30); */
  display: flex;
  flex-direction: column;
  gap: var(--sp-30);
  animation-delay: 0.16s;
}

.card--results:not(.is-hidden) {
  padding-bottom: var(--sp-30);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* decorative corner accents on the inputs card */
.card__corner {
  position: absolute;
  left: -1px;
  width: 25px;
  height: 44px;
  pointer-events: none;
}
.card__corner--top {
  top: 20px;
}
.card__corner--bottom {
  top: -10px;
  left: -30px;
}

.card__block {
  display: flex;
  flex-direction: column;
  gap: var(--sp-20);
  position: relative;
}

.card__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--mono-1);
}

.card__footnote {
  margin: 0;
  padding: 0 var(--sp-30);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--mono-2);
  margin-top: auto;
}

/* ============================================================
   FIELD (label + value row)
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  margin-bottom: var(--sp-5);
}

.slider__track,
.slider__thumb,
.slider__fill {
  touch-action: pan-y; 
}

.field__label {
  color: var(--Mono-Mono-2, var(--mono-2, #5e5c62));
  font-feature-settings: "liga" off, "clig" off;
  font-size: var(--font-size-small-small-09-rem, 14px);
  font-weight: 400;
  line-height: 120%;
}

.field__input-wrap {
  position: relative;
  width: 149px;
  height: 40px;
  box-sizing: border-box;
  padding: 0 15px;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;

  border-right: 1px solid var(--mono-4);
  border-bottom: 1px solid var(--mono-4);
  border-bottom-right-radius: 19px;
  border-top: none;
  border-left: none;
  background: transparent;
  transition: border-color 0.25s ease-in-out;
  
  overflow: visible !important; 
}

.field__input-wrap:hover {
  border-right-color: var(--mono-3);
  border-bottom-color: var(--mono-3);
}

.field__input-wrap:focus-within {
  border-color: #aaaa;
}

.field__value {
  flex: 1 1 auto;
  width: 250px;
  margin-left: -150px;
  
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  padding: 0;

  text-align: right;
  color: var(--Mono-Mono-1, var(--Mono-Mono---1, #000));
  font-feature-settings: "liga" off, "clig" off;
  font-family: var(--Font-name, Inter);
  font-size: var(--font-size-base-body-161-rem, 16px);
  font-weight: 500;
  line-height: 160%;
}

.field__unit {
  flex: 0 0 auto;
  white-space: nowrap;
  pointer-events: none;
  color: var(--mono-1, #000);
  font-size: 16px;
  font-weight: 500;
}

.field__hint {
  margin: 0;
  padding: 0 var(--sp-20);
  color: var(--mono-2, #5e5c62);
  font-feature-settings: "liga" off, "clig" off;
  font-size: var(--font-size-small-small-09-rem, 14px);
  font-weight: 400;
  line-height: 120%;
  text-align: start;
}

/* ============================================================
   SLIDER
   ============================================================ */
.slider {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.slider__track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--mono-5);
  border-radius: 40px;
}

.slider__fill {
  position: absolute;
  left: 0;
  height: 4px;
  width: 0%;
  border-radius: 40px;
  background: var(--grad-deposit);
}
.slider__fill--rate {
  background: var(--grad-rate);
}
.slider__fill--withdraw {
  background: var(--grad-withdraw);
}

.slider__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 20px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.slider__input:focus {
  outline: none;
}
.slider__input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}
.slider__input::-moz-range-track {
  height: 4px;
  background: transparent;
}

.slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--mono-7);
  border: none;
  box-shadow: var(--shadow-3);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.slider__input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--mono-7);
  border: none;
  box-shadow: var(--shadow-3);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.slider__input:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 4px rgba(0, 102, 179, 0.25),
    var(--shadow-3);
}

.slider__scale {
  display: flex;
  justify-content: space-between;
  color: var(--Mono-Mono-2, var(--Mono-Mono---2, #5e5c62));
  font-feature-settings:
    "liga" off,
    "clig" off;

  font-size: var(--font-size-small-small-09-rem, 14px);
  font-style: normal;
  font-weight: var(--Font-weight-Regular, 400);
  line-height: 120%; /* 16.8px */
}

/* ============================================================
   DATEPICKER
   ============================================================ */
.field--dates {
  gap: var(--sp-5);
}

.field.field--dates .datepicker {
  background: var(--mono-6);
  border: 1px solid var(--mono-5);
  border-radius: var(--radius-15);
  padding: 10px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-20);
  min-height: 70px;
  align-items: center;
}

.datepicker__input {
  min-width: 95px !important;
}

.datepicker__col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.input-group-addon {
  display: flex;
  padding: 0 !important;
  width: 0;
}

.datepicker__label {
  color: var(--mono-2, #5e5c62);
  font-feature-settings:
    "liga" off,
    "clig" off;

  font-size: var(--font-size-small-small-09-rem, 16px);
  font-style: normal;
  font-weight: var(--Font-weight-Regular, 400);
  line-height: 120%; /* 16.8px */
  transition:
    font-size 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.datepicker__col.has-value .datepicker__label {
  font-size: 14px;
}

.datepicker__control {
  display: flex;
  align-items: center;
  gap: 3px;
}

.datepicker__header {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

/* Đã mở picker (is-picking), đã có ngày (has-value) hoặc cột đang disabled:
   header chỉ còn là nhãn, không mở picker nữa -> con trỏ về default.
   Thao tác qua input + icon lịch. */
.datepicker__col.is-picking .datepicker__header,
.datepicker__col.has-value .datepicker__header,
.datepicker__col.is-disabled .datepicker__header {
  cursor: default;
}

.datepicker__trigger-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.datepicker__trigger-btn:disabled {
  cursor: not-allowed;
}

.datepicker__col.is-disabled .datepicker__trigger-btn {
  pointer-events: none;
}

.datepicker__input {
  font-family: var(--Font-name, Inter);

  color: var(--Mono-Mono---1, #000);
  font-feature-settings:
    "liga" off,
    "clig" off;

  font-size: var(--font-size-base-body-161-rem, 16px);
  font-style: normal;
  font-weight: var(--Font-weight-Regular, 400);
  line-height: 160%; /* 25.6px */
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  min-width: 0;
}
.datepicker__input:focus {
  outline: none;
}
.datepicker__input::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.datepicker__icon {
  width: 24px;
  height: 24px;
  flex: none;
  cursor: pointer;
}

/* ============================================================
   BANNER (recommendation)
   ============================================================ */
.banner {
  position: relative;
  height: 115px;
  border-radius: var(--radius-15);
  overflow: hidden;
  background: url("/static/vay-cam-co-tinh/assets/banner-bg.png") center / cover
    no-repeat;
  /* box-shadow: var(--shadow-3); */
  animation: banner-glow 3.5s ease-in-out infinite;
}

.banner__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  text-align: center;
  color: var(--mono-7);
  padding: 0 var(--sp-20);
}

.banner__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.banner__subtitle {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}
.banner__subtitle strong {
  font-weight: 600;
}

/* ============================================================
   COMPARE / PLAN CARDS
   ============================================================ */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-20);
  padding: 0 var(--sp-30);
}

.plan {
  position: relative;
  background: var(--grad-plan);
  border-radius: var(--radius-15);
  padding: 57px 20px 0px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-30);
}

.plan__tag {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 25px 10px 20px;
  border-top-left-radius: var(--radius-15);
  border-bottom-right-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.plan__tag--best {
  background: var(--grad-tag-best);
  color: var(--mono-7);
}
.plan__tag--consider {
  background: var(--mono-4);
  color: var(--mono-1);
}

.plan__name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--mono-1);
}

.plan__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-20);
}

.plan__row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}
.plan__row--toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  cursor: pointer;
  align-items: flex-start;
  position: relative;
  padding-right: 24px;
}

.plan__label {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--mono-2);
}

.plan__amount {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--mono-1);
  /* font-variant-numeric: tabular-nums; */
}

.plan__chevron {
  position: absolute;
  top: -1px;
  right: -25px;
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
  transform: rotate(-90deg);
  background-color: var(--mono-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M14.4108 6.91074C14.7362 6.58531 15.2638 6.58531 15.5893 6.91074C15.9147 7.23618 15.9147 7.76382 15.5893 8.08925L10.5893 13.0893C10.2738 13.4047 9.76579 13.4158 9.4369 13.1143L4.4369 8.53096C4.09764 8.21997 4.07472 7.69283 4.38571 7.35356C4.6967 7.0143 5.22384 6.99138 5.56311 7.30237L9.97494 11.3466L14.4108 6.91074Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M14.4108 6.91074C14.7362 6.58531 15.2638 6.58531 15.5893 6.91074C15.9147 7.23618 15.9147 7.76382 15.5893 8.08925L10.5893 13.0893C10.2738 13.4047 9.76579 13.4158 9.4369 13.1143L4.4369 8.53096C4.09764 8.21997 4.07472 7.69283 4.38571 7.35356C4.6967 7.0143 5.22384 6.99138 5.56311 7.30237L9.97494 11.3466L14.4108 6.91074Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.expand-label {
  position: relative;
  display: flex;
  align-items: center;
}

.plan__row--toggle[aria-expanded="true"] .plan__chevron {
  transform: rotate(0deg);
}

.plan__detail {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.5s ease-in-out,
    margin-top 0.5s ease-in-out,
    opacity 0.25s ease-in-out;
  margin-top: 0;
}

.plan__detail[hidden] {
  display: grid !important;
  grid-template-rows: 0fr;
  margin-top: -40px !important;
}

.plan__detail-inner {
  overflow: hidden;
  min-height: 0;

  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--mono-2);
  padding: 15px 20px;
  background: var(--mono-6);
  border: 1px solid var(--mono-5, #f2f2f2);
  background: var(--mono-7);
  border-radius: 15px;
  transition:
    opacity 0.55s ease,
    visibility 0.55s,
    padding 0.5s ease;
  opacity: 1;
  visibility: visible;
}

.plan__detail[hidden] .plan__detail-inner {
  opacity: 0;
  visibility: hidden;
  padding: 9px;
}
.plan__detail p {
  margin: 0;
}

.plan__detail-label {
  color: var(--mono-2, #5e5c62);
  font-feature-settings:
    "liga" off,
    "clig" off;

  font-size: var(--font-size-small-small-09-rem, 14px);
  font-style: normal;
  font-weight: var(--Font-weight-Regular, 400);
  line-height: 120%; /* 16.8px */
}

.plan__detail span.plan__detail-value {
  color: var(--mono-1);
  font-weight: 500;
  font-size: var(--font-size-base-body-161-rem, 16px);
  line-height: 26px;
}

.plan__detail-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

@keyframes detail-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.plan__divider {
  border: none;
  border-top: 1px solid var(--mono-4);
  margin: 0;
}

.plan__row--total {
  gap: 5px;
}

.plan__total {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--brand-blue);
  /* font-variant-numeric: tabular-nums; */
}

.plan__cta,
.plan__cta_result {
  position: relative;
  align-self: flex-start;
  min-width: 125px;
  height: 48px;
  padding: 10px var(--sp-30);
  border: none;
  border-radius: var(--radius-5, 5px);
  background: var(--brand-light-orange);
  color: var(--mono-1);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  z-index: 1;
  text-decoration: none;
  transition:
    background-color 0.5s ease,
    color 0.5s ease;
}

.plan__cta::before,
.plan__cta_result:before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--mono-1);
  border-radius: var(--radius-5, 5px);
  opacity: 0;
  z-index: -1;
  transition:
    background-color 0.5s ease,
    color 0.5s ease;
}

.plan__cta_result {
  display: none;
}

/* ============================================================
   VALUE CHANGE PULSE (applied by JS)
   ============================================================ */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================================
   HOVER STATES
   ============================================================ */
@media (hover: hover) {
  input[type="range"]::-webkit-slider-thumb:hover {
    border: 1px solid var(--Banner-Fire-Right, #f39423);
    cursor: pointer;
    box-shadow: var(--shadow-3);
  }

  input[type="range"]::-moz-range-thumb:hover {
    border: 1px solid var(--Banner-Fire-Right, #f39423);
    cursor: pointer;
    box-shadow: var(--shadow-3);
  }

  .field.field--dates .datepicker:hover {
    background: var(--mono-7);
    border: 1px solid var(--mono-3);
  }

  .plan__cta:hover,
  .plan__cta_result:hover {
    color: var(--bg-color-mono-7);
    background-color: var(--mono-1);
  }
}
