/**
 * TG Home Loan Calculator Stylesheet
 * Custom designed layout with modern aesthetics.
 */

.tg-hlc-wrapper {
  box-sizing: border-box;
  width: 100%;
  font-family: "Google Sans", sans-serif;
  color: #003767;
  font-size: 14px;
  line-height: 1.5;
}

.tg-hlc-wrapper * {
  box-sizing: inherit;
}

.tg-hlc-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f1f1;
}

.tg-hlc-title {
  font-size: 20px;
  font-weight: 800;
  color: #003767; /* Theme blue */
  letter-spacing: -0.02em;
}

.tg-hlc-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
}

@media (max-width: 992px) {
  .tg-hlc-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.tg-hlc-form-group {
  margin-bottom: 1.8rem;
}

.tg-hlc-label-row {
  margin-bottom: 0.8rem;
}

.tg-hlc-label-row label,
.currency {
  font-size: 14px;
  font-weight: 600;
  color: #003767;
}

.tg-hlc-input-slider-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.tg-hlc-slider-wrap {
  flex-grow: 1;
}

.tg-hlc-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
  margin: 0;
  padding: 0;
}

.tg-hlc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 3px solid #003767;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.tg-hlc-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  border-color: #bf5427; /* Theme orange hover */
}

.tg-hlc-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 3px solid #003767;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.tg-hlc-range::-moz-range-thumb:hover {
  transform: scale(1.15);
  border-color: #bf5427;
}

.tg-hlc-number-wrap {
  position: relative;
  width: 110px;
  display: flex;
  align-items: center;
  height: 45px;
  border: 1px solid #eee;
  border-radius: 1rem;
  gap: 0.5rem;
  justify-content: center;
}

.tg-hlc-number {
  margin: 0;
  border: 0;
  padding: 0;
  font-size: 14px;
  line-height: 100%;
  font-weight: 600;
  color: #003767;
  text-align: right;
  border-radius: none;
  transition-property: border-color 0.2s ease;
  -moz-appearance: textfield;
}

.tg-hlc-number::-webkit-outer-spin-button,
.tg-hlc-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tg-hlc-number:focus {
  border-color: #003767;
}

.tg-hlc-unit {
  font-size: 14px;
  line-height: 100%;
  font-weight: 600;
  color: #003767;
  pointer-events: none;
}

.tg-hlc-input-double-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.tg-hlc-select-wrap {
  flex-grow: 1;
}

.tg-hlc-select {
  width: 100%;
  height: 48px;
  padding: 8px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #003767;
  outline: none;
  background: #ffffff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23003767' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>")
    no-repeat right 16px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.tg-hlc-select:focus {
  border-color: #003767;
}

.tg-hlc-radio-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.tg-hlc-radio-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #003767;
  user-select: none;
  padding-left: 36px;
}

.tg-hlc-radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.tg-hlc-radio-checkmark {
  position: absolute;
  left: 0;
  height: 24px;
  width: 24px;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  background-color: #ffffff;
  transition: border-color 0.2s ease;
}

.tg-hlc-radio-container:hover input ~ .tg-hlc-radio-checkmark {
  border-color: #003767;
}

.tg-hlc-radio-container input:checked ~ .tg-hlc-radio-checkmark {
  border-color: #003767;
  border-width: 7px;
}

.tg-hlc-btn-secondary {
  background: #ffffff;
  border: 2px solid #003767;
  color: #003767;
  height: 52px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.tg-hlc-btn-secondary:hover {
  background: #003767;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Results Column Styling */
.tg-hlc-results-box {
  background: #f4f6f9;
  border-radius: 20px;
  padding: 2.2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tg-hlc-result-heading {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  color: #003767;
  margin-top: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e5e9f0;
  padding-bottom: 0.8rem;
}

.tg-hlc-result-split {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 576px) {
  .tg-hlc-result-split {
    flex-direction: column;
    text-align: center;
  }
}

.tg-hlc-chart-wrap {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.tg-hlc-chart-container {
  position: relative;
  width: 170px;
  height: 170px;
}

.tg-hlc-donut {
  width: 100%;
  height: 100%;
}

.tg-hlc-donut-segment {
  transition:
    stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    stroke-dasharray 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.tg-hlc-chart-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 80%;
}

.tg-hlc-chart-total-value {
  font-size: 28px;
  font-weight: 800;
  color: #003767;
  line-height: 120%;
}

.tg-hlc-chart-total-unit {
  font-size: 14px;
  font-weight: 700;
  color: #003767;
  margin-top: 2px;
}

.tg-hlc-details-wrap {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.tg-hlc-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tg-hlc-detail-label {
  font-size: 14px;
  font-weight: 600;
  color: #003767;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-hlc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.bg-blue {
  background-color: #5d6cc7;
}
.bg-teal {
  background-color: #3db0bb;
}
.bg-pink {
  background-color: #e8617d;
}

.color-blue {
  color: #003767;
}
.color-teal {
  color: #003767;
}
.color-pink {
  color: #003767;
}

.tg-hlc-detail-value {
  font-size: 14px;
  font-weight: 700;
  padding-left: 20px;
}

.tg-hlc-divider {
  border: 0;
  border-top: 1px solid #e5e9f0;
  margin: 1.5rem 0;
}

.tg-hlc-monthly-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tg-hlc-monthly-label {
  font-size: 14px;
  font-weight: 600;
  color: #003767;
}

.tg-hlc-monthly-value {
  font-size: 14px;
  font-weight: 800;
  color: #003767;
}

.tg-hlc-actions {
  margin-top: auto;
}

.tg-hlc-btn-primary {
  background: linear-gradient(
    135deg,
    #f07328 0%,
    #f05a28 100%
  ); /* Orange gradient */
  color: #ffffff;
  border: none;
  height: 54px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(240, 90, 40, 0.2);
  outline: none;
}

.tg-hlc-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 90, 40, 0.35);
}

.tg-hlc-btn-primary:active {
  transform: translateY(0);
}

.tg-hlc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-hlc-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #003767;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tg-hlc-guide-link:hover {
  color: #003767;
  text-decoration: underline;
}

.tg-hlc-icon-doc {
  display: flex;
  align-items: center;
  color: #003767;
}

/* --- Financial Assessment Styles --- */
.tg-hlc-financial-assessment {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tg-hlc-assessment-title {
  font-size: 14px;
  font-weight: 700;
  color: #003767;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-hlc-assessment-icon {
  display: flex;
  align-items: center;
  color: #003767;
  font-weight: 800;
}

.tg-hlc-dti-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tg-hlc-dti-label {
  font-size: 14px;
  font-weight: 600;
  color: #003767;
}

.tg-hlc-dti-value {
  font-size: 14px;
  font-weight: 800;
  transition: color 0.3s ease;
}

.tg-hlc-progress-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tg-hlc-progress-track {
  width: 100%;
  height: 12px;
  background: #e5e9f0;
  border-radius: 6px;
  overflow: hidden;
}

.tg-hlc-progress-fill {
  height: 100%;
  border-radius: 6px;
  width: 0;
  transition:
    width 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.3s ease;
}

.tg-hlc-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: #003767;
}

/* Financial Capability Colors */
.bg-safe {
  background-color: #4fb80a;
}
.bg-moderate {
  background-color: #eb5830;
}
.bg-risky {
  background-color: #ad0b03;
}

.text-safe {
  color: #4fb80a;
}
.text-moderate {
  color: #eb5830;
}
.text-risky {
  color: #ad0b03;
}

/* Dynamic Warning Box */
.tg-hlc-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background-color: #fff0f2;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.5rem;
  color: #eb5830;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  animation: tg-hlc-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tg-hlc-warning-icon {
  display: flex;
  align-items: center;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Recommendation Box */
.tg-hlc-recommendation-box {
  background-color: #003767;
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.tg-hlc-recommend-label {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.tg-hlc-recommend-value {
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
}

/* --- Registration Modal Styles --- */
.tg-hlc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 55, 103, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.tg-hlc-modal-card {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 55, 103, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: tg-hlc-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 1.5rem;
}

.tg-hlc-modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: #f4f6f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
  color: #808080;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-hlc-modal-close-btn:hover {
  background: #e8617d;
  color: #ffffff;
}

.tg-hlc-modal-title {
  font-size: 14px;
  font-weight: 800;
  color: #003767;
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.tg-hlc-modal-desc {
  font-size: 14px;
  color: #003767;
  margin-top: 0;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.tg-hlc-modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.tg-hlc-modal-form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #003767;
}

.tg-hlc-modal-input {
  width: 100%;
  height: 48px;
  padding: 8px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #003767;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.tg-hlc-modal-input::placeholder {
  color: #b3b3b3;
}

.tg-hlc-modal-input:focus {
  border-color: #003767;
  box-shadow: 0 0 0 3px rgba(0, 55, 103, 0.1);
}

.tg-hlc-modal-input.has-error {
  border-color: #e8617d;
  background-color: #fffafb;
}

.tg-hlc-modal-input.has-error:focus {
  box-shadow: 0 0 0 3px rgba(232, 97, 125, 0.1);
}

.tg-hlc-error-msg {
  display: none;
  font-size: 14px;
  font-weight: 600;
  color: #e8617d;
  margin-top: 2px;
}

.tg-hlc-modal-input.has-error ~ .tg-hlc-error-msg {
  display: block;
}

.tg-hlc-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.tg-hlc-assessment-icon svg path {
  fill: #013767;
}
/* Animations */
@keyframes tg-hlc-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tg-hlc-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
