html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #e2e2e1;
  display: flex;
  justify-content: center;
}

.container {
  max-width: 420px;
  width: 100%;
  padding: 20px;
  text-align: center;
}

img {
  max-width: 100%;
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card {
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}

.card.active {
  border: 2px solid rgb(249, 62, 34);
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 20px;
  background: rgb(249, 62, 34);
  color: white;
  font-size: 16px;
  cursor: pointer;
}

button:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.nav {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* ===== SCREEN 1 TOP ===== */

.logo-main {
  display: block;
  margin: 50px auto 35px;
  width: 200px;
}

.title-main {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
  color: #223245;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

.subtitle-main {
  font-family: 'Carlito', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #223245;
  text-align: center;
  margin-bottom: 30px;
}

/* ===== FULLSCREEN BACKGROUNDS ===== */

body.screen1-bg { background-image: url('assets/backgrounds/bg_screen1_1.png'); background-size: cover; background-position: center; background-repeat: no-repeat; }
body.bg-screen2 { background-image: url('assets/backgrounds/bg_screen2.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed; }
body.bg-screen3 { background-image: url('assets/backgrounds/bg_screen3.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed; }
body.bg-screen4 { background-image: url('assets/backgrounds/bg_screen4.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed; }
body.bg-screen5 { background-image: url('assets/backgrounds/bg_screen5.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed; }
body.bg-screen6 { background-image: url('assets/backgrounds/bg_screen6.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed; }
body.bg-screen7 { background-image: url('assets/backgrounds/bg_screen7.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed; }

/* ===== HERO BLOCK ===== */

.hero-block {
  position: relative;
  margin-top: 20px;
  text-align: center;
}

.hero-img {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: block;
  border-radius: 20px;
}

/* КНОПКА START */

.start-btn {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);

  padding: 14px 116px;
  font-size: 16px;

  border-radius: 30px;
  border: none;

  background: rgb(249, 62, 34);
  color: white;

  cursor: pointer;
}

/* ТЕКСТ ПОД КНОПКОЙ */

.hero-note {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translateX(-50%);

  font-family: 'Carlito', sans-serif;
  font-size: 12px;
  font-style: italic;
  color: white;
}

/* ===== LANGUAGE SWITCH ===== */

.lang-switch {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  background: rgba(255,255,255,0.6);
  border-radius: 20px;
  padding: 3px;
}

.lang-btn {
  padding: 5px 12px;
  font-family: 'Carlito', sans-serif;
  font-size: 12px;
  color: #223245;
  cursor: pointer;
  border-radius: 15px;
  transition: 0.2s;
}

.lang-btn.active {
  background: rgb(249, 62, 34);
  color: white;
}
/* ===== SCREENS ===== */

.screen {
  display: block;
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== TOP BAR ===== */

.top-bar {
  padding: 15px 0 10px;
}

/* строка: логотип + шаг */
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* логотип маленький */
.logo-small {
  width: 110px;
}

/* текст шага */
.step-text {
  display: flex;
  gap: 5px;
  align-items: center;
}

/* Step */
.step-label {
  font-family: 'Carlito', sans-serif;
  font-size: 12px;
  color: #223245;
}

/* 1 of 5 */
.step-count {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: #223245;
}

/* ===== PROGRESS BAR ===== */

.progress-bar {
  margin-top: 10px;
  width: 100%;
  height: 6px;
  background: #d9d9d9;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: rgb(249, 62, 34);
  border-radius: 10px;
}

/* ===== UPLOAD BUTTON ===== */

.upload-btn {
  margin: 20px;
  padding: 16px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  background: rgb(249, 62, 34);
  color: white;

  font-family: 'Carlito', sans-serif;
  font-size: 14px;

  border-radius: 30px;
  cursor: pointer;
}

.upload-icon {
  width: 18px;
}

.screen-label {
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  margin: 15px 0;
  color: #223245;
}


.hero-slider {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 20px auto;
  cursor: pointer;
}

.slide {
  width: 100%;
  border-radius: 20px;
  display: none;
}

.slide.active {
  display: block;
}

.next-btn {
  opacity: 0.3;
  pointer-events: none;
}

.next-btn.active {
  opacity: 1;
  pointer-events: auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;

  aspect-ratio: 1 / 1; /* 👈 ВОТ ЭТО ГЛАВНОЕ */
}

.card-tall {
  aspect-ratio: 4 / 5;
}

.card-wide {
  aspect-ratio: 16 / 9;
}

.sub-label {
  font-family: 'Carlito', sans-serif;
  font-size: 12px;
  font-style: italic;
  color: #223245;
  margin-top: -10px;
  margin-bottom: 15px;
  text-align: left;
}

.summary-list {
  font-family: 'Carlito', sans-serif;
  font-size: 16px;
  color: #223245;
  text-align: left;
  background: white;
  border-radius: 15px;
  padding: 15px;
  margin: 15px 0 20px;
  line-height: 1.5;
}

.summary-item {
  margin-bottom: 8px;
}
.card {
  transition: 0.2s;
}

.card:hover {
  transform: scale(1.03);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Плашка */
.card-label {
  position: absolute;
  top: 15px;
  left: 0;

  padding: 6px 14px;
  text-align: left;

  background: rgba(140, 140, 140, 0.75); /* светло-серый прозрачный */
  color: white;

  font-family: 'Carlito', sans-serif;
  font-size: 14px;

  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}



/* контейнер можно оставить пустым */
.nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: space-between;
  z-index: 100;
  pointer-events: none;
}

/* ОБЩИЙ СТИЛЬ КНОПОК */
.nav-btn {
  position: relative;
  width: 48px;
  height: 50px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgb(249, 62, 34);
  color: white;

  font-size: 20px;

  cursor: pointer;
  pointer-events: auto;

  transition: 0.2s;
}
.nav-next {
  opacity: 0.3;
  pointer-events: none;
}

.nav-next.active {
  opacity: 1;
  pointer-events: auto;
}

.nav-btn:active {
  transform: scale(0.95);
}

/* ===== NAV BUTTON POSITIONS ===== */

.nav-back {
  border-top-right-radius: 50px;
  border-bottom-right-radius: 50px;
}

.nav-next {
  border-top-left-radius: 50px;
  border-bottom-left-radius: 50px;
}

/* ===== RESULTS GRID & SPINNER ===== */

.results-grid {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.result-card {
  position: relative;
  width: 50%;
  aspect-ratio: 4 / 5;
  background: #ccc;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Полупрозрачное затемнение на время загрузки */
.result-card.loading::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  z-index: 1;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.sub-label-wait {
  text-align: left;
  margin-bottom: 20px;
  color: rgb(249, 62, 34);
  font-weight: 600;
  font-style: normal;
}

/* ===== RESULTS SELECTION ===== */

.result-card {
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-sizing: border-box;
  border: 2px solid transparent;
}

.result-card.selected {
  border: 2px solid rgb(249, 62, 34);
  box-shadow: 0 4px 10px rgba(249, 62, 34, 0.25);
}

.result-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.result-card.selected img {
  opacity: 1;
}

/* ===== RECOMMENDATIONS BLOCK ===== */

.reco-block {
  margin-top: 20px;
  background: white;
  border-radius: 18px;
  padding: 16px;
}

.reco-text {
  font-family: 'Carlito', sans-serif;
  font-size: 14px;
  color: #223245;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.3s ease;
}

.reco-text.reco-expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.reco-toggle {
  background: none;
  border: none;
  color: rgb(249, 62, 34);
  font-family: 'Carlito', sans-serif;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0 0;
  display: block;
  margin-top: 6px;
}

/* ===== MODAL OVERLAY ===== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: 20px;
  padding: 24px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}

.modal-text {
  font-family: 'Carlito', sans-serif;
  font-size: 14px;
  color: #223245;
  line-height: 1.5;
  margin-bottom: 12px;
}

.modal-question {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #223245;
  margin-bottom: 20px;
}

.modal-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn-no {
  background: #e2e2e1;
  color: #223245;
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  font-family: 'Carlito', sans-serif;
  font-size: 14px;
  cursor: pointer;
}

.modal-btn-yes {
  background: rgb(249, 62, 34);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  font-family: 'Carlito', sans-serif;
  font-size: 14px;
  cursor: pointer;
}

/* ===== RETRY UI ===== */
.retry-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.1);
}

.retry-btn {
  background: rgb(249, 62, 34);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 15px;
  font-family: 'Carlito', sans-serif;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(249, 62, 34, 0.3);
  transition: transform 0.2s, background 0.2s;
}

.retry-btn:active {
  transform: scale(0.95);
}

.error-msg {
  font-family: 'Carlito', sans-serif;
  font-size: 14px;
  color: #223245;
  margin-bottom: 12px;
  font-weight: bold;
}

.support-btn {
  background: #223245;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 15px;
  font-family: 'Carlito', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-transform: uppercase;
}

.result-card.loading .spinner {
  margin-bottom: 20px;
}

/* ===== IMAGE FULLSCREEN MODAL ===== */

.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.image-modal.active {
  display: flex;
}

.modal-content {
  display: block;
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  cursor: pointer;
  animation: zoomImg 0.3s ease-out;
  box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

@keyframes zoomImg {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #fff;
  font-size: 44px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: 0.2s;
  line-height: 1;
}

.close-modal:hover {
  color: rgb(249, 62, 34);
}

/* ===== TOOLTIP ===== */
.tooltip {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}

.tooltip-icon {
  width: 16px;
  height: 16px;
  background: #aaaaaa;
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Carlito', sans-serif;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.tooltip-text {
  visibility: hidden;
  width: 250px;
  background-color: white;
  color: #223245;
  text-align: left;
  border-radius: 12px;
  padding: 15px;
  font-family: 'Carlito', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  font-weight: normal;
  text-transform: none;
  box-shadow: 0px 4px 15px rgba(0,0,0,0.15);
  
  position: absolute;
  z-index: 10;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%);
  
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

.tooltip:hover .tooltip-text,
.tooltip:active .tooltip-text {
  visibility: visible;
  opacity: 1;
}
