/* PointZaim — application form & personal cabinet */
:root {
  --pz-violet: #6C4CF1;
  --pz-violet-600: #5B3BDB;
  --pz-violet-light: #EEEBFF;
  --pz-mint: #22D3A6;
  --pz-mint-600: #12B98D;
  --pz-mint-light: #D8FBF1;
  --pz-ink: #14162B;
  --pz-ink-2: #241C63;
  --pz-muted: #5C6178;
  --pz-line: #E6E6F2;
  --pz-bg: #F5F5FB;
  --pz-white: #FFFFFF;
  --pz-danger: #F04438;
  --pz-radius: 16px;
  --pz-shadow: 0 18px 40px -24px rgba(21, 16, 56, .35);
}

* { box-sizing: border-box; }

body.pz-app {
  margin: 0;
  min-height: 100vh;
  background: var(--pz-bg);
  color: var(--pz-ink);
  font-family: Manrope, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.pz-app a:not(.pz-btn) { color: inherit; text-decoration: none; }

/* ---------------- header ---------------- */
.pz-top {
  background: var(--pz-white);
  border-bottom: 1px solid var(--pz-line);
}
.pz-top__in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.pz-top__logo { display: flex; align-items: center; gap: 10px; }
.pz-top__logo img { width: 34px; height: 34px; }
.pz-top__logo b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.pz-top__logo b span { color: var(--pz-ink-2); }
.pz-top__spacer { flex: 1; }
.pz-top__phone {
  font-weight: 700;
  font-size: 15px;
  color: var(--pz-ink);
}
.pz-top__back {
  font-size: 14px;
  font-weight: 600;
  color: var(--pz-muted);
  border-bottom: 1px dashed var(--pz-line);
}
.pz-top__back:hover { color: var(--pz-violet); border-color: var(--pz-violet); }

/* ---------------- layout ---------------- */
.pz-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 72px;
}
.pz-title {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.6px;
}
.pz-sub {
  margin: 0 0 26px;
  color: var(--pz-muted);
  font-size: 15px;
}
.pz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}
.pz-card {
  background: var(--pz-white);
  border-radius: var(--pz-radius);
  padding: 26px;
  box-shadow: var(--pz-shadow);
}
.pz-card + .pz-card { margin-top: 20px; }

/* ---------------- steps ---------------- */
.pz-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.pz-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--pz-muted);
  font-weight: 600;
}
.pz-step__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pz-line);
  color: var(--pz-muted);
  font-size: 12px;
  font-weight: 800;
}
.pz-step.is-active .pz-step__dot { background: var(--pz-violet); color: #fff; }
.pz-step.is-done .pz-step__dot { background: var(--pz-mint); color: #04362c; }
.pz-step.is-active { color: var(--pz-ink); }
.pz-step__line {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--pz-line);
}
.pz-step__line.is-done { background: var(--pz-mint); }

/* ---------------- form ---------------- */
.pz-h2 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.pz-hint { margin: 0 0 18px; color: var(--pz-muted); font-size: 14px; }

.pz-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.pz-row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .pz-row, .pz-row--3 { grid-template-columns: 1fr; }
}

.pz-field { display: flex; flex-direction: column; gap: 6px; }
.pz-field > label { font-size: 13px; font-weight: 600; color: var(--pz-muted); }
.pz-field input, .pz-field select {
  height: 48px;
  border: 1.5px solid var(--pz-line);
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  font-weight: 600;
  color: var(--pz-ink);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.pz-field input::placeholder { color: #A6AABF; font-weight: 500; }
.pz-field input:focus, .pz-field select:focus {
  border-color: var(--pz-violet);
  box-shadow: 0 0 0 4px rgba(108, 76, 241, .14);
}
.pz-field.is-error input { border-color: var(--pz-danger); }
.pz-field__err { font-size: 12px; color: var(--pz-danger); display: none; }
.pz-field.is-error .pz-field__err { display: block; }

.pz-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--pz-muted);
  line-height: 1.45;
}
.pz-check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--pz-violet);
  flex: none;
}
.pz-check a { color: var(--pz-violet); text-decoration: underline; }

/* amount slider */
.pz-amount {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.pz-amount input[type="number"] {
  width: 170px;
  height: 52px;
  border: 1.5px solid var(--pz-line);
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  color: var(--pz-ink);
  outline: none;
}
.pz-amount input[type="number"]:focus {
  border-color: var(--pz-violet);
  box-shadow: 0 0 0 4px rgba(108, 76, 241, .14);
}
.pz-range { width: 100%; }
.pz-range input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 999px;
  background: var(--pz-line);
  outline: none;
  cursor: pointer;
}
.pz-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--pz-mint);
  box-shadow: 0 4px 12px rgba(21, 16, 56, .2);
}
.pz-range input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 5px solid var(--pz-mint);
  border-radius: 50%;
  background: #fff;
}
.pz-range__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--pz-muted);
  font-weight: 600;
}

.pz-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.pz-chip {
  border: 1.5px solid var(--pz-line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--pz-ink);
  cursor: pointer;
  transition: all .15s;
}
.pz-chip:hover { border-color: var(--pz-violet); }
.pz-chip.is-active {
  border-color: var(--pz-violet);
  background: var(--pz-violet-light);
  color: var(--pz-violet-600);
}

/* buttons */
.pz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 12px;
  background: var(--pz-mint);
  color: #04362c;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: transform .12s, background .15s, opacity .15s;
  text-align: center;
  text-decoration: none;
}
.pz-btn:hover { background: var(--pz-mint-600); }
.pz-btn:active { transform: translateY(1px); }
.pz-btn:disabled { opacity: .45; cursor: not-allowed; }
.pz-btn--dark { background: var(--pz-ink-2); color: #fff; }
.pz-btn--dark:hover { background: #1b1550; }
.pz-btn--ghost {
  background: #fff;
  color: var(--pz-violet);
  border: 1.5px solid var(--pz-violet);
}
.pz-btn--ghost:hover { background: var(--pz-violet-light); }
.pz-btn--wide { width: 100%; }
.pz-btn--sm { height: 42px; padding: 0 18px; font-size: 14px; }

.pz-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.pz-actions .pz-btn { flex: 1 1 180px; }

.pz-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--pz-muted);
  line-height: 1.5;
}

/* ---------------- summary ---------------- */
.pz-summary { position: sticky; top: 24px; }
.pz-summary__head {
  background: var(--pz-mint);
  color: #04362c;
  margin: -26px -26px 20px;
  padding: 16px 26px;
  border-radius: var(--pz-radius) var(--pz-radius) 0 0;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}
.pz-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--pz-line);
  font-size: 15px;
}
.pz-summary__row:last-child { border-bottom: 0; }
.pz-summary__row span { color: var(--pz-muted); }
.pz-summary__row b { font-weight: 800; white-space: nowrap; }
.pz-summary__row--total { font-size: 17px; }
.pz-summary__total { color: var(--pz-violet-600); }

/* ---------------- success ---------------- */
.pz-success {
  text-align: center;
  padding: 12px 0 4px;
}
.pz-success__icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--pz-mint-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.pz-success h2 { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.pz-success p { margin: 0 0 22px; color: var(--pz-muted); }

/* ---------------- cabinet ---------------- */
.pz-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.pz-user__name { font-size: 14px; font-weight: 700; }
.pz-user__phone { font-size: 12px; color: var(--pz-muted); }
.pz-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pz-violet-light);
  color: var(--pz-violet-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.pz-logout {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--pz-muted);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.pz-logout:hover { color: var(--pz-danger); }

.pz-loan {
  border: 1.5px solid var(--pz-line);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
}
.pz-loan__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.pz-loan__title { font-size: 18px; font-weight: 800; }
.pz-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pz-mint-light);
  color: #067a5c;
  white-space: nowrap;
}
.pz-badge--muted { background: var(--pz-line); color: var(--pz-muted); }
.pz-badge--warn { background: #FEECEB; color: #B42318; }

.pz-loan__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.pz-loan__grid div span { display: block; font-size: 12px; color: var(--pz-muted); margin-bottom: 3px; }
.pz-loan__grid div b { font-size: 18px; font-weight: 800; }
@media (max-width: 720px) { .pz-loan__grid { grid-template-columns: 1fr 1fr; } }

.pz-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--pz-line);
  overflow: hidden;
  margin-bottom: 8px;
}
.pz-progress span { display: block; height: 100%; border-radius: 999px; background: var(--pz-mint); }
.pz-progress-note { font-size: 12px; color: var(--pz-muted); margin-bottom: 18px; }

.pz-empty { text-align: center; padding: 26px 10px; }
.pz-empty h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.pz-empty p { margin: 0 0 20px; color: var(--pz-muted); }

.pz-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pz-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--pz-muted);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--pz-line);
  font-weight: 700;
}
.pz-table td {
  padding: 14px 0;
  border-bottom: 1px solid var(--pz-line);
  font-weight: 600;
}
.pz-table tr:last-child td { border-bottom: 0; }
.pz-table__status { font-weight: 700; }
.pz-table__status.is-paid { color: #067a5c; }
.pz-table__status.is-active { color: var(--pz-violet-600); }

.pz-kv { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.pz-kv div span { display: block; font-size: 12px; color: var(--pz-muted); margin-bottom: 2px; }
.pz-kv div b { font-weight: 700; }
@media (max-width: 640px) { .pz-kv { grid-template-columns: 1fr; } }

.pz-cred { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--pz-line); }
.pz-cred:last-of-type { border-bottom: 0; }
.pz-cred span { font-size: 12px; color: var(--pz-muted); width: 62px; flex: none; }
.pz-cred b { flex: 1; font-size: 15px; font-weight: 800; word-break: break-all; }

/* ---------------- modal ---------------- */
.pz-modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 16, 56, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.pz-modal.is-open { display: flex; }
.pz-modal__card {
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 80px -30px rgba(21, 16, 56, .6);
}
.pz-modal__card h3 { margin: 0 0 6px; font-size: 21px; font-weight: 800; }
.pz-modal__card p { margin: 0 0 18px; color: var(--pz-muted); font-size: 14px; }
.pz-modal__sum {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.8px;
  margin-bottom: 18px;
}

/* toast */
.pz-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--pz-ink-2);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 200;
}
.pz-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- review / credentials ---------------- */
@keyframes pzSpin { to { transform: rotate(360deg); } }
.pz-spinner {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  border: 3px solid #E6E6F2; border-top-color: #6C4CF1;
  animation: pzSpin .8s linear infinite;
}
.pz-review {
  display: flex; gap: 14px; align-items: center; justify-content: center;
  background: #F8F7FF; border: 1.5px solid #EDE9FF; border-radius: 14px;
  padding: 15px 18px; margin: 0 0 18px; text-align: left;
}
.pz-review__text b { display: block; font-size: 15px; font-weight: 800; }
.pz-review__sub { font-size: 13px; color: #5C6178; margin-top: 3px; }
.pz-review__sub a { color: #6C4CF1; font-weight: 700; }
.pz-review--wait { background: #FFF7ED; border-color: #FDE4C7; }
.pz-review--wait .pz-review__mark {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: #F59E0B; color: #fff; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.pz-review__legal { margin: 18px 0 0; font-size: 12px; color: #5C6178; }

.pz-credentials {
  border: 1.5px dashed #D9D2FF; background: #FBFAFF; border-radius: 14px;
  padding: 16px 18px; margin: 0 0 18px; text-align: left;
}
.pz-credentials__title {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #6C4CF1; margin-bottom: 10px;
}
.pz-credentials__row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.pz-credentials__row span { width: 70px; font-size: 13px; color: #5C6178; flex: none; }
.pz-credentials__row b { font-size: 19px; font-weight: 800; letter-spacing: .02em; flex: 1; word-break: break-all; }
.pz-copy {
  border: 1px solid #D9D2FF; background: #fff; color: #6C4CF1;
  font: inherit; font-size: 12px; font-weight: 700; border-radius: 8px;
  padding: 6px 10px; cursor: pointer; flex: none;
}
.pz-copy:hover { background: #EEEBFF; }
.pz-credentials__note { margin: 10px 0 0; font-size: 12px; color: #5C6178; }
.pz-done__icon--wait {
  background: radial-gradient(circle at 30% 25%, #FFF3C4, #FFC53D);
  color: #7a4b00; font-size: 38px;
}
.pz-consent {
  margin: 0 0 18px; padding: 12px 14px;
  background: #F8F7FF; border-radius: 12px; border: 1px solid #EDE9FF;
}
[hidden] { display: none !important; }

/* login */
.pz-login { max-width: 440px; margin: 40px auto 0; }
.pz-login__logo { display: block; width: 56px; height: 56px; margin: 0 auto 16px; }
.pz-login h1 { text-align: center; font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.pz-login > p { text-align: center; color: var(--pz-muted); margin: 0 0 22px; font-size: 15px; }
.pz-code-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--pz-muted);
  background: var(--pz-violet-light);
  border-radius: 10px;
  padding: 10px 12px;
}
.pz-code-hint b { color: var(--pz-violet-600); }

@media (max-width: 980px) {
  .pz-grid { grid-template-columns: 1fr; }
  .pz-summary { position: static; }
  .pz-top__phone { display: none; }
}
@media (max-width: 640px) {
  .pz-main { padding: 20px 14px 48px; }
  .pz-card { padding: 18px; }
  .pz-title { font-size: 25px; }
  .pz-summary__head { margin: -18px -18px 16px; padding: 14px 18px; }
  .pz-amount { flex-direction: column; align-items: stretch; }
  .pz-amount input[type="number"] { width: 100%; }
  .pz-steps { display: none; }
}
