/* Emi Calculator */

:root {
  --emi-red: #f50810;
  --emi-red-dark: #dc060d;
  --emi-ink: #1b1b1b;
  --emi-muted: #555;
  --emi-border: #b9b9b9;
  --emi-card-bg: #ffffff;
  --emi-result-bg: #eeeeef;
  --font-google: Google Sans;
}

body {
  font-family: "Google Sans", sans-serif;
}

.font-google {
  font-family: var(--font-google);
}

.emi-section {
  padding: 56px 0 64px;
  color: var(--emi-ink);
}

.emi-wrap {
  max-width: 1250px;
  margin: 0 auto;
  padding: 20px 20px;
}

/* ---------- Heading ---------- */
.emi-title {
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.1;
}

/* ---------- Layout ---------- */
.emi-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

/* ---------- Left card ---------- */
.emi-card {
  background: var(--emi-card-bg);
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  padding: 30px 32px 34px;
}

.emi-card h2,
.emi-result h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 24px;
}

.emi-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 15px;
}

.emi-row.top {
  align-items: start;
}

.emi-row > label,
.emi-row > .emi-label {
  font-weight: 600;
  font-size: 1.05rem;
  font-family: var(--font-google);
}

.emi-row.top > .emi-label {
  padding-top: 12px;
  font-family: var(--font-google);
}

/* inputs + selects */
.emi-field,
.emi-select {
  width: 100%;
  height: 38px;
  padding: 0 16px;
  font-size: 1.05rem;
  color: var(--emi-ink);
  background: #fff;
  border: 1px solid var(--emi-border);
  border-radius: 5px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: var(--font-google);
}

.emi-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M4 7l6 6 6-6' fill='none' stroke='%23111' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  text-overflow: ellipsis;
}

.emi-field:focus,
.emi-select:focus {
  border-color: var(--emi-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.15);
}

.emi-field[readonly] {
  background: #e9e9ea;
  border-color: #d4d4d4;
  cursor: not-allowed;
}

.emi-field::-webkit-outer-spin-button,
.emi-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.emi-field[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* slider */
.emi-range {
  --fill: 20%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  margin: 22px 0 8px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--emi-red) var(--fill),
    #dcdcdc var(--fill)
  );
}

.emi-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--emi-red);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.emi-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--emi-red);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.emi-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--emi-muted);
}

/* tenure segmented buttons */
.emi-seg {
  display: flex;
  border: 1px solid var(--emi-border);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}

.emi-seg button {
  flex: 1;
  height: 38px;
  padding: 0 6px;
  border: 0;
  border-right: 1px solid var(--emi-border);
  background: #fff;
  font-size: 14px;
  color: var(--emi-ink);
  cursor: pointer;
  font-family: var(--font-google);
  transition:
    background 0.2s,
    color 0.2s;
  white-space: nowrap;
}

.emi-seg button:last-child {
  border-right: 0;
}

.emi-seg button:hover {
  background: #f3f3f3;
}

.emi-seg button.active {
  background: var(--emi-red);
  color: #fff;
  font-weight: 600;
}

/* ---------- Right result card ---------- */
.emi-result {
  background: var(--emi-result-bg);
  border-radius: 10px;
  padding: 30px 32px 28px;
  display: flex;
  flex-direction: column;
}

.emi-amount {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.emi-amount strong {
  font-size: clamp(2.6rem, 5vw, 4.3rem);
  font-weight: 800;
  color: var(--emi-red);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.emi-amount span {
  font-size: 1.5rem;
  color: var(--emi-muted);
}

.emi-lines {
  border-top: 1px solid #c4c4c6;
  margin-bottom: 30px;
}

.emi-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  border-bottom: 1px solid #c4c4c6;
  font-size: 1.15rem;
}

.emi-line b {
  font-size: 1.3rem;
  font-weight: 800;
}

.emi-quote {
  display: block;
  width: 100% 496px;
  text-align: center;
  text-decoration: none;
  background: var(--emi-red);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 5px;
  transition:
    background 0.2s,
    transform 0.2s;
  margin-top: auto;
}

.emi-quote:hover {
  background: var(--emi-red-dark);
  color: #fff;
  transform: translateY(-1px);
}

.emi-note {
  font-size: 0.95rem;
  color: #444;
  margin: 18px 0 0;
}

/* ---------- Leasing options row ---------- */
.emi-lease {
  margin-top: 30px;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
}

.emi-lease summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 28px;
  cursor: pointer;
}

.emi-lease summary::-webkit-details-marker {
  display: none;
}

.emi-lease summary h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  padding-right: 22px;
  border-right: 1px solid #ccc;
}

.emi-lease summary span {
  flex: 1;
  font-size: 18px;
  color: #444;
}

.emi-lease summary svg {
  width: 22px;
  height: 22px;
  transition: transform 0.25s;
}

.emi-lease[open] summary svg {
  transform: rotate(90deg);
}

.emi-lease-body {
  padding: 0 28px 24px;
  color: #444;
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .emi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .emi-card,
  .emi-result {
    padding: 22px 18px;
  }

  .emi-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .emi-row.top > .emi-label {
    padding-top: 0;
  }

  .emi-seg {
    flex-wrap: wrap;
  }

  .emi-seg button {
    flex: 1 1 50%;
    border-bottom: 1px solid var(--emi-border);
  }

  .emi-line {
    font-size: 1rem;
  }

  .emi-line b {
    font-size: 1.1rem;
  }

  .emi-quote {
    font-size: 1.2rem;
  }

  .emi-lease summary {
    flex-wrap: wrap;
    gap: 8px;
    padding: 18px;
  }

  .emi-lease summary h3 {
    border-right: 0;
    padding-right: 0;
    font-size: 1.3rem;
    flex: 1 0 100%;
  }

  .emi-lease summary span {
    font-size: 1rem;
  }
}
