:root {
  --bg: #f7f7fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #7b8190;
  --line: #d8dbe6;
  --blue: #075dc8;
  --blue-dark: #044aa3;
  --soft-blue: #eef5ff;
  --shadow: 0 24px 70px rgba(39, 55, 94, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 0 7.5vw;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 251, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-name {
  font-size: 23px;
  font-weight: 950;
  letter-spacing: 0;
}

.top-nav {
  display: inline-flex;
  align-items: center;
  gap: 28px;
}

.top-nav a,
.ghost-button {
  color: var(--ink);
  border: 0;
  background: transparent;
  text-decoration: none;
  font-weight: 650;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 25px;
  color: #fff;
  border-radius: 999px;
  background: var(--blue);
}

.home-shell {
  width: min(1000px, calc(100% - 36px));
  margin: 0 auto;
  padding: 86px 0 72px;
}

.guest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 34px;
  padding: 14px 16px 14px 20px;
  border: 1px solid #c7d8f5;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.guest-banner strong,
.guest-banner span {
  display: block;
}

.guest-banner strong {
  margin-bottom: 3px;
}

.guest-banner span {
  color: var(--muted);
  font-size: 14px;
}

.guest-banner button,
.primary-login {
  min-height: 40px;
  padding: 0 18px;
  color: #fff;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  font-weight: 750;
}

.hero-composer {
  position: relative;
  display: grid;
  justify-items: center;
}

.composer-box {
  position: relative;
  display: grid;
  width: min(760px, 100%);
  min-height: 204px;
  padding: 28px 28px 18px;
  border: 2px solid var(--blue);
  border-radius: 32px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(7, 93, 200, 0.08);
}

.composer-box > span {
  color: var(--muted);
  font-size: 19px;
}

textarea {
  width: 100%;
  min-height: 76px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
  line-height: 1.45;
}

.composer-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.left-tools {
  display: inline-flex;
  gap: 14px;
}

.tool-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--blue);
  border: 0;
  background: transparent;
}

.tool-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.send-button {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  font-size: 42px;
  line-height: 1;
}

.generation-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(135px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #dfe2f0;
  border-radius: 999px;
  background: #eceefa;
}

.mode-switch button {
  min-height: 34px;
  color: #4d566b;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 650;
}

.mode-switch button.active {
  color: var(--blue-dark);
  background: #fff;
  box-shadow: 0 8px 18px rgba(38, 54, 90, 0.08);
}

.size-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 6px 4px 16px;
  border: 1px solid #dfe2f0;
  border-radius: 999px;
  background: #fff;
}

.size-select span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.size-select select {
  min-height: 34px;
  padding: 0 24px 0 10px;
  color: var(--blue-dark);
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: #eef4ff;
  font-weight: 850;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 48px;
}

.quick-actions button,
.section-heading button,
.template-tabs button {
  min-height: 40px;
  padding: 0 20px;
  color: #202839;
  border: 1px solid #cfd3df;
  border-radius: 999px;
  background: #fff;
  font-weight: 650;
}

.quick-actions button:hover,
.section-heading button:hover,
.template-tabs button.active,
.template-card:hover {
  border-color: var(--blue);
}

.templates-panel,
.account-preview {
  margin-top: 34px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.templates-panel {
  display: none;
}

.templates-panel.is-open {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading p,
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

.template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

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

.template-card {
  display: grid;
  grid-template-rows: 130px auto auto 1fr;
  gap: 9px;
  min-height: 280px;
  padding: 10px 10px 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.template-card strong {
  display: block;
  padding: 0 6px;
}

.template-card strong {
  margin-top: 2px;
  font-size: 16px;
}

.template-prompt-label {
  width: max-content;
  margin-left: 6px;
  padding: 4px 8px;
  color: var(--blue-dark);
  border-radius: 999px;
  background: #eef4ff;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-prompt {
  display: block;
  padding: 0 6px;
  color: var(--muted);
  line-height: 1.35;
}

.template-cover {
  display: block;
  width: 100%;
  min-height: 130px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 72% 30%, rgba(255, 255, 255, 0.84), transparent 22%),
    linear-gradient(135deg, #dcecff, #fff6e8);
}

.photo-studio {
  background:
    radial-gradient(circle at 50% 38%, #ffffff 0 16%, transparent 17%),
    linear-gradient(135deg, #dbeafe, #fef3c7);
}

.photo-social {
  background:
    radial-gradient(circle at 64% 34%, #ffc7d1 0 12%, transparent 13%),
    linear-gradient(135deg, #e0f2fe, #f5d0fe);
}

.photo-business {
  background:
    linear-gradient(90deg, transparent 0 42%, rgba(255,255,255,.9) 42% 58%, transparent 58%),
    linear-gradient(135deg, #dbeafe, #d1fae5);
}

.photo-cinema {
  background:
    radial-gradient(circle at 78% 22%, #facc15 0 10%, transparent 11%),
    linear-gradient(145deg, #f8b4a2 0 28%, #7dd3fc 29% 54%, #1d4ed8 55% 100%);
}

.mockup-logo {
  background:
    radial-gradient(circle at 45% 45%, #ffffff 0 20%, transparent 21%),
    linear-gradient(135deg, #dbeafe, #e5e7eb);
}

.mockup-banner {
  background:
    linear-gradient(90deg, #ffffff 0 64%, transparent 64%),
    linear-gradient(135deg, #bfdbfe, #fde68a);
}

.mockup-pack {
  background:
    linear-gradient(135deg, transparent 0 35%, rgba(255,255,255,.85) 35% 62%, transparent 62%),
    linear-gradient(135deg, #e0e7ff, #ccfbf1);
}

.mockup-service {
  background:
    radial-gradient(circle at 35% 42%, rgba(255,255,255,.9) 0 18%, transparent 19%),
    linear-gradient(135deg, #fef3c7, #bfdbfe);
}

.market-main {
  background:
    radial-gradient(circle at 50% 42%, #ffffff 0 24%, transparent 25%),
    linear-gradient(135deg, #f8fafc, #dbeafe);
}

.market-info {
  background:
    linear-gradient(90deg, #ffffff 0 28%, transparent 28% 36%, #ffffff 36% 64%, transparent 64% 72%, #ffffff 72%),
    linear-gradient(135deg, #dbeafe, #dcfce7);
}

.market-set {
  background:
    radial-gradient(circle at 28% 35%, #ffffff 0 12%, transparent 13%),
    radial-gradient(circle at 72% 35%, #ffffff 0 12%, transparent 13%),
    radial-gradient(circle at 50% 70%, #ffffff 0 12%, transparent 13%),
    linear-gradient(135deg, #fef3c7, #e0f2fe);
}

.market-life {
  background:
    radial-gradient(circle at 60% 38%, rgba(255,255,255,.9) 0 18%, transparent 19%),
    linear-gradient(135deg, #dcfce7, #fef3c7);
}

.interior-scandi {
  background:
    linear-gradient(90deg, #ffffff 0 34%, transparent 34% 66%, #ffffff 66%),
    linear-gradient(135deg, #f8fafc, #dbeafe);
}

.interior-minimal {
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(255,255,255,.82) 45% 60%, transparent 60%),
    linear-gradient(135deg, #e5e7eb, #bfdbfe);
}

.interior-kitchen {
  background:
    linear-gradient(0deg, rgba(255,255,255,.85) 0 32%, transparent 32%),
    linear-gradient(135deg, #dbeafe, #fef3c7);
}

.interior-staging {
  background:
    radial-gradient(circle at 38% 46%, rgba(255,255,255,.9) 0 18%, transparent 19%),
    linear-gradient(135deg, #ede9fe, #dbeafe);
}

.account-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}

.pricing-intro {
  grid-column: 1 / -1;
}

.account-preview p:not(.eyebrow),
.plan-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.plan-card,
.credits-card,
.free-card {
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: var(--soft-blue);
}

.plan-card {
  border: 1px solid #c7dcff;
  background: #fff;
}

.best-plan {
  color: #fff;
  border-color: var(--blue);
  background: linear-gradient(145deg, var(--blue), #063f8f);
  box-shadow: 0 20px 50px rgba(7, 93, 200, 0.22);
}

.premium-plan {
  border-color: #b9cff7;
  background: linear-gradient(145deg, #ffffff, #edf5ff);
}

.year-plan {
  border-color: #b9cff7;
  background: linear-gradient(145deg, #ffffff, #eef6ff);
}

.year-plan .price-line s {
  color: #8993a7;
}

.best-plan p,
.best-plan .price-line span {
  color: rgba(255, 255, 255, 0.78);
}

.plan-badge {
  width: max-content;
  padding: 6px 10px;
  color: var(--blue-dark);
  border-radius: 999px;
  background: #eaf2ff;
  font-size: 12px;
  font-weight: 850;
}

.best-plan .plan-badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.plan-card h3,
.credits-card h3 {
  margin: 0;
  font-size: 21px;
}

.price-line {
  display: grid;
  gap: 2px;
}

.price-line strong {
  font-size: 27px;
  line-height: 1;
}

.price-line s {
  color: rgba(255, 255, 255, 0.62);
  font-size: 18px;
  font-weight: 700;
}

.price-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan-card button {
  min-height: 40px;
  color: #fff;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  font-weight: 800;
}

.best-plan button {
  color: var(--blue-dark);
  background: #fff;
}

.credits-card {
  grid-column: span 2;
  background: #fff;
  border: 1px solid var(--line);
}

.credit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.credit-list span {
  display: block;
  padding: 8px 10px;
  color: #364154;
  border-radius: 10px;
  background: #f5f7fc;
  font-size: 14px;
  font-weight: 700;
}

.free-card {
  grid-column: span 2;
  justify-items: center;
  text-align: center;
}

.free-card strong {
  color: var(--blue);
  font-size: 48px;
  line-height: 1;
}

.free-card span {
  color: #42506a;
  font-weight: 650;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.42);
}

.seo-section {
  margin-top: 34px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
}

.seo-section h2 {
  max-width: 760px;
  margin-bottom: 10px;
}

.seo-section p {
  max-width: 790px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-modal.is-open {
  display: grid;
}

.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.26);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f2f8;
  font-size: 22px;
}

.auth-card h2 {
  margin-top: 0;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.45;
}

.auth-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.auth-options button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 750;
}

.email-login {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.email-login span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.email-login input {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
}

.auth-message {
  min-height: 20px;
  margin: 4px 0 12px;
  color: #1f5fbd;
  font-size: 14px;
  font-weight: 650;
}

.auth-message.is-error {
  color: #dc2626;
}

.primary-login {
  width: 100%;
}

.primary-login:disabled {
  cursor: wait;
  opacity: 0.72;
}

@media (max-width: 760px) {
  .app-header {
    min-height: 70px;
    padding: 0 12px;
  }

  .brand-name {
    font-size: 18px;
  }

  .top-nav {
    gap: 8px;
    font-size: 13px;
  }

  .top-nav a {
    min-height: 34px;
    padding: 0 12px;
  }

  .home-shell {
    width: calc(100% - 28px);
    padding-top: 54px;
  }

  .guest-banner,
  .section-heading,
  .account-preview {
    grid-template-columns: 1fr;
    align-items: stretch;
    flex-direction: column;
  }

  .guest-banner {
    display: grid;
  }

  .composer-box {
    min-height: 226px;
    padding: 22px 20px 16px;
    border-radius: 24px;
  }

  .composer-box > span,
  textarea {
    font-size: 16px;
  }

  .mode-switch {
    width: 100%;
  }

  .generation-controls {
    width: 100%;
    margin-top: 24px;
  }

  .size-select {
    width: 100%;
    justify-content: space-between;
  }

  .quick-actions {
    margin-top: 28px;
  }

  .quick-actions button {
    width: 100%;
  }

  .template-grid,
  .account-preview {
    grid-template-columns: 1fr;
  }

  .pricing-intro {
    grid-column: auto;
  }

  .credits-card,
  .free-card {
    grid-column: auto;
  }

  .credit-list {
    grid-template-columns: 1fr;
  }
}
