@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/bricolage-grotesque.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url("assets/montserrat.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  font-family: "Bricolage Grotesque", Arial, sans-serif;
  color: #000;
  background: #0d83ba;
  --blue: #0089c9;
  --field: #efefef;
  --error: #a6323e;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, p, dl, dd, fieldset, ul { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }

.app {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding: 24px 16px 28px;
}

.background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  background: #0d83ba;
  pointer-events: none;
}
.background-image {
  position: absolute;
  inset: -39px auto auto 0;
  width: max(488px, 135.56%);
  height: max(863px, calc(100% + 78px));
  transform: scaleX(-1);
  filter: brightness(.74);
}
.background-blur {
  position: absolute;
  inset: 0;
  background: rgb(255 255 255 / 1%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.coin { position: absolute; object-fit: cover; display: none; }
[data-screen="calculator"] .coin { display: block; }
.coin-left { width: 122px; height: 111px; left: -44px; top: -29px; transform: rotate(180deg); }
.coin-right { width: 154px; height: 152px; right: -107px; top: 235px; filter: blur(2px); }

.brand, h1, .offers > p { color: #fff; text-align: center; }
.brand { font-weight: 700; font-size: 20px; line-height: 24px; }
.screen { margin-top: 40px; }
.screen h1 { font-weight: 700; font-size: 24px; line-height: 29px; }
.calculator, .application { margin-top: 16px; }
.calculator { display: grid; gap: 1px; }
.panel { background: #fff; border-radius: 20px; }
.loan-control, .loan-summary, .application { padding: 20px; }
.amount-control { border-radius: 20px 20px 0 0; }
.period-control { border-radius: 0; }
.loan-summary { border-radius: 0 0 20px 20px; }
.loan-label { display: block; font-size: 14px; line-height: 17px; }
.loan-value {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .22em;
  height: 60px;
  margin-top: 8px;
  border-radius: 12px;
  background: var(--field);
  font-size: 24px;
  line-height: 29px;
  font-weight: 700;
}
.loan-value input {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  width: calc(var(--characters, 6) * .6em);
  min-width: .7em;
  text-align: end;
  field-sizing: content;
}
@supports (field-sizing: content) {
  .loan-value input { width: auto; }
}
.slider {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: calc(100% - 12px);
  height: 28px;
  margin: -14px 6px 0;
  position: relative;
  background: transparent;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 4px;
  margin-inline: 0;
  border-radius: 2px;
  background: linear-gradient(to right, var(--blue) var(--fill, 0%), #dcdcdc var(--fill, 0%));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 8px solid var(--blue);
  background: #fff;
  margin-top: -12px;
}
.slider::-moz-range-track { height: 4px; background: #dcdcdc; }
.slider::-moz-range-progress { height: 4px; background: var(--blue); }
.slider::-moz-range-thumb { width: 12px; height: 12px; border: 8px solid var(--blue); border-radius: 50%; background: #fff; }
.limits { display: flex; justify-content: space-between; padding-inline: 20px; font-size: 12px; line-height: 14px; font-weight: 500; }
.summary, .gender, .offer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.summary > div { padding: 8px min(6vw, 20px); background: var(--field); border-radius: 8px; font-size: 14px; line-height: 17px; }
.summary dd, .offer dd { margin-top: 2px; font-weight: 700; }
.loan-estimate { margin-top: 8px; color: #525252; font-size: 12px; line-height: 16px; }
.primary {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgb(0 137 201 / 60%);
  font-weight: 700;
  font-size: 18px;
  line-height: 22px;
}
.loan-summary > .primary, .consent { margin-top: 16px; }
.consent { display: flex; align-items: flex-start; gap: 8px; min-height: 42px; font: 500 10px/14px Montserrat, Arial, sans-serif; }
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  padding: 0;
  margin: 0;
  border: 1px solid #dcdcdc;
  background: #fff;
  cursor: pointer;
}
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked, input[type="radio"]:checked {
  border-color: var(--blue);
  background: var(--blue) url("assets/tick.svg") center no-repeat;
}

.application { display: grid; gap: 16px; }
.field { min-width: 0; padding: 0; border: 0; }
.field > label, .field legend { display: block; padding: 0; font-size: 12px; line-height: 14px; }
.field-box, .gender { margin-top: 8px; }
.field-box {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 56px;
  border-radius: 12px;
  background: var(--field);
  font-size: 18px;
  line-height: 22px;
}
.field-box > input:not([type="radio"]) { width: 100%; min-width: 0; height: 100%; padding: 0 20px; border: 0; color: inherit; background: transparent; border-radius: inherit; }
.field-box > input::placeholder { color: rgb(0 0 0 / 50%); opacity: 1; }
.phone-field { padding: 0 20px; gap: 8px; }
.phone-field > input:not([type="radio"]) { flex: 1; padding: 0; }
.gender .field-box { gap: 8px; margin-top: 0; padding-inline: min(5vw, 20px); cursor: pointer; }
.phone-note { text-align: center; font-size: 14px; line-height: 17px; }
.hint { margin: 4px 0 0; color: var(--error); font-size: 12px; line-height: 16px; }
.field-box:has([aria-invalid="true"]), .loan-value:has([aria-invalid="true"]) { background: #fff0f0; box-shadow: inset 0 0 0 1px #e8a1a7; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.screen h1:focus { outline: none; }

.processing { margin-top: 196.5px; color: #fff; }
.progress { position: relative; width: 246px; height: 135px; margin-inline: auto; }
.progress h1 { position: absolute; inset: 92px 0 auto; font-size: 54px; line-height: 65px; }
.status { display: grid; gap: 16px; padding: 0 20px; list-style: none; margin-top: 40px; }
.status li { display: flex; gap: 8px; min-height: 24px; align-items: center; justify-content: space-between; font-size: 14px; line-height: 17px; }
.status-icon { display: grid; flex: 0 0 24px; }
.status-icon > img { grid-area: 1 / 1; transition: opacity .2s ease; }
.status-icon .spinner { animation: spin 1s linear infinite; }
.status-icon .checkmark { opacity: 0; }
.status-icon.is-complete .spinner { opacity: 0; }
.status-icon.is-complete .checkmark { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .status-icon .spinner { animation: none; }
  .status-icon > img { transition: none; }
}

.offers { margin-top: 20px; }
.offers h1 { font-size: 20px; line-height: 24px; }
.offers > p { margin-top: 8px; font-size: 14px; line-height: 17px; }
.offer-grid { margin-top: 16px; }
.offer { min-width: 0; padding: 10px; }
.offer-logo { display: block; max-width: 100%; margin-inline: auto; object-fit: contain; }
.offer dl { display: grid; gap: 4px; margin-block: 8px; font-size: 12px; line-height: 14px; }
.offer dl > div { padding: 4px 12px; border-radius: 8px; background: var(--field); }
.offer .primary { min-height: 40px; font-size: 14px; line-height: 17px; border-radius: 8px; }
.offer .primary[aria-pressed="true"] { background: #005f8d; }

@media (max-width: 350px) {
  .app { padding-inline: 12px; }
  .loan-control, .loan-summary, .application { padding-inline: 16px; }
  .summary > div { padding-inline: 10px; }
  .offer dl > div { padding-inline: 8px; }
}
