/* ==========================================================================
   ASL STIRKA — Components
   ========================================================================== */

/* ---------- Logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-navy-900);
  flex: none;
}
.logo__mark { width: 22px; height: 38px; flex: none; }
.logo__text {
  display: grid;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  letter-spacing: .04em;
}
.logo__text span + span { margin-top: 3px; }
.logo--light { color: #fff; }
.logo--light .logo__mark { width: 28px; height: 48px; }
.logo--light .logo__text { font-size: 19px; }

@media (max-width: 767px) {
  .logo { gap: 8px; }
  .logo__mark { width: 19px; height: 33px; }
  .logo__text { font-size: 13.5px; }
}
@media (min-width: 1024px) {
  .logo__mark { width: 25px; height: 43px; }
  .logo__text { font-size: 17px; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--c-navy-900);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform var(--dur) var(--ease); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .65; pointer-events: none; }

.btn--primary {
  --btn-bg: var(--c-green-500);
  --btn-fg: #fff;
  text-shadow: 0 1px 1px rgba(31, 66, 0, .28);
  box-shadow: 0 10px 24px -10px rgba(95, 154, 30, .7), inset 0 -2px 0 rgba(0, 21, 40, .12);
}
/* "Yorug'lik" effekti */
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .4) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--c-navy-900);
  box-shadow: inset 0 0 0 1.5px var(--c-navy-900);
}

.btn--ghost-light {
  --btn-bg: rgba(255, 255, 255, .06);
  --btn-fg: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .25);
}

.btn--sm { min-height: 42px; padding: 10px 20px; }
.btn--lg { min-height: 58px; padding: 16px 30px; font-size: var(--fs-base); }
.btn--block { width: 100%; white-space: normal; }

@media (hover: hover) {
  .btn:hover svg { transform: translateX(4px); }
  .btn--primary:hover { --btn-bg: var(--c-green-600); box-shadow: 0 14px 30px -10px rgba(95, 154, 30, .8), inset 0 -2px 0 rgba(0, 21, 40, .12); }
  .btn--primary:hover::after { transform: translateX(120%); }
  .btn--outline:hover { --btn-bg: var(--c-navy-900); --btn-fg: #fff; }
  .btn--ghost-light:hover { --btn-bg: rgba(255, 255, 255, .14); }
}

@media (max-width: 767px) {
  .btn { min-height: 46px; padding: 11px 20px; white-space: normal; }
  .btn--sm { min-height: 38px; padding: 8px 16px; }
  .btn--lg { min-height: 52px; padding: 14px 24px; }
}

/* ---------- Call link ---------- */
.call-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  line-height: 1.25;
}
.call-link small { display: block; font-size: var(--fs-xs); color: var(--c-muted); }
.call-link strong { display: block; font-size: var(--fs-md); font-weight: 600; white-space: nowrap; }
.call-link__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-green-600);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--c-line);
}
.call-link__icon svg { width: 22px; height: 22px; }
.call-link__icon::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--c-green-500);
  opacity: 0;
  animation: ping 2.4s var(--ease-out) infinite;
}

/* ---------- Checklist ---------- */
.checklist { display: grid; gap: 10px; }
.checklist li { display: flex; align-items: flex-start; gap: 12px; font-weight: 500; }
.checklist svg {
  flex: none;
  width: 24px; height: 24px;
  padding: 4px;
  border-radius: 50%;
  background: var(--c-green-500);
  color: #fff;
}

@media (max-width: 767px) {
  .checklist { gap: 8px; }
  .checklist li { gap: 10px; font-size: var(--fs-sm); }
  .checklist svg { width: 21px; height: 21px; }
}

/* ---------- Link with arrow ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--c-navy-900);
  border-bottom: 2px solid var(--c-green-500);
  padding-bottom: 4px;
}
.link-arrow svg { width: 18px; height: 18px; transition: transform var(--dur) var(--ease); }

@media (hover: hover) {
  .link-arrow:hover svg { transform: translateX(4px); }
}

/* ---------- Language switch ---------- */
.lang {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  box-shadow: inset 0 0 0 1px var(--c-line);
}
.lang__link {
  min-width: 38px;
  padding: 7px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-align: center;
  color: var(--c-muted);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.lang__link.is-active { background: var(--c-navy-900); color: #fff; }

@media (hover: hover) {
  .lang__link:not(.is-active):hover { color: var(--c-navy-900); }
}
@media (max-width: 767px) {
  .lang__link { min-width: 34px; padding: 6px 8px; font-size: 11px; }
}

/* ---------- Form fields ---------- */
.field { display: grid; gap: 6px; text-align: left; }
.field__label { font-size: var(--fs-xs); font-weight: 600; color: var(--c-slate-600); }
.field__input {
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-navy-900);
  font-size: var(--fs-base);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field__input[data-phone-mask] {
  padding-left: 56px;
  background: var(--flag-uz) 18px 50% / 24px 16px no-repeat, var(--c-surface);
}
.field__input::placeholder { color: #98a5b3; }
.field__input:focus { outline: none; border-color: var(--c-green-500); box-shadow: var(--ring); }
.field.is-invalid .field__input { border-color: var(--c-error); }
.field.is-invalid .field__input:focus { box-shadow: 0 0 0 4px rgba(210, 60, 60, .18); }
.field__error { font-size: var(--fs-xs); color: var(--c-error); }
.field__error:empty { display: none; }

@media (hover: hover) {
  .field__input:hover:not(:focus) { border-color: var(--c-slate-300); }
}
@media (max-width: 767px) {
  .field__input { min-height: 50px; padding: 12px 16px; border-radius: 14px; }
  .field__input[data-phone-mask] { padding-left: 52px; background-position: 16px 50%, 0 0; }
}

.select { position: relative; }
.select .field__input { padding-right: 48px; cursor: pointer; }
.select svg {
  position: absolute;
  top: 50%; right: 16px;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--c-slate-500);
}

/* ---------- Lead form ---------- */
.lead-form { display: grid; gap: 16px; }
.lead-form__fields { display: grid; gap: 14px; }
.lead-form__note { font-size: var(--fs-xs); color: var(--c-muted); text-align: center; }

.lead-form.is-done > :not(.form-result) { display: none; }
.lead-form.is-sending { cursor: progress; }

@media (max-width: 767px) {
  .lead-form { gap: 14px; }
  .lead-form__fields { gap: 10px; }
}

.form-result {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 12px 0;
  text-align: center;
  animation: pop .5s var(--ease-out);
}
.form-result__icon {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--c-green-500);
  color: #fff;
}
.form-result__icon svg { width: 30px; height: 30px; }
.form-result--warn .form-result__icon { background: #ffd666; color: var(--c-navy-900); }
.form-result__title { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 700; }
.form-result__text { color: var(--c-muted); max-width: 36ch; }
.section--dark .form-result__text { color: rgba(255, 255, 255, .72); }

@keyframes pop {
  from { opacity: 0; transform: scale(.94) translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Dialog (native <dialog>): desktopda markazda, telefonda bottom sheet ---------- */
.modal {
  width: min(100% - 24px, 480px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}
.modal::backdrop {
  background: rgba(0, 12, 23, .62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal[open] { animation: modal-in .38s var(--ease-out); }
.modal[open]::backdrop { animation: fade-in .3s var(--ease); }
.modal.is-closing { animation: modal-out .22s var(--ease) forwards; }
.modal.is-closing::backdrop { animation: fade-out .22s var(--ease) forwards; }

@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }

.modal__box {
  position: relative;
  padding: 36px clamp(20px, 5vw, 36px) 28px;
}
.modal__grabber { display: none; }

.modal__close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--c-bg);
  color: var(--c-navy-900);
  transition: background var(--dur-fast) var(--ease), transform var(--dur) var(--ease);
}
.modal__close svg { width: 20px; height: 20px; }

.modal__head { display: grid; justify-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.modal__mark { width: 24px; height: 41px; color: var(--c-navy-900); }
.modal__title { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.625rem); max-width: 18ch; }
.modal__text { color: var(--c-muted); max-width: 32ch; }
.modal:has(.lead-form.is-done) .modal__head { display: none; }

@media (hover: hover) {
  .modal__close:hover { background: var(--c-line); transform: rotate(90deg); }
}

@media (max-width: 767px) {
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 20px);
    margin: auto 0 0;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -12px 40px -12px rgba(0, 21, 40, .35);
    transition: transform .35s var(--ease-out);
  }
  .modal[open] { animation: sheet-in .5s var(--ease-out); }
  .modal.is-closing { animation: sheet-out .26s var(--ease) forwards; }
  .modal__box { padding: 34px 20px calc(20px + env(safe-area-inset-bottom)); }
  .modal__grabber {
    position: absolute;
    top: 8px; left: 50%;
    display: block;
    width: 38px; height: 5px;
    margin-left: -19px;
    border-radius: 3px;
    background: var(--c-slate-300);
  }
  .modal__close { top: 14px; right: 14px; width: 34px; height: 34px; }
  .modal__close svg { width: 17px; height: 17px; }
  .modal__head { gap: 8px; margin-bottom: 18px; }
  .modal__mark { width: 20px; height: 34px; }
  .modal__title { font-size: 1.25rem; }
  .modal__text { font-size: var(--fs-sm); }
}

/* ---------- Promo popup: birinchi tashrifda 7 soniyadan keyin ---------- */
.modal--promo { width: min(100% - 24px, 440px); }
.modal--promo .modal__box {
  padding-top: 40px;
  background:
    radial-gradient(70% 46% at 50% 0%, rgba(118, 184, 42, .2), transparent 70%),
    linear-gradient(180deg, var(--c-sky-50), var(--c-surface) 44%);
}

.promo-pop__head {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 22px;
  text-align: center;
}
/* Shtamp atrofida miltillovchi romblar */
.promo-pop__head::before,
.promo-pop__head::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 10px; height: 10px;
  background: var(--c-green-500);
  transform: rotate(45deg);
  animation: twinkle 2.4s var(--ease) infinite;
}
.promo-pop__head::before { left: calc(50% - 82px); }
.promo-pop__head::after { left: calc(50% + 70px); top: 56px; width: 7px; height: 7px; animation-delay: 1.2s; }

.promo-pop__stamp {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px; height: 96px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--c-green-500);
  color: var(--c-navy-900);
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -.02em;
  box-shadow: 0 18px 32px -14px rgba(63, 111, 16, .75);
  transform: rotate(-10deg);
}
.promo-pop__stamp::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed rgba(63, 111, 16, .45);
  animation: spin 18s linear infinite;
}

.promo-pop__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  color: var(--c-green-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(118, 184, 42, .35), var(--shadow-sm);
}
.promo-pop__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-green-500);
  animation: pulse 1.8s var(--ease) infinite;
}
.promo-pop__title { font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem); max-width: 15ch; }
.promo-pop__text { max-width: 34ch; font-size: var(--fs-sm); color: var(--c-muted); }
.modal--promo:has(.lead-form.is-done) .promo-pop__head { display: none; }

/* Ochilish ketma-ketligi: shtamp "urib" tushadi, qolganlari navbat bilan ko'tariladi */
.modal--promo[open] .promo-pop__stamp { animation: stamp-in .8s var(--ease-spring) .12s both; }
.modal--promo[open] .promo-pop__head > :not(.promo-pop__stamp),
.modal--promo[open] .lead-form > * { animation: rise .6s var(--ease-out) both; }
.modal--promo[open] .promo-pop__chip { animation-delay: .22s; }
.modal--promo[open] .promo-pop__title { animation-delay: .28s; }
.modal--promo[open] .promo-pop__text { animation-delay: .34s; }
.modal--promo[open] .lead-form > :nth-child(2) { animation-delay: .4s; }
.modal--promo[open] .lead-form > :nth-child(3) { animation-delay: .46s; }
.modal--promo[open] .lead-form > :nth-child(4) { animation-delay: .52s; }
.modal--promo[open] .btn--primary::after { animation: shine 1.1s var(--ease) .9s; }

@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-60deg) scale(.2); }
  to { opacity: 1; transform: rotate(-10deg) scale(1); }
}
@keyframes twinkle {
  0%, 100% { opacity: .25; transform: rotate(45deg) scale(.6); }
  50% { opacity: 1; transform: rotate(45deg) scale(1); }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(118, 184, 42, .55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(118, 184, 42, 0); }
}
@keyframes shine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

@media (max-width: 767px) {
  .modal--promo { width: 100%; }
  .modal--promo .modal__box { padding-top: 36px; }
  .promo-pop__head { gap: 10px; margin-bottom: 18px; }
  .promo-pop__stamp { width: 80px; height: 80px; font-size: 1.375rem; }
  .promo-pop__head::before { left: calc(50% - 70px); }
  .promo-pop__head::after { left: calc(50% + 60px); top: 48px; }
  .promo-pop__title { font-size: 1.375rem; }
}

/* ---------- Carousel ---------- */
.carousel { position: relative; }
.carousel__track {
  display: flex;
  gap: clamp(12px, 2vw, 24px);
  /* Soya uchun ichki joy; salbiy margin uni oqimdan chiqaradi — bo'lim ritmi buzilmaydi */
  --track-pad-top: 8px;
  --track-pad-bottom: 24px;
  margin-block: calc(var(--track-pad-top) * -1) calc(var(--track-pad-bottom) * -1);
  padding: var(--track-pad-top) max(var(--gutter), (100vw - var(--container)) / 2) var(--track-pad-bottom);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), (100vw - var(--container)) / 2);
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * { flex: none; scroll-snap-align: start; }
.carousel__track.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.carousel__track.is-dragging * { pointer-events: none; }
.carousel__track:focus-visible { outline-offset: -3px; }

@media (max-width: 767px) {
  .carousel__track { --track-pad-top: 4px; --track-pad-bottom: 16px; }
}

.carousel-nav { display: inline-flex; gap: 10px; }
.carousel-nav__btn {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-navy-900);
  box-shadow: inset 0 0 0 1.5px var(--c-line);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.carousel-nav__btn svg { width: 20px; height: 20px; }
.carousel-nav__btn[data-carousel-prev] svg { transform: rotate(180deg); }
.carousel-nav__btn:disabled { opacity: .35; cursor: default; }

@media (hover: hover) {
  .carousel-nav__btn:hover:not(:disabled) { background: var(--c-navy-900); color: #fff; box-shadow: none; }
}

/* ---------- Accordion ---------- */
.accordion { display: grid; gap: 12px; }
.accordion__item {
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: inset 0 0 0 1px var(--c-line);
  transition: box-shadow var(--dur) var(--ease);
}
.accordion__item[open] { box-shadow: inset 0 0 0 1.5px var(--c-green-500), var(--shadow); }
.accordion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  font-weight: 600;
  font-size: var(--fs-md);
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.accordion__head::-webkit-details-marker { display: none; }
.accordion__head svg {
  flex: none;
  width: 36px; height: 36px;
  padding: 8px;
  border-radius: 50%;
  background: var(--c-bg);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.accordion__item[open] .accordion__head svg { transform: rotate(180deg); background: var(--c-green-500); color: #fff; }
.accordion__body { padding: 0 22px 22px; color: var(--c-slate-600); }
.accordion__body p { max-width: 64ch; }

/* Telefon: iOS "inset grouped" ro'yxat */
@media (max-width: 767px) {
  .accordion {
    gap: 0;
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .accordion__item,
  .accordion__item[open] { border-radius: 0; box-shadow: none; }
  .accordion__item + .accordion__item .accordion__head {
    background: linear-gradient(var(--c-line), var(--c-line)) 16px 0 / calc(100% - 16px) 1px no-repeat;
  }
  .accordion__head { gap: 12px; padding: 15px 16px; font-size: var(--fs-sm); }
  .accordion__head:active { background-color: var(--c-bg); }
  .accordion__head svg { width: 28px; height: 28px; padding: 6px; }
  .accordion__body { padding: 0 16px 16px; font-size: var(--fs-sm); }
}
