:root {
  --accent: #13603F;
  --accent-dark: #0C4A30;
  --bg: #F2F7F3;
  --card: #FFFFFF;
  --line: #CFE0D5;
  --line-soft: #E4EEE7;
  --text: #15241C;
  --text-soft: #3A4D42;
  --ad-bg: #E4EEE7;
  --ad-line: #A9C2B2;
  --ad-text: #3F5A4A;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Onest", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- шапка ---------- */
.top-in {
  max-width: 1240px; margin: 0 auto; padding: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.logo { font-size: 22px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.4px; }
.logo span { color: var(--accent); }
.desk-nav { display: none; gap: 22px; align-items: center; font-size: 15px; font-weight: 500; }
.desk-nav a { color: var(--accent); }
.desk-nav a.current { color: var(--text); font-weight: 700; text-decoration: none; }
.head-right { display: flex; gap: 12px; align-items: center; }
.home-link { font-size: 15px; font-weight: 500; }
.btn-login {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 22px; border-radius: 999px; background: var(--accent); color: #fff;
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.btn-login:hover { background: var(--accent-dark); color: #fff; }
.pill {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px;
}
.pill:hover { color: var(--text); border-color: var(--accent); }

.only-desktop { display: none !important; }

/* ---------- реклама ---------- */
.ad {
  border: 1px dashed var(--ad-line); border-radius: 14px; background: var(--ad-bg);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--ad-text); font-size: 14px;
}
.ad-top { height: 70px; margin: 0 0 4px; }
.ad-top-wide { height: 100px; }
.ad-bottom { margin-top: 8px; height: 110px; }
.main > .ad-bottom[data-ad-size="300x250"] { height: 260px; }
.ad-left { flex: 0 0 160px; height: 600px; }
.ad-right { flex: 0 0 300px; height: 600px; }

/* ---------- каркас страницы ---------- */
.cols { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-bottom: 24px; }
.main { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.page-title { margin: 0 0 4px; font-size: 28px; letter-spacing: -0.5px; }

/* ---------- главная ---------- */
.hero { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.hero h1 { margin: 0; font-size: 29px; line-height: 1.15; letter-spacing: -0.6px; }
.hero p { margin: 0 0 4px; font-size: 16px; line-height: 1.5; color: var(--text-soft); }

.cards { display: flex; flex-direction: column; gap: 14px; }
.pair { display: flex; gap: 10px; }
.pair .card { flex: 1; }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none;
  min-height: 44px;
}
.card:hover { color: var(--text); border-color: var(--accent); }
.card-title { font-size: 17px; font-weight: 600; }
.card .sub { font-size: 13px; line-height: 1.35; color: var(--text-soft); }
.card .sub-desk { display: none; }
.card-main { flex-direction: row; align-items: center; gap: 14px; padding: 18px; background: var(--accent); border-color: var(--accent); color: #fff; }
.card-main:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.card-text { display: flex; flex-direction: column; gap: 2px; }
.card-main .card-title { font-size: 19px; font-weight: 700; }
.card-main .sub { color: #fff; font-size: 14px; }
.card-row { flex-direction: row; align-items: center; gap: 14px; padding: 16px 18px; }
.card-row .sub { display: none; }

/* ---------- блоки, списки, кнопки ---------- */
.box {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.box-title { font-size: 17px; font-weight: 700; display: block; }
.box-text { font-size: 15px; color: var(--text-soft); line-height: 1.45; display: block; }
.note { font-size: 14px; color: var(--text-soft); line-height: 1.45; }
.list {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 4px 16px; display: flex; flex-direction: column;
}
.row { padding: 12px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 2px; }
.row:last-child { border-bottom: none; }
.row-name { font-size: 16px; font-weight: 600; }
.row-cond { font-size: 14px; color: var(--text-soft); }
.row-small { font-size: 13px; color: var(--text-soft); }
.group-title { font-size: 13px; font-weight: 700; letter-spacing: 0.6px; color: var(--text-soft); margin-top: 4px; }

.btn-big, .btn-plain {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  border-radius: 12px; font-weight: 600; font-size: 16px; text-decoration: none;
}
.btn-big { background: var(--accent); color: #fff; border: none; }
.btn-big:hover { background: var(--accent-dark); color: #fff; }
.btn-plain { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-plain:hover { color: var(--text); border-color: var(--accent); }

.tabs { display: flex; gap: 10px; }
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 46px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--text);
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.panel { display: flex; flex-direction: column; gap: 12px; }

.credit-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.credit-card[open] { border: 2px solid var(--accent); }
.credit-card summary {
  list-style: none; cursor: pointer; padding: 16px; display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px; min-height: 44px;
}
.credit-card summary::-webkit-details-marker { display: none; }
.cc-text { display: flex; flex-direction: column; gap: 4px; }
.chev { flex: none; margin-top: 2px; transition: transform 0.15s; }
.credit-card[open] .chev { transform: rotate(180deg); }
.cc-list { padding: 0 16px; background: #F7FAF8; border-top: 1px solid var(--line-soft); }
.cc-foot { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line-soft); }

.help { gap: 14px; padding: 18px; font-size: 15px; line-height: 1.5; }
.help b { display: block; margin-bottom: 2px; }

.doc h2 { margin: 0 0 6px; font-size: 17px; }
.doc p { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.doc p:last-child { margin-bottom: 0; }

/* ---------- подвал и cookies ---------- */
.foot { border-top: 1px solid #D5E4DA; }
.foot-in { display: flex; flex-wrap: wrap; gap: 14px 20px; padding-top: 16px; padding-bottom: 16px; font-size: 13px; color: var(--ad-text); }
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid var(--line);
  padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center;
  font-size: 14px; box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}
.cookie-bar button {
  min-height: 44px; padding: 0 22px; border-radius: 999px; border: none; background: var(--accent);
  color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- компьютер ---------- */
@media (min-width: 900px) {
  .only-phone { display: none !important; }
  .only-desktop { display: flex !important; }
  .desk-nav { display: flex; }
  .top-in { padding: 20px 24px; }
  .logo { font-size: 24px; }
  .wrap { padding: 0 24px; }
  .cols { flex-direction: row; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-top: 24px; padding-bottom: 32px; }
  .cols.inner { justify-content: center; }
  .cols.inner .main { max-width: 680px; }
  .cols.plain { justify-content: center; }
  .cols.plain .main { max-width: 760px; }
  .page-title { font-size: 36px; letter-spacing: -0.8px; }
  .hero { gap: 14px; }
  .hero h1 { font-size: 44px; letter-spacing: -1px; max-width: 760px; }
  .hero p { font-size: 19px; max-width: 640px; }
  .cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .pair { display: contents; }
  .card, .card-row, .card-main {
    flex-direction: column; align-items: stretch; gap: 14px; padding: 24px; border-radius: 18px; min-height: 170px;
  }
  .card-title, .card-main .card-title { font-size: 22px; font-weight: 700; }
  .card .sub, .card-main .sub { font-size: 15px; line-height: 1.4; }
  .card-text { gap: 14px; }
  .card .sub-phone { display: none; }
  .card .sub-desk, .card-row .sub { display: block; }
  .tabs { max-width: 420px; }
}

/* ---------- вход, регистрация ---------- */
.form-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 18px; display: flex; flex-direction: column; gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--text-soft); }
.field input {
  min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid #B9CFC1;
  background: #F7FAF8; font: inherit; font-size: 17px; color: var(--text); width: 100%;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field.has-err input { border-color: #B3261E; }
.hint { font-size: 13px; line-height: 1.4; color: var(--text-soft); }
.err { font-size: 14px; color: #B3261E; }
.form-err {
  font-size: 15px; color: #B3261E; background: #FBEAE8; border: 1px solid #E8B9B4;
  border-radius: 12px; padding: 12px 14px;
}
.btn-submit {
  min-height: 52px; border-radius: 14px; border: none; background: var(--accent); color: #fff;
  font: inherit; font-weight: 700; font-size: 17px; cursor: pointer;
}
.btn-submit:hover { background: var(--accent-dark); }
.center-link { text-align: center; font-size: 15px; }
.center-text { text-align: center; font-size: 15px; color: var(--text-soft); }
.info { background: var(--ad-bg); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.5; color: #2F4639; }
.alt { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 6px; font-size: 15px; color: var(--text-soft); }
.alt .btn-plain { width: 100%; }
.logout-form { margin: 0; }
button.btn-login { border: none; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }

/* ---------- анкета ---------- */
#anketa { display: flex; flex-direction: column; gap: 14px; }
#anketa .group {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 14px;
}
#anketa .group h2 { font-size: 16px; font-weight: 700; margin: 0; }
#anketa #loanForm { display: flex; flex-direction: column; }
#anketa #formBody { display: flex; flex-direction: column; }
#anketa .field { display: block; }
#anketa .field label, #anketa .label-like { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
#anketa .field input[type="text"], #anketa .field input[type="tel"], #anketa .field textarea, #anketa .field select {
  width: 100%; min-height: 48px; padding: 11px 13px; border-radius: 10px; border: 1px solid #B9CFC1;
  background: #F7FAF8; font: inherit; font-size: 16px; line-height: 1.4; color: var(--text);
}
#anketa .field textarea { display: block; resize: none; overflow: hidden; min-height: 70px; }
#anketa .field select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%233A4D42' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
#anketa .field input:focus, #anketa .field textarea:focus, #anketa .field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; background-color: #fff;
}
#anketa .field input.invalid, #anketa .field textarea.invalid, #anketa .field select.invalid { border-color: #B3261E; }
#anketa .field input.valid, #anketa .field textarea.valid, #anketa .field select.valid { border-color: var(--accent); }
#anketa .field .hint { margin: 5px 0 0; }
#anketa .field .error { display: none; margin: 5px 0 0; color: #B3261E; font-size: 14px; }
#anketa .field.error .error { display: block; }
#anketa .field.error .hint { display: none; }
#anketa .field.error .seg-btn { border-color: #B3261E; }
#anketa .passport-hint { margin: 0; }

.region-wrap { position: relative; }
.region-list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 220px;
  overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(21, 36, 28, 0.14); z-index: 20;
}
.region-list.show { display: block; }
.region-item { padding: 12px 13px; font-size: 15px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.region-item:last-child { border-bottom: none; }
.region-item:hover { background: var(--bg); }
.region-empty { padding: 12px 13px; font-size: 14px; color: var(--text-soft); }

.manual-link {
  display: inline-block; margin-top: 6px; padding: 8px 0; min-height: 44px; border: none; background: none;
  color: var(--accent); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer;
}

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-row .label-text { font-size: 15px; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .slider { position: absolute; inset: 0; background: #B9CFC1; border-radius: 28px; transition: background 0.15s; }
.switch .slider::before {
  content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.15s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
#residentialField { display: none; padding-top: 14px; border-top: 1px solid var(--line); }

.product-switch, .seg { display: flex; gap: 10px; }
.product-btn {
  flex: 1; min-height: 52px; padding: 14px; border-radius: 12px; border: 1px solid #B9CFC1; background: #fff;
  color: var(--text); font: inherit; font-weight: 500; font-size: 16px; cursor: pointer;
}
.product-btn.active { border: 2px solid var(--accent); background: var(--line-soft); font-weight: 700; }
.seg-btn {
  flex: 1; min-height: 48px; padding: 12px; border-radius: 10px; border: 1px solid #B9CFC1; background: #fff;
  color: var(--text); font: inherit; font-size: 15px; cursor: pointer;
}
.seg-btn.active { border: 2px solid var(--accent); background: var(--line-soft); font-weight: 700; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.suffix-wrap { position: relative; }
#anketa .field .suffix-wrap input[type="text"] { padding-right: 52px; }
.suffix-wrap .suffix { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-size: 14px; pointer-events: none; }

.consent-row { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.consent-row input { width: 22px; height: 22px; flex-shrink: 0; margin: 1px 0 0; accent-color: var(--accent); }
.consent-links { margin: 0 0 0 34px; font-size: 14px; color: var(--text-soft); }
.consent-error { display: none; margin: 0 0 0 34px; color: #B3261E; font-size: 14px; }

#statusBanner { display: none; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; }
#statusBanner.ok { display: block; background: var(--line-soft); border: 1px solid var(--line); color: var(--accent-dark); }
#statusBanner.fail { display: block; background: #FBEAE8; border: 1px solid #E8B9B4; color: #B3261E; }
#submitBtn { width: 100%; min-height: 56px; border: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 18px; border-radius: 14px; }
#submitBtn.not-ready, #submitBtn:disabled { background: #B9CFC1; color: #27402F; }
#submitBtn:disabled { cursor: not-allowed; }

#confirmOverlay {
  display: none; position: fixed; inset: 0; background: rgba(21, 36, 28, 0.5); z-index: 50;
  align-items: flex-end; justify-content: center;
}
#confirmOverlay.show { display: flex; }
#confirmPanel { background: #fff; border-radius: 16px 16px 0 0; padding: 20px 18px 24px; width: 100%; max-width: 560px; }
@media (min-width: 900px) {
  #confirmOverlay { align-items: center; }
  #confirmPanel { border-radius: 16px; }
}
#confirmPanel p { margin: 0 0 14px; font-size: 15px; line-height: 1.5; }
#confirmPanel .partner-list { margin: 0 0 14px; padding-left: 22px; max-height: 30vh; overflow-y: auto; font-size: 15px; line-height: 1.6; }
#confirmPanel .buttons { display: flex; gap: 10px; }
#confirmPanel .buttons button {
  flex: 1; min-height: 50px; border-radius: 12px; font: inherit; font-weight: 600; font-size: 16px; cursor: pointer;
}
#confirmSendBtn { background: var(--accent); color: #fff; border: none; }
#confirmSendBtn:disabled { background: #B9CFC1; color: #27402F; cursor: not-allowed; }
#confirmBackBtn { background: #fff; color: var(--text); border: 1px solid var(--line); }

/* ---------- заявка принята ---------- */
.done-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.done-box h1 { margin: 0; font-size: 28px; letter-spacing: -0.5px; }
.done-box p { margin: 0; color: var(--text-soft); line-height: 1.5; }
.done-mark {
  width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.pair-row { display: flex; gap: 10px; width: 100%; }
.pair-row > a { flex: 1; }

/* ---------- мои заявки ---------- */
.app-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.app-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.app-title { font-size: 17px; font-weight: 700; }
.app-date { font-size: 13px; color: var(--text-soft); }
.app-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.chip { padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.st-pending { background: #F6E7D2; color: #6B4210; }
.st-ok { background: #D7F0E1; color: #0C4A30; }
.st-other { background: #E2ECF8; color: #1C3F6E; }
.st-no { background: #F5DEDB; color: #7A231B; }
.btn-money {
  display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none;
}
.btn-money:hover { background: var(--accent-dark); color: #fff; }
.page-counter { text-align: center; font-size: 14px; color: var(--text-soft); }

/* ---------- удаление данных, выход на телефоне ---------- */
.btn-danger {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 1px solid #D9A8A1; background: #fff; color: #7A231B;
  font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
}
.btn-danger:hover { background: #FBEAE8; color: #7A231B; }
.pair-row > .btn-plain { flex: 1; }
.link-btn {
  min-height: 44px; padding: 0 4px; border: none; background: none; color: var(--accent);
  font: inherit; font-size: 15px; font-weight: 500; text-decoration: underline; cursor: pointer;
}

/* ---------- красная отметка и уведомления ---------- */
.dot {
  display: inline-block; width: 10px; height: 10px; margin-left: 6px; border-radius: 50%;
  background: #D32F2F; vertical-align: middle;
}
.desk-nav a { position: relative; }
.card-title .dot { margin-left: 8px; }
.app-card.is-new { border: 2px solid #D32F2F; }
.new-tag { align-self: flex-start; font-size: 13px; font-weight: 600; color: #9C1F1F; }

.push-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.push-card[hidden] { display: none !important; }
.push-title { font-size: 17px; font-weight: 700; }
.push-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-soft); }
.push-card p[hidden] { display: none !important; }
.push-card .pair-row[hidden] { display: none !important; }
.push-card .pair-row > button { min-height: 48px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; border-radius: 12px; }
.push-card .btn-big { border: none; }
.push-card .btn-plain { border: 1px solid var(--line); }
.push-card button[hidden] { display: none !important; }
.push-error { color: #B3261E !important; }
