:root {
  --navy: #100d3e;
  --orange: #f8a014;
  --text: #050505;
  --muted: #9d9d9d;
  --field: #f2f2f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  background: #efefef;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100vw, 414px);
  min-height: 100vh;
  background: #fff;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 28px;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.16);
}

.hero {
  min-height: 232px;
  padding: 54px 22px 42px;
  color: #fff;
  background: var(--navy);
  position: relative;
}

.hero h1 {
  max-width: 360px;
  margin: 0 0 24px;
  font-size: clamp(31px, 8.1vw, 38px);
  line-height: 1.16;
  font-weight: 800;
  white-space: normal;
}

.rates {
  position: relative;
  z-index: 1;
}

.rates h2 {
  margin: 0 0 15px;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
}

.rates p {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.22;
}

.rupee-mark {
  position: absolute;
  right: 52px;
  top: 95px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 92px;
  line-height: 1;
  font-weight: 900;
}

.panel {
  width: calc(100% - 34px);
  margin-inline: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
}

.loan-picker {
  margin-top: -24px;
  padding: 25px 18px 22px;
  position: relative;
  z-index: 2;
}

.loan-picker h2 {
  margin: 0 0 22px;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 800;
}

.loan-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  align-items: start;
}

.loan-type {
  border: 0;
  padding: 5px 2px;
  border-radius: 12px;
  background: transparent;
  color: #5d5d5d;
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: 15px;
  line-height: 1.12;
  cursor: pointer;
}

.loan-type.active {
  color: #111;
  background: #f7f7f7;
}

.loan-type.active .type-icon {
  outline: 3px solid rgba(248, 160, 20, 0.24);
}

.type-icon {
  width: 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
}

.loan-type.accent .type-icon {
  background: var(--orange);
}

.type-icon svg {
  width: 27px;
  height: 27px;
  fill: #fff;
}

.calculator {
  margin-top: 18px;
  padding: 26px 18px 26px;
  border-radius: 17px 17px 0 0;
  box-shadow: 0 -1px 16px rgba(0, 0, 0, 0.13);
}

.calculator-heading {
  display: grid;
  grid-template-columns: 1fr 2.1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 23px;
}

.calculator-heading h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.14;
  font-weight: 800;
}

.calculator-heading p {
  margin: 2px 0 0;
  color: #a6a6a6;
  font-size: 15px;
  line-height: 1.25;
}

form {
  display: grid;
  gap: 15px;
}

input {
  width: 100%;
  height: 55px;
  border: 1px solid #d9d9d9;
  border-radius: 16px;
  background: var(--field);
  color: #555;
  padding: 0 14px;
  font-size: 21px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

input::placeholder {
  color: #565656;
  opacity: 1;
}

input:focus {
  border-color: #19beb6;
  box-shadow: inset 4px 0 0 #19beb6;
}

.calculate,
.clear {
  width: 100%;
  height: 57px;
  border: 0;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.calculate {
  margin-top: 6px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 4px 8px rgba(248, 160, 20, 0.25);
}

.clear {
  color: #555;
  background: #ededed;
}

.result {
  display: block;
  margin-top: 22px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff5df 0%, #ffffff 72%);
  border: 1px solid rgba(248, 160, 20, 0.28);
  color: #333;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(16, 13, 62, 0.12);
  scroll-margin-top: 22px;
}

.result-grid {
  display: grid;
  gap: 11px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6a6a6a;
  font-size: 14px;
  padding-top: 10px;
  border-top: 1px solid #ececec;
  min-width: 0;
}

.result-row strong {
  color: var(--navy);
  font-size: 16px;
  text-align: right;
  overflow-wrap: anywhere;
}

.result-row.primary {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 4px 0 13px;
  border-top: 0;
  color: #111;
  font-size: 16px;
  text-align: center;
}

.result-row.primary strong {
  color: var(--orange);
  width: 100%;
  padding: 10px 8px;
  border-radius: 14px;
  background: #fff;
  font-size: clamp(28px, 8.5vw, 36px);
  line-height: 1.1;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(248, 160, 20, 0.16);
}

.result-title {
  color: var(--navy);
  font-size: 16px;
  font-weight: 800;
}

.result-note {
  margin: 0;
  color: #858585;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 360px) {
  .hero {
    padding-inline: 18px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .loan-type,
  .calculator-heading p {
    font-size: 14px;
  }

  input {
    font-size: 19px;
  }

  .result-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .result-row strong {
    text-align: left;
  }
}
