/* ==========================================================================
   insights.css — W.H. Academy · Insights / Feedback page
   Standalone public page. Matches the main site: indigo primary, pink accent,
   Plus Jakarta Sans body, Playfair Display for headings.
   ========================================================================== */

:root {
  --primary: #3730a3;
  --primary-mid: #4f46e5;
  --primary-light: #818cf8;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --ink: #1e1b4b;
  --muted: #475569;
  --line: #cbd5e1;
  --bg: #f6f6fb;
  --card: #ffffff;
  --ring: rgba(79, 70, 229, 0.35);
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(30, 27, 75, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-mid); }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ---- Top bar ---- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand span { color: var(--accent-pink); }
.topbar__back {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
}
.topbar__back:hover { color: var(--primary-mid); }

/* ---- Hero ---- */
.hero { padding: 44px 0 8px; text-align: center; }
.hero__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-mid);
  background: rgba(79, 70, 229, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.hero__title em {
  font-style: italic;
  background: linear-gradient(120deg, var(--primary-mid), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__sub {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ---- Section shell ---- */
.section { padding: 28px 0; }
.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 4px;
}
.section__hint { color: var(--muted); margin: 0 0 20px; font-size: 0.95rem; }

/* ---- Role picker ---- */
.roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.role {
  appearance: none;
  cursor: pointer;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.role:hover { transform: translateY(-3px); border-color: var(--primary-light); box-shadow: var(--shadow); }
.role[aria-pressed="true"] {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px var(--ring);
}
.role__icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-mid), var(--accent-pink));
  color: #fff;
  margin-bottom: 12px;
}
.role__icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.role__name { font-weight: 800; font-size: 1.05rem; margin-bottom: 2px; }
.role__desc { color: var(--muted); font-size: 0.85rem; }

/* ---- Form ---- */
.form { margin-top: 26px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.label .opt { color: var(--muted); font-weight: 500; }
.label .req { color: var(--accent-pink); }
.input, .select, .textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}
.textarea { min-height: 110px; resize: vertical; }
.select:disabled { background: #f3f3f8; color: var(--muted); cursor: not-allowed; }
.charcount { display: block; text-align: right; font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.captcha { margin: 18px 0 6px; }

.form__acts { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-mid), var(--primary));
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}
.btn--primary:hover { transform: translateY(-2px); }
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn--ghost {
  background: transparent;
  color: var(--muted);
  padding: 12px 8px;
}
.btn--ghost:hover { color: var(--primary-mid); }

/* ---- Notice / status ---- */
.notice {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 4px;
}
.notice--err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.notice--ok  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
[hidden] { display: none !important; }

/* ---- Success panel ---- */
.done {
  text-align: center;
  padding: 40px 22px;
}
.done__badge {
  width: 62px; height: 62px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.done__badge svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2.5; }
.done h2 { font-family: var(--font-display); margin: 0 0 8px; }
.done p { color: var(--muted); margin: 0 auto 18px; max-width: 420px; }

/* ---- Community list ---- */
.feed { display: grid; gap: 18px; }
.tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 20px 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(30, 27, 75, 0.12); }
/* left accent bar, colored by role */
.tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
}
.tile--student::before { background: var(--primary-mid); }
.tile--parent::before  { background: var(--accent-amber); }
.tile--teacher::before { background: var(--accent-pink); }

.tile__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tile__avatar {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.tile__avatar--student { background: linear-gradient(135deg, var(--primary-mid), var(--primary)); }
.tile__avatar--parent  { background: linear-gradient(135deg, var(--accent-amber), #d97706); }
.tile__avatar--teacher { background: linear-gradient(135deg, var(--accent-pink), #be185d); }
.tile__id { min-width: 0; }
.tile__name { font-weight: 800; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
}
.badge--student { background: var(--primary-mid); }
.badge--parent  { background: var(--accent-amber); }
.badge--teacher { background: var(--accent-pink); }
.tile__meta { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
.tile__meta b { color: var(--ink); font-weight: 700; }
.tile__block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.tile__block:first-of-type { border-top: none; padding-top: 0; }
.tile__block h4 {
  margin: 0 0 3px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-mid);
}
.tile__block p { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.empty { color: var(--muted); text-align: center; padding: 28px; }

.footer { text-align: center; padding: 40px 0; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 620px) {
  .roles { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .role:hover, .btn--primary:hover { transform: none; }
}

/* ==========================================================================
   Insights v2 additions — instructions, General/Specific chooser, Other inputs
   ========================================================================== */

/* "Before you write" instructions box */
.howto { padding: 18px 20px; }
.howto__title { margin: 0 0 10px; font-size: 1.05rem; }
.howto__list { margin: 0; padding-left: 20px; }
.howto__list li { margin: 6px 0; line-height: 1.6; }

/* Compact tip shown at the top of every form */
.form-howto {
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* General vs Specific chooser (mirrors the .roles card style) */
.types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.type {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 20px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.type:hover { border-color: var(--primary, #4f46e5); box-shadow: 0 8px 24px rgba(79,70,229,.12); transform: translateY(-2px); }
.type[aria-pressed="true"] { border-color: var(--primary, #4f46e5); box-shadow: 0 8px 24px rgba(79,70,229,.16); }
.type__icon { width: 34px; height: 34px; color: var(--primary, #4f46e5); }
.type__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; }
.type__name { font-weight: 700; font-size: 1.02rem; }
.type__desc { color: var(--muted, #6b7280); font-size: 0.9rem; line-height: 1.5; }

.pick__back { margin-top: 14px; }

/* "Other — not listed" free-text inputs sit just under their select */
.field--other { margin-top: -4px; }

/* Badge for the extra roles used by General submissions */
.badge--other { background: #eef2ff; color: #4338ca; }
.tile__avatar--other { background: #eef2ff; color: #4338ca; }
