/* Bootstrap-first: минимальные кастомные стили + совместимость с твоим JS
   ВАЖНО: функционал и эндпоинты не менялись, это только оформление/UX правки.
*/

:root {
  --app-bg: #eef2f6;
  --brand: #ff7a33;
  --brand2: #ff6a23;
}

.bg-app {
  background: var(--app-bg);
}

/* Старый helper остаётся (JS использует .hidden) */
.hidden { display: none !important; }

/* Лёгкий "disabled" вид для блоков */
.disabled {
  opacity: .55;
  filter: grayscale(.08);
}

.disabled input,
.disabled button,
.disabled select,
.disabled textarea {
  pointer-events: none;
}

/* Маленький бренд-марк */
.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 18px rgba(15, 23, 42, .12);
}

/* Upload badge */
.upload-badge {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 18px rgba(15, 23, 42, .14);
}

.upload-badge-sm {
  width: 38px;
  height: 38px;
}

/* Color dots (сохраняем механику выбора) */
.color-dot{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid rgba(15,23,42,.12);
  background: var(--dot);
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(15,23,42,.10);
  transition: transform .06s ease, border-color .15s ease;
}
.color-dot:active{ transform: translateY(1px); }

.color-btn-selected{
  border-color: rgba(255,122,51,.95);
  box-shadow: 0 12px 22px rgba(255,122,51,.20);
}

/* Custom color dot чуть заметнее */
.color-btn-custom{
  position: relative;
  border-radius: 10px;
}
.color-btn-custom::after{
  content:"";
  position:absolute;
  inset:-3px;
  border-radius: 999px;
  border: 2px rgba(15,23,42,.18);
  pointer-events:none;
}

/* Pills: JS ставит .selected */
.pill.selected {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--brand), var(--brand2)) !important;
  box-shadow: 0 10px 20px rgba(255,122,51,.22);
}

/* Preview */
.preview-shell {
  border-radius: 16px;
  background: #f1f5f9; /* серое поле */
  border: 1px solid rgba(15,23,42,.08);
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* thumbs */
.thumb{
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 10px 18px rgba(15,23,42,.10);
}

/* Немного более "brand" primary */
.btn-primary{
  border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}
.btn-primary:hover{
  filter: brightness(.98);
}

.result-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}


/* =========================
   Segmented UI (premium)
   ========================= */

:root{
  /* base palette */
  --ui-bg: #eef2f6;
  --ui-card: #ffffff;
  --ui-track: #e7edf3;          /* светло-серый трек */
  --ui-border: rgba(15,23,42,.08);
  --ui-text: #64748b;
  --ui-text-active: #0f172a;

  /* accent */
  --ui-accent: #ff7a33;
  --ui-ring: rgba(255,122,51,.22);

  /* sizing (компактнее) */
  --seg-h: 38px;               /* было 46 */
  --seg-pad: 6px;              /* было 10 */
  --seg-gap: 6px;              /* было 10 */
  --seg-radius: 18px;          /* аккуратные скругления */
  --seg-pill-radius: 14px;
  --seg-font: 650;

  /* shadows (меньше “навязчивости”) */
  --seg-shadow: 0 10px 24px rgba(15,23,42,.06);
  --pill-shadow: 0 6px 14px rgba(15,23,42,.10);
}


/* ======= Tabs segmented (better) ======= */
.tabs-seg{
  position: relative;
  background: linear-gradient(180deg, #edf2f7 0%, #e7edf3 100%);
  padding: var(--seg-pad);
  border-radius: calc(var(--seg-radius) + 6px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--seg-gap);
  border: 1px solid var(--ui-border);
  box-shadow: var(--seg-shadow), inset 0 1px 0 rgba(255,255,255,.85);
  overflow: hidden;
  border-color: rgba(15,23,42,.10);
}

.tabs-seg .nav-item{
  flex: 1 1 140px;     /* компактнее */
  min-width: 140px;
}

.tabs-seg .nav-link{
  width: 100%;
  height: var(--seg-h);
  border-radius: var(--seg-pill-radius);
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--ui-text) !important;
  font-weight: var(--seg-font);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .10s ease;
}

.tabs-seg .nav-link:hover{
  background: rgba(255,255,255,.55) !important;
  color: #475569 !important;
}

.tabs-seg .nav-link.active{
  background: #fff !important;
  color: var(--ui-text-active) !important;
  border-color: rgba(15,23,42,.06) !important;
  box-shadow: var(--pill-shadow), inset 0 1px 0 rgba(255,255,255,.95);
  position: relative;
}

.tabs-seg .nav-link.active::after{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: var(--seg-pill-radius);
  box-shadow: 0 0 0 1px rgba(255,122,51,.10) inset; /* тонкий оранжевый намёк */
  pointer-events:none;
}

.tabs-seg .nav-link:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--ui-ring);
}



/* ======= Segmented switch (btn-check + label.btn) ======= */
.seg-switch{
  background: linear-gradient(180deg, #edf2f7 0%, #e7edf3 100%);
  padding: var(--seg-pad);
  border-radius: calc(var(--seg-radius) + 6px);
  display: flex;
  gap: var(--seg-gap);
  border: 1px solid var(--ui-border);
  box-shadow: var(--seg-shadow), inset 0 1px 0 rgba(255,255,255,.85);
  border-color: rgba(15,23,42,.10);
}

.seg-switch .btn{
  flex: 1 1 0;
  height: var(--seg-h);
  border-radius: var(--seg-pill-radius) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--ui-text) !important;
  font-weight: var(--seg-font);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .10s ease;
}

.card-body{
  padding: 14px !important;   /* было 20+ по дефолту bootstrap */
}

/* ===== Active pill highlight (tight / subtle) ===== */
.tabs-seg .nav-link.active,
.seg-switch .btn-check:checked + .btn{
  background: #ffffff !important;
  color: #0f172a !important;

  border: 1.5px solid #ff6e27 !important;

  box-shadow:
    0 4px 10px rgba(15,23,42,.10),      /* базовая тень */
    0 0 0 1px rgba(255,110,39,.22),     /* аккуратная линия */
    0 0 10px rgba(255,110,39,.28);       /* компактный glow */
}

.seg-switch .btn:hover:not(:checked) {
  background: rgba(255,255,255,.55) !important;
  color: #475569 !important;
}

@media (min-width: 992px) {
  .col-lg-5 {
    width: calc(41.66666667% + 1%);
  }
}

@media (min-width: 992px) {
  .col-lg-7 {
    width: calc(58.33333333% - 1%);
  }
}

.container {
  zoom: 1.1;
}

/* clickable previews */
.info-icon {
  font-size: 15px;
  cursor: pointer;
  color: #6c757d; /* text-secondary */
  transition: color .15s ease, transform .15s ease;
}

.info-icon:hover,
.info-icon:focus {
  color: var(--brand) !important; /* оранжевый из темы */
}

.disabled .info-icon {
  pointer-events: none;
  opacity: .6;
}

.disabled label {
  pointer-events: none;
  opacity: 0.6; /* опционально, для визуального эффекта */
}




.site-footer{ margin-top: auto; }

.site-footer .footer-box{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px 16px 0 0;
  padding: 18px 22px;
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.08);
}

.footer-grid{
  display: grid;
  gap: 16px 28px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.footer-group{
  display: grid;
  gap: 8px;
  min-width: 0;
}

.footer-title{
  position: relative;
  display: inline-block;
  justify-self: start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  color: rgba(15,23,42,.55);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.footer-title::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: rgba(15,23,42,.18);
}

.site-footer .footer-link{
  color: #6c757d;
  text-decoration: none;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}

.site-footer .footer-link:hover{
  color: #0d6efd;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Если хочешь, чтобы “Тарифы” чуть выделялись, но без отдельного блока */
.footer-link-strong{
  color: #0f172a;
  font-weight: 700;
}

.footer-bottom{
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(15,23,42,.08);
  display: flex;
  justify-content: center;
}

.footer-copy{
  color: #6c757d;
  font-weight: 500;
}

@media (max-width: 575.98px){
  .site-footer .footer-box{ padding: 16px; }
  .footer-grid{
    gap: 14px;
    grid-template-columns: 1fr;
  }
}




#authUserPill { position: relative; padding-right: 2.25rem; }

/* Кнопка "..." появляется на pill, но скрытие делаем с задержкой */
#authUserPill .pill-actions{
  position:absolute;
  top:.25rem;
  right:.25rem;

  opacity:0;
  pointer-events:none;

  /* важно: задержка на СКРЫТИЕ */
  transition: opacity .15s ease .25s;
}

/* показываем без задержки, и держим видимым, пока курсор на pill ИЛИ на самом actions */
#authUserPill:hover .pill-actions,
#authUserPill .pill-actions:hover{
  opacity:1;
  pointer-events:auto;
  transition-delay: 0s;
}

/* чуть меньше "три точки" */
#authUserPill .pill-actions-toggle{
  width:28px;
  height:28px;
  padding:0;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
#authUserPill .pill-actions-toggle i{
  font-size: .9rem; /* было ~1rem, уменьшаем чуть-чуть */
  line-height: 1;
}

/* меню */
#authUserPill .pill-actions-menu{
  display:none;
  position:absolute;
  top: calc(100% + .25rem);
  right: 0;
  min-width: 240px;
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:.5rem;
  padding:.25rem;
  z-index:20;
}

/* "мостик", чтобы при переводе курсора с 3 точек на меню оно не схлопнулось */
#authUserPill .pill-actions-menu::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-10px;
  height:10px;
}

/* раскрываем меню по hover на actions */
#authUserPill .pill-actions:hover .pill-actions-menu{
  display:block;
}





.cookie-consent {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 400px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: slideUp 0.3s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
  .cookie-consent {
    left: auto;
    right: 20px;
    margin: 0;
  }
}

.cookie-consent__content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.cookie-consent__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #e7f1ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d6efd;
  font-size: 18px;
}

.cookie-consent__text {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
}

.cookie-consent__button {
  flex-shrink: 0;
  padding: 6px 16px;
  font-weight: 600;
  border-radius: 20px;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-consent.d-none {
  display: none !important;
}



@media (max-width: 575.98px) {
  header .d-flex.align-items-center.justify-content-between {
    flex-wrap: wrap;
  }

  #authUserBox {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .seg-switch {
    flex-wrap: wrap;
  }

  .seg-switch .btn {
    flex: 1 1 100%;
  }

  .fw-bold.d-flex.align-items-center.gap-2,
  .form-label.text-secondary.fw-semibold.small {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  .info-icon {
    flex: 0 0 auto;
    vertical-align: middle;
  }
}

  .seg-switch {
    flex-wrap: wrap;
  }

  .seg-switch .btn {
    flex: 1 1 100%;
  }

  .fw-bold.d-flex.align-items-center.gap-2,
  .form-label.text-secondary.fw-semibold.small {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  .info-icon {
    flex: 0 0 auto;
    vertical-align: middle;
  }
}


.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 32px;
  align-items: start;
}

.footer-group {
  min-width: 0;
}

.footer-social-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-social-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.footer-social-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.footer-link {
  color: #6c7a89;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #0d6efd;
  text-decoration: none;
}

.footer-link:hover .footer-social-icon {
  color: inherit;
}

/* Если ширины мало — соцсети под "Компания" */
@media (max-width: 1100px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .footer-group-social {
    grid-column: 2 / 3;
  }
}

/* На совсем узких экранах — обычная адаптивная сетка */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-group-social {
    grid-column: auto;
  }
}