:root {
  --page-bg: #fff8f2;
  --panel-bg: rgba(255, 255, 255, 0.82);
  --panel-border: rgba(155, 69, 84, 0.15);
  --text-main: #2f2230;
  --text-soft: #6d5a67;
  --rose: #c45773;
  --rose-deep: #8f334f;
  --gold: #d7a749;
  --cream: #fef7ef;
  --shadow: 0 24px 60px rgba(113, 63, 80, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 203, 210, 0.75), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 230, 179, 0.85), transparent 34%),
    linear-gradient(180deg, #fff8f2 0%, #fff1ea 100%);
  color: var(--text-main);
  font-family: "DM Sans", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 360px);
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.hero-copy h1 {
  margin: 8px 0 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.hero-text {
  max-width: 760px;
  color: var(--text-soft);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-badge,
.panel {
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-badge {
  padding: 22px 24px;
  display: grid;
  gap: 8px;
  justify-self: end;
  min-width: 0;
}

.language-toggle {
  display: inline-flex;
  gap: 8px;
}

.language-button {
  border: 1px solid rgba(196, 87, 115, 0.18);
  background: rgba(255, 255, 255, 0.84);
  color: var(--rose-deep);
  min-width: 48px;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.language-button.active {
  background: linear-gradient(135deg, #c45773, #e28b64);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(196, 87, 115, 0.24);
}

.language-button:hover {
  transform: translateY(-1px);
}

.hero-badge span,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--rose-deep);
  font-weight: 700;
}

.hero-badge strong {
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  gap: 22px;
}

.panel {
  padding: 24px;
}

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

.panel-heading.compact {
  margin-bottom: 14px;
}

.panel-heading h2,
.panel-heading h3 {
  margin: 6px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
}

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

.field,
.suggestions,
.theme-picker,
.action-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.field span,
.field-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--rose-deep);
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(144, 82, 98, 0.18);
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 16px;
  color: var(--text-main);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field textarea {
  min-height: 136px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(196, 87, 115, 0.55);
  box-shadow: 0 0 0 4px rgba(196, 87, 115, 0.12);
}

.pill-row,
.theme-grid,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-button,
.ghost-button,
.primary-button,
.secondary-button,
.theme-card,
.recipient-back-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.pill-button,
.ghost-button,
.secondary-button {
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--rose-deep);
  border: 1px solid rgba(196, 87, 115, 0.18);
}

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

.theme-card {
  text-align: left;
  padding: 15px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(144, 82, 98, 0.16);
  border-radius: 22px;
}

.theme-card.active {
  border-color: rgba(196, 87, 115, 0.42);
  box-shadow: 0 16px 34px rgba(126, 61, 79, 0.12);
  transform: translateY(-1px);
}

.theme-swatch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.theme-swatch span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.theme-name {
  font-weight: 700;
}

.theme-description {
  margin-top: 5px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.primary-button,
.secondary-button,
.recipient-back-button {
  padding: 13px 18px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, #c45773, #e28b64);
  color: white;
  box-shadow: 0 12px 28px rgba(196, 87, 115, 0.28);
}

.preview-chip {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--rose-deep);
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid rgba(196, 87, 115, 0.18);
}

.preview-stage,
.recipient-preview {
  display: grid;
  place-items: center;
}

.preview-stage {
  min-height: 680px;
}

.preview-notes {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.postcard-shell {
  width: min(100%, 780px);
  padding: 18px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 30px 56px rgba(100, 53, 68, 0.18);
}

.postcard-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
}

.status-message {
  min-height: 20px;
  color: var(--rose-deep);
  font-size: 0.95rem;
}

.hidden {
  display: none !important;
}

.recipient-mode {
  min-height: 100vh;
  padding: 28px 20px 48px;
  background:
    radial-gradient(circle at top right, rgba(255, 219, 224, 0.72), transparent 32%),
    linear-gradient(180deg, #fff7f1 0%, #fff0e5 100%);
}

.recipient-back-button {
  margin: 0 auto 22px;
  display: block;
  background: rgba(255, 255, 255, 0.92);
  color: var(--rose-deep);
  border: 1px solid rgba(196, 87, 115, 0.16);
}

.recipient-stage {
  max-width: 1020px;
  margin: 0 auto;
}

.recipient-preview .postcard-shell {
  width: min(100%, 960px);
  padding: clamp(12px, 3vw, 28px);
}

.ghost-button:hover,
.pill-button:hover,
.secondary-button:hover,
.theme-card:hover,
.primary-button:hover,
.recipient-back-button:hover {
  transform: translateY(-1px);
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 520px;
  }

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

  .hero-badge {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .page-shell,
  .recipient-mode {
    padding: 18px 14px 32px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

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

  .panel-heading {
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .preview-stage {
    min-height: 0;
  }
}
