/* =====================================
   BASE RESET
===================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}
.dp-error {
  color: #d32f2f;
  font-size: 13px;
  margin-top: 6px;
}

/* =====================================
   CALCULATOR CONTAINER
===================================== */
.mlc-box {
  max-width: 900px;
  margin: auto;
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  font-family: Inter, Arial, sans-serif;
}

.mlc-box h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
}

.subtitle {
  font-size: 15px;
  color: #666;
  margin-bottom: 25px;
}

/* =====================================
   FORM GRID
===================================== */
.mlc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mlc-grid label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  display: block;
}

/* =====================================
   INPUTS
===================================== */
.mlc-box input,
.mlc-box select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
}

.mlc-box input:focus,
.mlc-box select:focus {
  outline: none;
  border-color: #e11d2e;
}

/* Range slider */
.mlc-box input[type=range] {
  padding: 0;
  margin-top: 8px;
}

/* Readonly DP amount */
#dpAmount {
  margin-top: 8px;
  background: #f7f7f7;
  font-weight: 600;
}

/* =====================================
   ACTION BUTTONS
===================================== */
.actions {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.actions button {
  flex: 1;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: 0.2s ease;
}

#calculate {
  background: #e11d2e;
  color: #fff;
}

#calculate:hover {
  background: #c91625;
}

#reset {
  background: #d1d5db;
}

#reset:hover {
  background: #bfc3c9;
}

/* ==========================
   TENURE RADIO BOXES
========================== */
.tenure-box {
  cursor: pointer;
  padding: 18px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  text-align: center;
  transition: 0.2s ease;
  background: #fff;
}

.tenure-box:hover {
  border-color: #9ca3af;
}

.tenure-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.tenure-value {
  font-size: 16px;
  font-weight: 700;
  color: #9ca3af;
}

/* Selected (Radio Active) */
.tenure-box.active {
  border-color: #e11d2e;
  background: #fff5f5;
}

.tenure-box.active .tenure-value {
  color: #111827;
}


/* =====================================
   RESULTS TABLE (DESKTOP)
===================================== */
.mlc-table {
  width: 100%;
  margin-top: 30px;
  border-collapse: collapse;
  text-align: center;
}

.mlc-table th {
  background: #111827;
  color: #ffffff;
  padding: 14px;
  font-size: 15px;
}

.mlc-table td {
  padding: 18px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
}

.mlc-table td span {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

/* =====================================
   TABLET RESPONSIVE (≤1024px)
===================================== */
@media (max-width: 1024px) {

  .mlc-box {
    padding: 25px;
  }

  .mlc-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    margin-top: 10px;
  }
}

/* =====================================
   MOBILE RESPONSIVE (≤768px)
===================================== */
@media (max-width: 768px) {

  .mlc-box {
    padding: 20px;
    border-radius: 10px;
  }

  .mlc-box h2 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 14px;
  }

  .mlc-grid {
    gap: 16px;
  }

  .mlc-box input,
  .mlc-box select {
    font-size: 14px;
    padding: 12px;
  }

  /* Convert table to card layout */
  .mlc-table thead {
    display: none;
  }

  .mlc-table,
  .mlc-table tbody,
  .mlc-table tr,
  .mlc-table td {
    display: block;
    width: 100%;
  }

  .mlc-table tr {
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
  }

  .mlc-table td {
    border: none;
    padding: 10px 0;
    text-align: left;
    font-size: 14px;
  }

  .mlc-table td span {
    float: right;
    font-size: 15px;
  }
}

/* =====================================
   SMALL MOBILE (≤480px)
===================================== */
@media (max-width: 480px) {

  .mlc-box {
    padding: 15px;
  }

  .mlc-box h2 {
    font-size: 18px;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }
}
