* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, #293bff24, transparent 34%),
    radial-gradient(circle at top right, #ff7a1822, transparent 32%),
    #0b0d12;
  color: #f5f7fb;
}

body.modal-open {
  overflow: hidden;
}

.page {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 56px 0;
}

.hidden {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 42px;
}

.brand-button,
.secondary-button {
  border: 1px solid #ffffff18;
  background: #ffffff10;
  color: #f5f7fb;
  box-shadow: none;
}

.brand-button {
  padding: 12px 16px;
}

.secondary-button {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.guest-limit {
  color: #a9b0c2;
  font-size: 13px;
  font-weight: 800;
}

.hero {
  text-align: center;
  margin-bottom: 42px;
}

.badge {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #ffffff22;
  border-radius: 999px;
  color: #b9c4ff;
  background: #ffffff0d;
  margin-bottom: 18px;
  font-size: 14px;
}

h1 {
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.95;
  margin: 0 auto 18px;
  max-width: 980px;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 620px;
  margin: 0 auto;
  color: #a9b0c2;
  font-size: 18px;
  line-height: 1.6;
}

.carousel-wrap {
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid #ffffff12;
  background: #ffffff08;
  padding: 18px 0;
  margin-bottom: 44px;
}

.carousel-track {
  display: flex;
  gap: 18px;
  width: max-content;
  animation: scroll-left 45s linear infinite;
}

.carousel-wrap:hover .carousel-track {
  animation-play-state: paused;
}

@keyframes scroll-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.gallery-section h2 {
  margin: 0 0 20px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.scenario-card {
  min-height: 190px;
  padding: 20px;
  text-align: left;
  border: 1px solid #ffffff18;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff12, #ffffff08);
  color: #f5f7fb;
  box-shadow: 0 18px 55px #0000003d;
  cursor: pointer;
  transition: 0.2s ease;
  position: relative;
}

.scenario-card:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: #8fa2ff88;
  box-shadow: 0 26px 70px #00000066;
}

.scenario-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.scenario-card.compact {
  width: 240px;
  min-height: 205px;
  flex: 0 0 auto;
}

.scenario-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, #ffffff14, #ffffff05),
    repeating-linear-gradient(135deg, #ffffff0c 0 10px, transparent 10px 20px);
  border: 1px solid #ffffff12;
  position: relative;
}

.scenario-image::after {
  content: attr(data-title);
  color: #cbd2e8;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 0 14px;
}

.scenario-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scenario-image.is-missing img {
  display: none;
}

.scenario-image:not(.is-missing)::after {
  display: none;
}

.scenario-icon.large {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, #ffffff14, #ffffff05),
    repeating-linear-gradient(135deg, #ffffff0c 0 12px, transparent 12px 24px);
  border: 1px solid #ffffff12;
  position: relative;
}

.scenario-icon.large::after {
  content: attr(data-title);
  color: #cbd2e8;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.scenario-icon.large img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scenario-icon.large.is-missing img {
  display: none;
}

.scenario-icon.large:not(.is-missing)::after {
  display: none;
}

.scenario-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.scenario-card p {
  margin: 0;
  color: #a9b0c2;
  line-height: 1.45;
  font-size: 14px;
}

.soon {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #ffffff14;
  color: #b9c4ff;
  font-size: 12px;
  font-weight: 800;
}

.back-button {
  margin-bottom: 24px;
  background: #ffffff10;
  color: #f5f7fb;
  border: 1px solid #ffffff18;
}

.generate-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.auth-layout,
.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.scenario-preview-card,
.form-card,
.profile-card,
.history-section {
  padding: 26px;
  border: 1px solid #ffffff18;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px #00000066;
}

.scenario-preview-card h1 {
  font-size: 48px;
  margin: 18px 0 12px;
}

.scenario-preview-card p {
  color: #a9b0c2;
  font-size: 18px;
  line-height: 1.6;
}

.form-card {
  display: grid;
  gap: 18px;
}

.form-card h2,
.history-section h2 {
  margin: 0;
  font-size: 28px;
}

.profile-card {
  display: grid;
  gap: 16px;
}

.profile-card h1 {
  font-size: 48px;
  margin: 0;
  letter-spacing: -0.04em;
}

.profile-card p {
  margin: 0;
  color: #a9b0c2;
}

.section-label {
  color: #b9c4ff;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #d5daf0;
  font-size: 14px;
  font-weight: 800;
}

.file-field {
  cursor: pointer;
}

.file-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-content {
  min-height: 150px;
  padding: 24px;
  border-radius: 18px;
  border: 1px dashed #ffffff40;
  background: #111622;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  transition: 0.2s ease;
}

.dropzone-content strong {
  max-width: 100%;
  color: #f5f7fb;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.dropzone-content small {
  color: #a9b0c2;
  font-size: 13px;
  line-height: 1.4;
}

.file-field:hover .dropzone-content,
.file-field.is-dragging .dropzone-content {
  border-color: #8fa2ff;
  background: #151c2d;
  box-shadow: 0 0 0 4px #8fa2ff22;
}

.file-field.has-file .dropzone-content {
  border-style: solid;
  border-color: #8fa2ff66;
}

.count-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.count-option {
  padding: 14px 16px;
  border: 1px solid #ffffff22;
  border-radius: 16px;
  background: #111622;
  color: #d5daf0;
  box-shadow: none;
}

.count-option:hover {
  border-color: #8fa2ff88;
}

.count-option.active {
  background: linear-gradient(135deg, #8fa2ff, #ff9b54);
  border-color: transparent;
  color: #10131a;
}

.google-button {
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #ffffff22;
  background: #111622;
  color: #f5f7fb;
  text-decoration: none;
  font-weight: 900;
}

.google-button.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

input,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #ffffff22;
  background: #111622;
  color: #f5f7fb;
  font-size: 15px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #8fa2ff;
  box-shadow: 0 0 0 4px #8fa2ff22;
}

button {
  padding: 16px 20px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #8fa2ff, #ff9b54);
  color: #10131a;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
}

.status {
  min-height: 24px;
  color: #b9c4ff;
  text-align: center;
  font-weight: 800;
}

.results-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.result-card {
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff0d;
  border: 1px solid #ffffff18;
  box-shadow: 0 20px 60px #00000055;
}

.result-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.result-footer {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
}

.result-footer a {
  color: #ffb06f;
  text-decoration: none;
  font-weight: 900;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.history-card {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #ffffff18;
  background: #ffffff0d;
  position: relative;
}

.history-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.history-card button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: #10131add;
  color: #f5f7fb;
  font-size: 12px;
  box-shadow: none;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  color: #a9b0c2;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 42px;
  display: grid;
  place-items: center;
  background: #05060bdd;
  backdrop-filter: blur(12px);
}

.image-modal.hidden {
  display: none;
}

.image-modal img {
  max-width: min(92vw, 980px);
  max-height: 86vh;
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 30px 90px #00000099;
}

.modal-close {
  position: fixed;
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: #ffffff18;
  color: #f5f7fb;
  box-shadow: none;
  font-size: 30px;
  line-height: 1;
}

.modal-close:hover {
  background: #ffffff28;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 24px;
  display: grid;
  place-items: center;
  background: #05060bdd;
  backdrop-filter: blur(12px);
}

.confirm-modal.hidden {
  display: none;
}

.confirm-card {
  width: min(420px, 92vw);
  padding: 26px;
  border-radius: 24px;
  border: 1px solid #ffffff18;
  background: #111622;
  box-shadow: 0 30px 90px #00000099;
  position: relative;
}

.confirm-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.confirm-card p {
  margin: 0 0 22px;
  color: #a9b0c2;
  line-height: 1.5;
}

.confirm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: #ffffff12;
  color: #f5f7fb;
  box-shadow: none;
  font-size: 24px;
  line-height: 1;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 980px) {
  .scenario-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .generate-layout,
  .auth-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .history-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-actions {
    justify-content: flex-start;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .scenario-card.compact {
    width: 210px;
  }

  .history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
