/* CREDiPORT — стилове за майстора на CreditArena (credit-wizard.js). Само новото за структурата му;
   видът на листа, картите и бутоните си остава на credit-app.css / nc-credit-consumer.css.
   Предговорът „body “ вдига специфичността, за да победи старите правила за #step2Content независимо от реда на зареждане. */

/* Прогрес от 4 сегмента (вместо една тънка лента) — стои залепен в горния край на скролиращата част */
body #step2Content .step2-body .wiz-progress-wrap {
  display: flex; gap: 4px; height: auto; margin: 0; padding: 12px 28px 0;
  background: #fff; border-radius: 0;
  position: sticky; top: 0; z-index: 2;
}
body #step2Content .wiz-seg { flex: 1; height: 4px; border-radius: 2px; background: #E2E8F0; transition: background .3s ease; }
body #step2Content .wiz-seg.wiz-seg-done { background: var(--accent, #FF5349); }
body #step2Content .wiz-seg.wiz-seg-active { background: color-mix(in srgb, var(--accent, #FF5349) 38%, transparent); }

/* Тялото на въпросите: без собствено центриране, сгъстява се с „Продължи“ във футъра под него */
#step2Content .wiz-form-body { padding: 20px 28px 28px; }
#step2Content .wiz-motivate { margin: 2px 0 16px; font-size: .78rem; color: #64748B; line-height: 1.5; }
#step2Content .wiz-sent-note { margin: 0 0 10px; font-size: .9rem; color: #475569; }
#step2Content .wiz-sent-note span { color: var(--accent, #FF5349); font-weight: 800; }
#step2Content .wiz-implicit-submit { display: none; }

/* Общ футър с „Назад“ и „Продължи“ */
#step2Content .wiz-footer-shared {
  flex-shrink: 0; display: flex; gap: 10px; align-items: stretch;
  padding: 12px 28px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid #F1F5F9;
}
#step2Content .wiz-footer-shared .btn-form-next { flex: 1; }

/* Екран със задължения: редове „въпрос — Да/Не“ */
#step2Content .debt-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid #F1F5F9; }
#step2Content .debt-row-label { font-weight: 700; font-size: .9rem; color: #0F172A; flex: 1 1 160px; min-width: 0; }
#step2Content .debt-row .yn-grid { display: flex; gap: 8px; margin-bottom: 0; width: auto; flex-shrink: 0; }
#step2Content .debt-row .yn-btn { padding: 10px 16px; font-size: .83rem; min-width: 56px; width: auto; white-space: nowrap; flex-shrink: 0; } /* width:auto — общото .yn-btn е със 100% и избутваше „Не“ извън екрана на 375 px */
#step2Content .cond-field { display: none; }

/* Грешките — по-едри и по-тъмни (контраст 6,5:1), както на CreditArena (W351) */
#step2Content .field-error { font-size: .88rem; line-height: 1.45; color: #B91C1C; font-weight: 700; margin-top: 6px; display: none; }

@media (max-width: 599px) {
  body #step2Content .step2-body .wiz-progress-wrap { padding: 12px 22px 0; }
  #step2Content .wiz-form-body { padding: 20px 22px 20px; }
  #step2Content .wiz-footer-shared { padding: 12px 22px calc(10px + env(safe-area-inset-bottom, 0px)); }
  #step2Content .debt-row .yn-grid { grid-template-columns: none; }
  #step2Content .debt-row .yn-btn { padding: 10px 16px; font-size: .83rem; border-radius: 12px; }
  #step2Content .debt-row { padding: 14px 0; }

  /* Клавиатура на телефон: листът се оразмерява по видимата зона (credit-wizard.js пише --ca-vvh / --ca-vvt от visualViewport),
     така „Продължи“ стои веднага над клавиатурата, а не под нея. Навигацията на CREDiPORT остава отгоре. */
  body.wiz-open #step2Content.active {
    top: calc(var(--ca-vvt, 0px) + var(--nav-h, 64px));
    height: calc(var(--ca-vvh, 100dvh) - var(--nav-h, 64px));
  }
  body.wiz-open #step2Content .step2-inner { height: 100%; max-height: 100%; }

  /* Нисък екран (клавиатура или хоризонтално): само по-малко въздух, нищо не се скрива */
  #step2Content.ca-short .wiz-form-body { padding-top: 8px; padding-bottom: 16px; }
  body #step2Content.ca-short .step2-body .wiz-progress-wrap { padding: 6px 22px 0; }
  #step2Content.ca-short .step-sub { margin-bottom: 10px; }
  #step2Content.ca-short .wiz-footer-shared { padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); }
  #step2Content.ca-short .wiz-footer-shared .btn-form-next,
  #step2Content.ca-short .wiz-footer-shared .btn-form-back { padding-top: 13px; padding-bottom: 13px; }
  #step2Content.ca-kb .wiz-footer-shared { padding-bottom: 8px; }
  #step2Content.ca-short .city-suggestions { max-height: 150px; }
}

/* Екранът след края на въпросника */
#step2Content .success-icon-circle { width: 64px; height: 64px; background: rgba(34,197,94,.1); color: #16A34A; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 2rem; }
#step2Content .success-wrap h3 { font-size: 1.3rem; font-weight: 800; color: #0F172A; margin: 0 0 12px; }
#step2Content .success-wrap p { color: #64748B; line-height: 1.6; margin: 0 0 12px; }
#step2Content .success-wrap #wizSuccessNext { color: #0F172A; }

/* Екранът със съгласията — като на CreditArena: отметката е 18 px и стои до текста (не вътре в него), по 14 px между двете съгласия */
body #step2Content .consent-group { display: block; margin: 0 0 14px; }
body #step2Content .consent-label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .75rem; color: #475569; line-height: 1.55; font-weight: 400; }
body #step2Content .consent-label input[type="checkbox"] { width: 18px; height: 18px; border-radius: 5px; border: 2px solid #E2E8F0; flex-shrink: 0; margin: 2px 0 0; accent-color: var(--accent, #FF5349); cursor: pointer; }

/* Връзката „Как пазим данните“ под съгласията — същият вид като останалите връзки на екрана */
body #step2Content .wiz-privacy-link a { color: #64748B; font-weight: 500; font-size: .72rem; text-decoration: underline; text-underline-offset: 2px; }
body #step2Content .wiz-privacy-link a:hover { color: #0F172A; }

/* Списъкът с кредиторите в съгласието: скрит, показва се при докосване/посочване като чист панел в текста
   (на CreditArena е така; върху старите правила за подсказката на страницата, които на някои страници липсват) */
#step2Content .tooltip-partners { position: relative; color: var(--accent, #FF5349); font-weight: 600; cursor: pointer; text-decoration: underline dotted; }
#step2Content .tooltip-partners .tooltip-text {
  display: none;
  position: static; top: auto; bottom: auto; left: auto; right: auto; transform: none;
  width: 100%; max-width: 100%; margin: 8px 0 4px; z-index: auto;
  background: #fff; color: #475569;
  border: 1px solid #E5E7EB; border-left: 3px solid var(--accent, #FF5349); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 6px 20px rgba(15,23,42,.10);
  font-size: .72rem; font-weight: 400; line-height: 1.6;
  max-height: 44vh; overflow-y: auto; white-space: normal; text-decoration: none;
}
#step2Content .tooltip-partners:hover .tooltip-text,
#step2Content .tooltip-partners:focus .tooltip-text { display: block; }
#step2Content .tooltip-partners .tooltip-text::before,
#step2Content .tooltip-partners .tooltip-text::after { display: none; }
#step2Content .tooltip-partners .tooltip-text a { color: var(--accent, #FF5349); font-weight: 600; text-decoration: underline; }

/* Approved v4 anchors: the short form owns its mobile header and close control.
   Follow visualViewport when the keyboard opens; the underlying page nav may be offscreen. */
@media (max-width:599px){
 body.wiz-open #step2Content.active{
  --nav-h:0px;top:var(--ca-vvt,0px);height:var(--ca-vvh,100dvh);
 }
 body.wiz-open #step2Content .step2-inner{
  height:100%;max-height:100%;
 }
 body.wiz-open #step2Content .step2-sheet-header{
  justify-content:space-between;flex-shrink:0;padding:10px 16px;
 }
 body.wiz-open #step2Content .step2-modal-close{
  display:inline-flex!important;width:44px;height:44px;min-width:44px;
 }
}
