/*
 * enhance.css — mavjud dizayn ustiga qo'yiladigan polish qatlami.
 * MAQSAD: redesign EMAS. Faqat: spacing, tipografiya, focus/hover micro-interaction,
 * accessibility, hamda yangi SEO/FAQ/trust/footer bloklari stili.
 * Mavjud kalkulyator UI'siga tegmaydi — eng oxirida yuklanadi.
 */

/* Screen-reader uchun ko'rinmas, lekin crawl/AI uchun mavjud matn (H1, intro) */
.kk-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  --kk-navy: #0e2b4e;
  --kk-navy-2: #16365f;
  --kk-gold: #e8b40b;
  --kk-gold-2: #e4a216;
  --kk-purple: #8739e5;
  --kk-blue: #5596ff;
  --kk-ink: #1d2b3a;
  --kk-muted: #5b6b7d;
  --kk-line: #e7ecf2;
  --kk-bg-soft: #f6f8fb;
}

/* ============================================================
   0. ACCESSIBILITY — kontrast (init paytdagi kulrang flashni bartaraf etadi)
   Kalkulyator maydonlari JS ulanguncha ba'zan kulrang ko'rinadi;
   yakuniy (qora) rang darhol qo'llanadi — kontrast WCAG AA bo'ladi.
   ============================================================ */
.calc-credit .label { color: rgba(0, 0, 0, .87); }
.calc-credit .form-control { color: rgba(0, 0, 0, .87) !important; }
.calc-credit .form-control:disabled,
.calc-credit select:disabled { color: #595959 !important; }      /* muted, ammo AA (7:1) */
.calc-credit .select2-selection__rendered { color: #555 !important; }

/* "Imtiyozli davr" maydoni init paytida opacity orqali xiralashadi (kontrast 1.67).
   Effektiv kontrastni AA'ga yetkazish uchun shaffoflikni va matn rangini majburlaymiz.
   Lokal kalkulyator bu maydonni hisobda ishlatmaydi — funksiyaga ta'sir yo'q. */
.calc-credit .js-box-grace-period,
.calc-credit .js-box-grace-period * { opacity: 1 !important; }
#loan-grace-period.form-control,
label[for="loan-grace-period"].label { color: rgba(0, 0, 0, .87) !important; }
[id^="select2-LOAN_GRACE_PERIOD_TYPE"] { color: #555 !important; }

/* ============================================================
   1. MICRO-INTERACTIONS (mavjud elementlarga, juda nozik)
   ============================================================ */

/* Hisoblash tugmasi — hover ko'tarilish + bosilish, allaqachon bor gradient saqlanadi */
.jq-btn-calc-credit,
.btn.btn-primary {
  transition: transform .18s ease, box-shadow .18s ease, background .2s ease;
  will-change: transform;
}
.jq-btn-calc-credit:hover:not([disabled]),
.btn.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(232, 180, 11, .35), 0 2px 6px rgba(0, 0, 0, .12) !important;
}
.jq-btn-calc-credit:active:not([disabled]),
.btn.btn-primary:active {
  transform: translateY(0);
}

/* Inputlar — fokus va hover holatida brend rangli nozik ramka */
.calc-credit .form-control,
.calc-credit .select2-hook + .select2 .select2-selection {
  transition: border-color .18s ease, box-shadow .18s ease;
}
.calc-credit .form-control:hover {
  border-color: #c9d4e2;
}
.calc-credit .form-control:focus {
  border-color: var(--kk-blue);
  box-shadow: 0 0 0 3px rgba(85, 150, 255, .18);
}

/* Tab linklari — klaviatura fokusi ko'rinadigan bo'lsin (accessibility) */
.nav-tabs-button .nav-link:focus-visible,
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(85, 150, 255, .55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Tab hover holatida ozgina ko'tarilish hissi (gradient o'zgarmaydi) */
.nav-tabs-button .nav-link {
  transition: background .2s ease, transform .15s ease;
}

/* Natija jadvali satrlari — hover ajralib tursin (o'qishni osonlashtiradi) */
.calc-credit .table-tbody_tr {
  transition: background-color .15s ease;
}
.calc-credit .table-tbody_tr:hover {
  background-color: rgba(85, 150, 255, .07);
}

/* Natija kartasi yumshoq paydo bo'lishi */
.jq-calc-result > .box-shadow {
  animation: kkFadeUp .45s ease both;
}
@keyframes kkFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .jq-btn-calc-credit, .btn.btn-primary,
  .jq-calc-result > .box-shadow,
  .nav-tabs-button .nav-link { transition: none !important; animation: none !important; }
  .jq-btn-calc-credit:hover, .btn.btn-primary:hover { transform: none; }
}

/* ============================================================
   2. QO'SHIMCHA SEO / TRUST / FAQ BLOKLARI
   (kalkulyatordan keyingi bo'sh joyda — yangi, additive)
   ============================================================ */

.kk-extra {
  max-width: 65.4375rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  color: var(--kk-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.kk-extra h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--kk-navy);
  margin: 0 0 .4rem;
  letter-spacing: -.01em;
}
.kk-extra .kk-lead {
  color: var(--kk-muted);
  font-size: 1.02rem;
  margin: 0 0 1.6rem;
}

/* --- Trust strip --- */
.kk-trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 2.5rem auto 3rem;
}
.kk-trust__item {
  background: #fff;
  border: 1px solid var(--kk-line);
  border-radius: 14px;
  padding: 1.25rem 1.1rem;
  text-align: center;
  box-shadow: 0 2px 14px rgba(14, 43, 78, .04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.kk-trust__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(14, 43, 78, .09);
}
.kk-trust__ico {
  width: 46px; height: 46px;
  margin: 0 auto .7rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(135, 57, 229, .12), rgba(85, 150, 255, .12));
  font-size: 1.4rem;
}
.kk-trust__t {
  font-weight: 700;
  font-size: .98rem;
  margin: 0 0 .2rem;
  color: var(--kk-navy);
}
.kk-trust__d {
  font-size: .85rem;
  color: var(--kk-muted);
  margin: 0;
  line-height: 1.4;
}

/* --- SEO matn bloki --- */
.kk-prose {
  background: #fff;
  border: 1px solid var(--kk-line);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 14px rgba(14, 43, 78, .04);
}
.kk-prose p { color: #34465a; line-height: 1.7; margin: 0 0 1rem; }
.kk-prose p:last-child { margin-bottom: 0; }
.kk-prose strong { color: var(--kk-navy); }
.kk-prose .kk-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.kk-prose .kk-card {
  border: 1px solid var(--kk-line);
  border-left: 4px solid var(--kk-gold-2);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  background: var(--kk-bg-soft);
}
.kk-prose .kk-card h3 {
  font-size: 1.02rem;
  margin: 0 0 .35rem;
  color: var(--kk-navy);
}
.kk-prose .kk-card p { font-size: .92rem; margin: 0; }

/* HowTo bosqichlar */
.kk-steps {
  counter-reset: kk-step;
  list-style: none;
  margin: 1.25rem 0 1rem;
  padding: 0;
}
.kk-steps li {
  position: relative;
  padding: .35rem 0 .9rem 3rem;
  color: #34465a;
  line-height: 1.6;
  border-left: 2px solid var(--kk-line);
  margin-left: 1.1rem;
}
.kk-steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.kk-steps li::before {
  counter-increment: kk-step;
  content: counter(kk-step);
  position: absolute;
  left: -1.1rem; top: .15rem;
  width: 2.2rem; height: 2.2rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--kk-purple), var(--kk-blue));
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
  font-size: .95rem;
}
.kk-steps li strong { color: var(--kk-navy); }

/* Rus tilidagi blok — neytral aksent (uz kontentdan ajralib tursin) */
.kk-ru { border-left: 4px solid var(--kk-blue); }

/* --- FAQ (native <details>, JS'siz) --- */
.kk-faq { margin-bottom: 3.5rem; }
.kk-faq__item {
  background: #fff;
  border: 1px solid var(--kk-line);
  border-radius: 12px;
  margin-bottom: .75rem;
  overflow: hidden;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.kk-faq__item[open] {
  border-color: #cfe0ff;
  box-shadow: 0 6px 22px rgba(14, 43, 78, .07);
}
.kk-faq__item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 3rem 1.1rem 1.25rem;
  font-weight: 600;
  color: var(--kk-navy);
  position: relative;
  font-size: 1.01rem;
}
.kk-faq__item summary::-webkit-details-marker { display: none; }
.kk-faq__item summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem; top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--kk-blue);
  transition: transform .2s ease;
}
.kk-faq__item[open] summary::after { content: "−"; }
.kk-faq__item .kk-faq__a {
  padding: 0 1.25rem 1.2rem;
  color: #34465a;
  line-height: 1.65;
  font-size: .96rem;
}

/* ============================================================
   3. FOOTER (mavjud HTML bo'sh edi — to'ldiriladi)
   ============================================================ */
.footer.footer {
  background: linear-gradient(180deg, var(--kk-navy) 0%, var(--kk-navy-2) 100%);
  color: rgba(255, 255, 255, .85);
  margin-top: 3rem;
  padding-top: 3rem !important;
}
.kk-footer {
  max-width: 65.4375rem;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}
.kk-footer__brand .kk-footer__logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 .6rem;
  letter-spacing: -.01em;
}
.kk-footer__brand p {
  font-size: .9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .65);
  margin: 0;
  max-width: 34ch;
}
.kk-footer h2 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .62);
  margin: 0 0 1rem;
}
.kk-footer ul { list-style: none; padding: 0; margin: 0; }
.kk-footer li { margin-bottom: .55rem; }
.kk-footer a {
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
  font-size: .92rem;
  transition: color .15s ease;
}
.kk-footer a:hover { color: var(--kk-blue); text-decoration: none; }
.kk-footer__bottom {
  max-width: 65.4375rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: rgba(255, 255, 255, .66);
}

/* ============================================================
   4. RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .kk-trust { grid-template-columns: 1fr 1fr; }
  .kk-footer { grid-template-columns: 1fr 1fr; }
  .kk-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 576px) {
  .kk-extra h2 { font-size: 1.35rem; }
  .kk-trust { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .kk-prose { padding: 1.5rem 1.25rem; }
  .kk-prose .kk-cards { grid-template-columns: 1fr; }
  .kk-footer { grid-template-columns: 1fr; gap: 1.5rem; }
  .kk-footer__bottom { justify-content: flex-start; }
}
