:root {
  --ink: #101828;
  --muted: #667085;
  --paper: #f3f6fb;
  --surface: #ffffff;
  --line: #d9e2ec;
  --teal: #0b7f8f;
  --teal-2: #42b7a8;
  --coral: #f0655b;
  --coral-dark: #c84a42;
  --violet: #6957d9;
  --gold: #f4b740;
  --shadow: 0 24px 70px rgba(16, 24, 40, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

.test-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 16px;
  color: #7a2e0e;
  background: #fff2cc;
  border-bottom: 1px solid #ffd27a;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.topbar {
  position: sticky;
  top: 41px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(217, 226, 236, 0.8);
  backdrop-filter: blur(18px);
}

.brand,
.nav a,
.hero-actions a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--violet));
  border-radius: 12px;
  font-size: 14px;
}

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.hero {
  display: grid;
  min-height: calc(100vh - 69px);
  grid-template-columns: minmax(0, 0.85fr) minmax(340px, 1.15fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(34px, 7vw, 86px) clamp(18px, 5vw, 76px) 46px;
  background:
    radial-gradient(circle at 12% 20%, rgba(66, 183, 168, 0.24), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(240, 101, 91, 0.18), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #edf7fb 100%);
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.02;
}

h1 {
  max-width: 650px;
  font-size: clamp(48px, 8vw, 96px);
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: #344054;
  font-size: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--coral), #ff8b64);
  box-shadow: 0 14px 28px rgba(240, 101, 91, 0.22);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--coral-dark), var(--coral));
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.full {
  width: 100%;
}

.hero-visual {
  min-height: 470px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 470px;
  object-fit: cover;
}

.studio {
  display: grid;
  grid-template-columns: minmax(300px, 0.62fr) minmax(420px, 1.38fr);
  gap: 22px;
  padding: 34px clamp(18px, 5vw, 76px) 58px;
  background: #111827;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(217, 226, 236, 0.82);
  border-radius: 22px;
  box-shadow: 0 18px 52px rgba(16, 24, 40, 0.12);
}

.form-panel,
.preview-panel {
  padding: clamp(18px, 3vw, 30px);
}

.form-panel {
  align-self: start;
}

.section-heading {
  margin-bottom: 22px;
}

form,
.checkout {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 12px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 800;
}

fieldset {
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d0d9e4;
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(11, 127, 143, 0.14);
}

textarea {
  resize: vertical;
}

.segmented,
.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented label,
.payment-methods label,
.toggle-row {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafc;
  cursor: pointer;
}

.toggle-row {
  justify-content: flex-start;
  border-radius: 14px;
}

.segmented input,
.payment-methods input,
.toggle-row input {
  width: auto;
}

.segmented label:has(input:checked),
.payment-methods label:has(input:checked) {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.preview-panel {
  background: #f9fbff;
}

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.book-meta {
  display: grid;
  gap: 4px;
  min-width: 128px;
  padding: 12px 14px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: right;
}

.book-meta strong {
  color: var(--teal);
  font-size: 18px;
}

.preview-note {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #475467;
  background: #eef7f8;
  border: 1px solid #cfe8eb;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.connection-status {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fafc;
  color: #475467;
  font-size: 14px;
  font-weight: 900;
}

.connection-status.ok {
  color: #05603a;
  background: #ecfdf3;
  border-color: #abefc6;
}

.connection-status.bad {
  color: #b42318;
  background: #fef3f2;
  border-color: #fecdca;
}

.book-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.book-page {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.13);
}

.image-page img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 180ms ease, transform 180ms ease;
}

.mood-calm .image-page img {
  filter: saturate(0.96) brightness(1.02);
}

.mood-adventure .image-page img {
  filter: saturate(1.2) contrast(1.04);
}

.mood-playful .image-page img {
  filter: saturate(1.3) hue-rotate(-8deg) brightness(1.04);
}

.image-page::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 24%;
  background: linear-gradient(180deg, transparent, rgba(16, 24, 40, 0.2));
}

.image-placeholder {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 34px;
  color: #475467;
  background:
    linear-gradient(135deg, rgba(11, 127, 143, 0.12), transparent),
    #eef7f8;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.text-page {
  display: grid;
  place-items: center;
  padding: 44px 34px;
  background:
    linear-gradient(135deg, rgba(244, 183, 64, 0.08), transparent 42%),
    #fffdf7;
}

.page-text {
  max-width: 500px;
  margin: 0;
  color: #1d2939;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.56;
  white-space: pre-line;
}

.page-number {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: rgba(16, 24, 40, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.order-band {
  padding: 58px clamp(18px, 5vw, 76px) 72px;
  background: #ffffff;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(280px, 0.75fr) minmax(280px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.order-copy {
  max-width: 560px;
  color: var(--muted);
}

.plans {
  display: grid;
  gap: 12px;
}

.plan {
  position: relative;
  min-height: 132px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fbfcfe;
  cursor: pointer;
}

.plan input {
  position: absolute;
  inset: 18px 18px auto auto;
  width: auto;
}

.plan.active {
  border-color: var(--teal);
  box-shadow: 0 12px 30px rgba(11, 127, 143, 0.14);
}

.plan-title,
.plan-price,
.plan-detail {
  display: block;
}

.plan-title {
  color: var(--teal);
  font-weight: 900;
}

.plan-price {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 900;
}

.plan-detail {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
}

.checkout {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
}

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 12px 0;
  border-top: 1px solid #dfe7f0;
  border-bottom: 1px solid #dfe7f0;
}

.summary strong {
  font-size: 28px;
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--teal);
  font-weight: 900;
}

@media (max-width: 1060px) {
  .hero,
  .studio,
  .order-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual,
  .hero-visual img {
    min-height: 340px;
  }
}

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

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

  h1 {
    font-size: 46px;
  }

  .lead {
    font-size: 18px;
  }

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

  .hero-visual,
  .hero-visual img {
    min-height: 260px;
  }

  .book-page {
    min-height: 290px;
  }

  .page-text {
    font-size: 19px;
  }
}
