/* === Каркас страницы === */
.page {
  padding: 20px;
  padding-top: 10px;
}

@media (max-width: 680px) {

  .upload-card,
  .generations-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 405px !important;
    margin: 0 !important;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
  }


  .page {
    padding: 5px;
  }
}

#img-1 {
  display: block;
}

#img-2 {
  display: none;
}

.desktop-header {
  width: 100%;
  margin-bottom: 8px;
  min-width: 405px;
}

.desktop-header-inner {
  margin: 0 auto;
  width: 520px;
  display: flex;
  padding: 12px 14px;
  background: #f3f4f6;
  justify-content: space-between;
  border-radius: 14px;
  border: 2px solid #6e839547;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.user-status {
  font-size: 13px;
  color: #6b7280;
}

.user-avatar {
  position: relative;
  width: 36px;
  height: 36px;
}

@media (max-width: 680px) {
  .desktop-header-inner {
    width: 100%;
    padding: 10px 12px;
  }

  .logo-box {
    height: 42px;
    flex-shrink: 0;
  }

  .user-box {
    padding: 6px 8px;
    gap: 8px;
  }

  .user-name {
    font-size: 14px;
  }

  .user-status {
    font-size: 12px;
  }

  .results-sidebar {
    margin-top: 16px;
  }
}



.logo-box {
  height: 42px;
  margin-bottom: 10px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  align-self: center;
}

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

.field-full {
  grid-column: 1 / -1;
}

.upload-card {
  width: 520px;
  background: #fff;
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  margin: 0 auto;
  position: relative;
}

.gen-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* === Заголовок === */
.upload-header h2 {
  margin: 0 0 16px;
}

/* === Общие секции === */
.upload-section {
  margin-bottom: 16px;
}

/* === Загрузка файла === */
.upload-box {
  background: #f0f3f5;
  border: 2px dashed #5f7595;
  border-radius: 12px;
  width: 100%;
  height: 253px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-box.drag {
  border-color: #2563eb;
  background: #eff6ff;
}

.upload-box input[type="file"] {
  display: none;
}

.upload-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

/* === Кнопка выбора файла === */
.upload-btn {
  background: transparent;
  color: #7992ca;
  border: 2px solid #7992ca;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.upload-btn:hover {
  background: #7992ca;
  color: #fff;
}

.upload-btn:active {
  background: #7992ca;
  border-color: #7992ca;
}

/* === Превью === */
.preview {
  margin-bottom: 15px;
  background-color: #2b2b2b;
  border-radius: 0px;
  text-align: center;
  position: relative;
  /* ← ВОТ ЭТО */
}

/* фон внутри самого cropper */
.cropper-container {
  z-index: 1;
  background-color: #727272;
}

.preview img {
  max-width: 100%;
  border-radius: 0px;
}

#resetBtn {
  border: 1px solid #a8abae;
}

/* === Подсказки === */
.upload-hint {
  font-size: 13px;
  color: #4b5563;
}

.upload-subhint {
  font-size: 12px;
  color: #9ca3af;
}

/* === Универсальные кнопки === */
.btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
}

.btn.secondary {
  background: #f3f4f6;
}

.btn.primary {
  background: linear-gradient(90deg, #6366f1, #22c55e);
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  font-size: 15px;
}

/* === Настройки === */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field label {
  font-size: 14px;
  color: #6b7280;
}

.field input,
.field select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

/* === Футер === */
.card-footer {
  width: 100%;
  padding-top: 6px;
  margin-top: 20px;
}

.card-footer .hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
}

/* === Кнопка создания схемы === */
#btn-creat-scheme {
  margin-bottom: 10px;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  font-size: 16px;
  border: none;
  cursor: pointer;

  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease;
}

#btn-creat-scheme:hover {
  background: linear-gradient(90deg,
      #a855f7,
      #6366f1,
      #c084fc);

  box-shadow:
    0 0 5px rgba(168, 85, 247, 0.6),
    0 0 5px rgba(168, 85, 247, 0.45),
    0 0 5px rgba(168, 85, 247, 0.35);

  transform: translateY(-1px);
}



/********* ЛИСТ-ГЕНЕРАЦИИ *************/
.generations-card {
  width: 520px;
  margin: 16px auto 0;
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.generation-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.generation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.generation-body {
  display: flex;
  align-items: center;
  gap: 12px;
}


.generation-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.generation-actions {
  margin-left: auto;
  display: grid;
  justify-items: end;
  align-items: start;
  gap: 8px;
  /* чтобы было ровно по краю */
}

/* кнопка скачать */
.gen-btn.download {
  font-weight: 500;
}

/* кнопка повторить (иконка) */
.gen-btn.repeat {
  width: 32px;
  height: 32px;
  padding: 0;
  background: #fff;
  position: relative;
}

/* иконка обновления (CSS, без SVG) */
.gen-btn.repeat::before {
  content: "↻";
  font-size: 16px;
  color: #6b7280;
  display: block;
  line-height: 32px;
  text-align: center;
}

.gen-btn.repeat:hover::before {
  color: #2563eb;
}

.generation-item:not(:last-child) {
  border-bottom: 1px solid #eef1f5;
}

.gen-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.gen-btn:hover {
  background: #e0e1e6;
  color: #2563eb;
}

.generation-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.generation-info {
  display: flex;
  flex-direction: column;
}

.generation-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.generation-date {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}



/* ошибки */
.input-error {
  border-color: #e5a1a1 !important;
  background: #fffafa;
}

.error-text {
  color: #c24141;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

.page.blur {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

/** ЗАГРУЗКА ПРИМЕНИТЬ СХЕМУ ПОВТОРНО **/

#repeat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.705);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.repeat-box {
  background: #fff;
  padding: 24px 28px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.repeat-box img {

  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}


/** ЗАГРУЗКА ИЗОБРАЖЕНИЯ **/


#upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.863);
  backdrop-filter: blur(6px);
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;
}


.upload-box-ui {
  width: 320px;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .12);
  text-align: center;
}

.upload-title {
  font-size: 16px;
  margin-bottom: 16px;
}

.upload-progress {
  width: 100%;
  height: 10px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.upload-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width .15s ease;
}

.upload-percent {
  margin-top: 10px;
  font-size: 14px;
  color: #374151;
}

.borderInput {
  border-width: 3px !important;
}


.strass-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  color: #6b7280;
}

.strass-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.strass-item .label {
  font-size: 13px;
  opacity: 0.6;
}

.strass-divider {
  width: 1px;
  height: 18px;
  background: #e5e7eb;
  margin: 0 4px;
}

.strass-item.total {
  margin-left: auto;
  /* font-weight: 500; */
  color: #374151;
}

/* CROP-CONTROLL */
.crop-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 4px;
  margin-bottom: 27px;
}

.crop-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}

.crop-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.crop-btn.active {
  background: #e0e7ff;
  border-color: #6366f1;
  color: #3730a3;
}

.rotate-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.rotate-slider input[type="range"] {
  flex: 1;
}

.rotate-slider span {
  font-size: 12px;
  color: #6b7280;
  min-width: 36px;
  text-align: right;
}

#crop-hint {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
  /* ⬅️ важно */
}

.crop-hint-box {
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  max-width: 260px;
  line-height: 1.4;
}

.crop-actions {
  display: flex;
  opacity: 0.4;
  transition: opacity 0.15s ease;
  pointer-events: none;
  /* ⬅️ ВАЖНО */
}

.crop-actions.unlocked {
  opacity: 1;
  pointer-events: auto;
  /* ⬅️ ВКЛЮЧАЕМ */
}

.crop-wrapper {
  position: relative;
}

#crop-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;

  /* ключевое */
  pointer-events: all;

  background: transparent;
  display: none;
}

@keyframes blueBlink {
  0% {
    box-shadow: 0 0 0 rgba(37, 99, 235, 0);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.45);
  }

  100% {
    box-shadow: 0 0 0 rgba(37, 99, 235, 0);
  }
}

.lock-blink {
  animation: blueBlink 1s ease-in-out infinite;
  border-radius: 50%;
}


/* Кнопки переключения режимов*/
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin-top: 14px;
  gap: 10px;
}

.mode-btn {
  padding: 12px 0;
  border-radius: 12px;
  border: 1px solid #e2e6ea;
  background: #f8fafc;
  color: #4b5563;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mode-btn:hover {
  background: #f1f5f9;
}

.mode-btn.active {
  background: #e8f1ff;
  border-color: #b6d0ff;
  color: #1e40af;
  cursor: default;
}

.mode-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.advanced-filters {
  margin-top: 18px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.filter-row {
  width: 75%;
}

.filter-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #5c677e;
  margin-bottom: 6px;
}

.filter-value {
  color: #374151;
  font-weight: 500;
}

.filter-row input[type="range"] {
  width: 100%;
}

.filter-desc {
  display: block;
  font-size: 12px;
  color: #8a8a8a;
  margin: 4px 0 6px 0;
  line-height: 1.4;
}


.schemes-footer {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}

.btn-more-schemes {
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid #d6d8db;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: all 0.18s ease;
}

.btn-more-schemes:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
  border: 2px solid #727c8b;
}

.btn-more-schemes:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-more-schemes:focus {
  outline: none;
}

.no-scheme-box {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  /* вертикаль */
  justify-content: center;
  /* горизонталь */
}

.no-scheme-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}


.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.generation-loading {
  opacity: 0.85;
  padding-top: 15px;
  padding-bottom: 28px;
}

.generations-header {
  background: #eff2f4;
  /* мягкое затемнение */
  padding: 14px 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #233041;
  border-bottom: 1px solid #e5e7eb;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;

  margin-top: -16px;
  margin-left: -16px;
  margin-right: -16px;
}

.generations-header span {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
}