@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f2ed;
  --surface: #ffffff;
  --accent: #1a1a2e;
  --accent2: #c0392b;
  --text: #1a1a2e;
  --muted: #7a7a8a;
  --border: #ddd9d2;
  --input-bg: #faf9f7;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(26,26,46,0.08);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
}

/* ── Toaster ─────────────────────────────────── */
#toaster {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(26,26,46,0.22);
  pointer-events: all;
  animation: slideIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
  max-width: 320px;
}
.toast.success { border-left: 4px solid #27ae60; }
.toast.error   { border-left: 4px solid var(--accent2); }
.toast.info    { border-left: 4px solid #2980b9; }
.toast.hide    { animation: slideOut 0.3s ease forwards; }

@keyframes slideIn  { from { opacity:0; transform:translateX(-40px); } to { opacity:1; transform:translateX(0); } }
@keyframes slideOut { from { opacity:1; transform:translateX(0); }    to { opacity:0; transform:translateX(-40px); } }

/* ── Layout ──────────────────────────────────── */
.page-wrap {
  max-width: 960px;
  margin: 0 auto;
}

header {
  margin-bottom: 2.5rem;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 1.5rem;
}
header .label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--accent);
}
header p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 0.5rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 720px) { .main-grid { grid-template-columns: 1fr; } }

/* ── Form Card ───────────────────────────────── */
.form-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 2rem;
  position: sticky;
  top: 1.5rem;
}
.form-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.field { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

input, textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
}
input.invalid, textarea.invalid { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(192,57,43,0.1); }
input.valid   { border-color: #27ae60; }
textarea { resize: vertical; min-height: 110px; }

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
.field-hint.error { color: var(--accent2); }

.word-count {
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
.word-count.over { color: var(--accent2); font-weight: 600; }

.required { color: var(--accent2); margin-left: 2px; }

button[type="submit"] {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.1s;
}
button[type="submit"]:hover  { background: #2e2e50; }
button[type="submit"]:active { transform: scale(0.98); }
button[type="submit"]:focus-visible {
  outline: 3px solid var(--accent2);
  outline-offset: 3px;
}

/* ── Submissions Panel ───────────────────────── */
.submissions-panel h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.empty-state {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.submissions-list { display: flex; flex-direction: column; gap: 14px; }

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

.entry-card .entry-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
}
.entry-meta span {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.entry-meta span::before { content: ''; display:inline-block; width:6px; height:6px; border-radius:50%; background: var(--accent2); }
.entry-message {
  font-size: 13.5px;
  color: #444;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}
.entry-timestamp {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  margin-top: 8px;
}
