.guestbook {
  --ink: #f5f2ec;
  --muted: #9a958c;
  --line: rgba(255, 255, 255, 0.08);
  --surface: rgba(255, 255, 255, 0.04);
  --field: rgba(255, 255, 255, 0.05);
  --accent: #f0b95a;
  --accent-2: #ff7a59;
  --danger: #ff7a6b;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;

  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 88px 20px 112px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Soft glow behind the section */
.guestbook::before {
  content: "";
  position: absolute;
  inset: 40px 0 auto;
  height: 320px;
  background: radial-gradient(
    ellipse at center,
    rgba(240, 185, 90, 0.12),
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

.gb-header {
  margin-bottom: 32px;
}

.gb-header h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 3.8rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.01em;
}

.gb-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Form card */
.gb-form {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), var(--surface));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 60px -20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(14px);
}

.gb-form label {
  display: grid;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.gb-form input,
.gb-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: 400 0.95rem/1.55 var(--sans);
  text-transform: none;
  letter-spacing: normal;
  resize: vertical;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.gb-form input:hover,
.gb-form textarea:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.gb-form input:focus,
.gb-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(240, 185, 90, 0.15);
}

.gb-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gb-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.gb-status {
  margin-right: auto;
  font-size: 0.88rem;
  color: var(--muted);
}
.gb-status.error {
  color: var(--danger);
}

.guestbook button {
  padding: 11px 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1206;
  font: 600 0.9rem var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(255, 122, 89, 0.6);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}
.guestbook button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 28px -8px rgba(255, 122, 89, 0.7);
}
.guestbook button:active {
  transform: translateY(0);
}
.guestbook button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

/* Message list */
.gb-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
}

.gb-item {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  animation: gb-in 0.35s ease both;
}

@keyframes gb-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.gb-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.gb-author {
  font-weight: 600;
  color: var(--ink);
}

.gb-author::before {
  content: attr(data-initial);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1206;
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
}

.gb-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.gb-content {
  margin: 0;
  padding-left: 38px;
  line-height: 1.65;
  color: rgba(245, 242, 236, 0.88);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gb-empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.guestbook .gb-delete {
  margin-left: auto;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid rgba(255, 122, 107, 0.5);
  color: var(--danger);
  font-size: 0.78rem;
  box-shadow: none;
}
.guestbook .gb-delete:hover {
  background: rgba(255, 122, 107, 0.12);
  box-shadow: none;
}

@media (max-width: 520px) {
  .gb-form {
    padding: 20px;
  }
  .gb-content {
    padding-left: 0;
  }
}
