:root {
  --ink: #123A45; --ink-soft: #123A45AA; --coral: #FF6F61; --leaf: #1E9E82;
  --paper: #FFFBF2; --line: #E3E9EC; --danger: #EF476F;
  --shadow: 0 12px 30px -16px rgba(18,58,69,0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Nunito', sans-serif; color: var(--ink);
  background: linear-gradient(180deg, #EEF8FD, #FDF6E9); min-height: 100vh; line-height: 1.5;
}
h1, h2, h3, legend, .brand { font-family: 'Baloo 2', sans-serif; }
a { color: var(--coral); }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 0.8rem; }
.nav-user { color: var(--ink-soft); font-size: 0.9rem; }

.wrap { max-width: 900px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.app-footer { text-align: center; color: var(--ink-soft); font-size: 0.85rem; padding: 1.5rem; }

/* buttons */
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: 0.95rem; padding: 0.7rem 1.3rem; border-radius: 999px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  font-family: 'Nunito', sans-serif; line-height: 1;
}
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-2px); background: var(--coral); }
.btn-ghost { background: transparent; border: 2px solid var(--ink-soft); color: var(--ink); }
.btn-ghost:hover { border-color: var(--coral); color: var(--coral); }
.btn-danger { background: transparent; border: 2px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* hero / forms */
.hero-card, .form-card {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow);
  padding: 2.5rem; margin-top: 1.5rem;
}
.hero-card { text-align: center; }
.hero-card h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0.6rem 0; }
.lead { color: var(--ink-soft); max-width: 34rem; margin: 0 auto 1.6rem; }
.cta-row { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.form-card { max-width: 420px; margin: 2rem auto; }
.form-card h1 { margin-bottom: 1.2rem; }

label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 1rem; color: var(--ink); }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; margin-top: 0.35rem; padding: 0.7rem 0.85rem; font-size: 0.95rem;
  border: 1.5px solid var(--line); border-radius: 10px; font-family: 'Nunito', sans-serif;
  color: var(--ink); background: #fff; font-weight: 500;
}
input:focus, textarea:focus { outline: none; border-color: var(--coral); }
textarea { resize: vertical; }
.muted { color: var(--ink-soft); font-size: 0.9rem; margin-top: 1rem; }
.hint { color: var(--ink-soft); font-size: 0.85rem; margin: 0.25rem 0 0.75rem; }

.alert { background: #FFE1DE; color: #9B2C2C; padding: 0.7rem 1rem; border-radius: 10px; margin-bottom: 0.8rem; font-size: 0.9rem; }
.alert-ok { background: #DFF5EC; color: #12694F; }

/* page head */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.7rem; }

/* dashboard cards */
.empty { text-align: center; background: #fff; border-radius: 18px; padding: 3rem; box-shadow: var(--shadow); }
.card-list { display: flex; flex-direction: column; gap: 1rem; }
.pc {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 1.3rem 1.4rem;
  display: grid; grid-template-columns: 1fr auto; gap: 0.8rem 1.2rem; align-items: start;
}
.pc-main h3 { font-size: 1.15rem; }
.pc-stats { display: flex; gap: 0.9rem; font-family: 'Space Mono', monospace; font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.pc-actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.pc-actions form { display: inline; }

.link-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.link-row.wide { margin: 0.5rem 0 1.5rem; }
.link-input {
  flex: 1; min-width: 0; padding: 0.5rem 0.7rem; font-size: 0.82rem; border: 1.5px solid var(--line);
  border-radius: 8px; font-family: 'Space Mono', monospace; color: var(--ink-soft); background: #F7FAFB;
}

/* editor */
.editor fieldset {
  background: #fff; border: none; border-left: 5px solid var(--coral); border-radius: 12px;
  box-shadow: var(--shadow); padding: 1.4rem 1.5rem; margin-bottom: 1.4rem;
}
.editor legend { font-size: 1.15rem; font-weight: 700; padding: 0 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.editor .num {
  display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem;
  background: var(--ink); color: #fff; border-radius: 50%; font-size: 0.9rem; font-family: 'Space Mono', monospace;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.editor-actions { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.5rem; }

/* responses */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1rem 0; }
.stat { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 1.5rem 1rem; text-align: center; }
.stat-num { font-family: 'Space Mono', monospace; font-size: 2.4rem; font-weight: 700; color: var(--coral); }
.stat-label { color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.3rem; }

@media (max-width: 560px) {
  .pc { grid-template-columns: 1fr; }
  .pc-stats { grid-column: 1 / -1; }
}
