:root {
  --bg: #fdf6f0;
  --bg-2: #f5f7ff;
  --ink: #1f1b2a;
  --muted: #6f647a;
  --accent: #ff7aa2;
  --accent-2: #6b74ff;
  --accent-3: #2cb67d;
  --card: #fffdf9;
  --shadow: 0 18px 40px rgba(31, 27, 42, 0.12);
  --radius: 22px;
  --ring: rgba(255, 122, 162, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 12% 12%, #ffe1ec 0%, transparent 55%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 52px 24px 80px;
  position: relative;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.brand {
  font-family: "Fraunces", "Georgia", serif;
  letter-spacing: 0.6px;
  font-weight: 700;
  font-size: 22px;
}

.tagline {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  color: var(--muted);
  margin-top: 6px;
  font-size: 15px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 34px;
  align-items: center;
  margin-bottom: 48px;
}

.hero h1 {
  font-size: clamp(2.6rem, 4.2vw, 3.8rem);
  margin: 0 0 12px;
  line-height: 1.05;
}

.hero p {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(31, 27, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255, 122, 162, 0.25) 0%, transparent 70%);
  opacity: 0.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

label {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

input,
textarea {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 27, 42, 0.15);
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

button {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #ff9db7);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.secondary {
  background: linear-gradient(135deg, var(--accent-2), #8b93ff);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(255, 122, 162, 0.25);
}

.notice {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.card-title {
  font-size: clamp(2.1rem, 3vw, 2.9rem);
  margin: 0;
}

.card-subtitle {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  color: var(--muted);
  margin-top: 6px;
}

.message-list {
  display: grid;
  gap: 16px;
  margin: 28px 0 36px;
}

.message {
  background: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(31, 27, 42, 0.1);
  border: 1px solid rgba(31, 27, 42, 0.06);
}

.message h4 {
  margin: 0 0 8px;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
}

.message p {
  margin: 0;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  line-height: 1.5;
}

.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.error {
  color: #b5262f;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  margin-top: 10px;
}

footer {
  margin-top: 48px;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  color: var(--muted);
  font-size: 0.9rem;
}

.background-notes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.background-notes .note {
  position: absolute;
  max-width: 220px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.45);
  border: 1px solid rgba(31, 27, 42, 0.05);
  box-shadow: 0 2px 8px rgba(31, 27, 42, 0.04);
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  color: rgba(111, 100, 122, 0.6);
  font-size: 0.9rem;
  line-height: 1.45;
  animation: none;
  opacity: 0.55;
  will-change: transform;
}

.background-notes .note span {
  display: block;
  margin-top: 8px;
  color: rgba(31, 27, 42, 0.7);
  font-weight: 600;
  font-size: 0.85rem;
}

.note-a {
  top: 6%;
  left: -6%;
  transform: rotate(-2deg);
  animation-delay: 0s;
}

.note-b {
  top: 20%;
  right: -6%;
  transform: rotate(2deg);
  animation-delay: 1.5s;
}

.note-c {
  bottom: 2%;
  left: 6%;
  transform: rotate(-1deg);
  animation-delay: 3s;
}

.note-d {
  top: 2%;
  right: 28%;
  transform: rotate(1deg);
  animation-delay: 2.2s;
}

.note-e {
  bottom: 18%;
  right: -4%;
  transform: rotate(-2deg);
  animation-delay: 4.1s;
}

.note-f {
  top: 66%;
  left: -2%;
  transform: rotate(2deg);
  animation-delay: 5.4s;
}

.note-g {
  top: 28%;
  left: 44%;
  transform: rotate(-1deg);
  animation-delay: 1.1s;
}

.note-h {
  top: 78%;
  right: 18%;
  transform: rotate(1deg);
  animation-delay: 2.7s;
}

.note-i {
  bottom: -2%;
  left: 46%;
  transform: rotate(-2deg);
  animation-delay: 3.6s;
}

.note-j {
  top: 8%;
  left: 76%;
  transform: rotate(2deg);
  animation-delay: 6.2s;
}

main > * {
  position: relative;
  z-index: 1;
}

.document-shell {
  background: #fffdfb;
  border: 1px solid rgba(31, 27, 42, 0.08);
}

.card-header.minimal {
  margin-bottom: 12px;
}

.document-form {
  margin-top: 24px;
}

.document-meta {
  margin-bottom: 12px;
}

.minimal-check {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.emoji-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-picker {
  display: grid;
  gap: 10px;
}

.template-picker[hidden] {
  display: none;
}

.template-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.template-tab {
  border: 1px solid rgba(31, 27, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}

.template-tab.active {
  background: #ff7aa2;
  border-color: #ff7aa2;
  color: #fff;
}
.template-option {
  display: grid;
  grid-template-columns: 20px 48px 1fr;
  align-items: center;
  gap: 10px;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
}

.template-option input {
  accent-color: var(--accent);
}

.template-swatch {
  width: 48px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(31, 27, 42, 0.12);
  background: #fff;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.emoji-btn {
  border: 1px solid rgba(31, 27, 42, 0.12);
  background: #fff;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.emoji-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(31, 27, 42, 0.08);
}

textarea#content {
  display: none;
}

.document-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.panel.minimal {
  padding: 22px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.message-list.minimal .message {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 16px;
}

.doc-canvas {
  display: grid;
  gap: 24px;
}

.doc-page {
  position: relative;
  width: 100%;
  aspect-ratio: 7 / 5;
  height: auto;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(31, 27, 42, 0.12);
  padding: 24px;
  overflow: hidden;
  cursor: text;
}

.template-grid {
  background-image: url("./assets/templates/basics/grid/inside.svg");
  background-size: cover;
  background-repeat: no-repeat;
}

.template-bloom {
  background-image: url("./assets/templates/basics/bloom/inside.svg");
  background-size: cover;
  background-repeat: no-repeat;
}

.template-confetti {
  background-image: url("./assets/templates/basics/confetti/inside.svg");
  background-size: cover;
  background-repeat: no-repeat;
}

.template-birthday-pink {
  background-image: url("./assets/templates/birthday/birthday-pink/inside.svg");
  background-size: cover;
  background-repeat: no-repeat;
}

.template-grid-cover {
  background-size: cover;
  background-repeat: no-repeat;
}

.template-bloom-cover {
  background-size: cover;
  background-repeat: no-repeat;
}

.template-confetti-cover {
  background-size: cover;
  background-repeat: no-repeat;
}

.template-birthday-pink-cover {
  background-size: cover;
  background-repeat: no-repeat;
}

.template-birthday-yellow-cover {
  background-size: cover;
  background-repeat: no-repeat;
}

.template-birthday-grey-cover {
  background-size: cover;
  background-repeat: no-repeat;
}

.doc-page-header {
  font-family: "Fraunces", "Georgia", serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: rgba(31, 27, 42, 0.6);
  margin-bottom: 8px;
}

.doc-page-body {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  color: rgba(31, 27, 42, 0.45);
  font-size: 0.95rem;
}

.doc-message {
  position: absolute;
  max-width: 240px;
  min-width: 120px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 27, 42, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 8px 16px rgba(31, 27, 42, 0.08);
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
}

.doc-message .author {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(31, 27, 42, 0.5);
}

.doc-input {
  position: absolute;
  min-width: 200px;
  max-width: 280px;
  border-radius: 14px;
  border: 1px dashed rgba(31, 27, 42, 0.25);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 16px rgba(31, 27, 42, 0.08);
}

.doc-input input,
.doc-input textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
}

.doc-input input {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(31, 27, 42, 0.6);
  margin-bottom: 6px;
}

.doc-input textarea {
  font-size: 0.95rem;
  min-height: 70px;
  resize: none;
}

.doc-input .emoji-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.doc-input .emoji-btn {
  border: 1px solid rgba(31, 27, 42, 0.12);
  background: #fff;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

.doc-input .submit-note {
  margin-top: 10px;
  padding: 8px 14px;
  font-size: 0.9rem;
  border-radius: 999px;
}

@media (max-width: 720px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .background-notes {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .background-notes .note {
    animation: none;
  }
}

.view-only .editor-toolbar,
.view-only .document-actions,
.view-only .page-actions,
.view-only .doc-input,
.view-only .submit-note {
  display: none !important;
}

@page {
  size: 7in 5in;
  margin: 0;
}

@media print {
  body {
    background: #fff;
  }

  header,
  footer,
  .editor-toolbar,
  .document-actions,
  #share-link,
  #lock-state,
  #lock-card {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
  }

  .doc-canvas {
    gap: 0;
  }

  .doc-page {
    width: 7in;
    height: 5in;
    border: none;
    page-break-after: always;
  }

  .doc-input {
    display: none !important;
  }
}
