/* Heartforms: Happy Heart Software's colors, fonts and rainbow accent, in a light dashboard. */
:root {
  --night: #1e1840;
  --plum: #2e2560;
  --ink: #1e1840;
  --muted: #625c7d;
  --line: #e4e0f0;
  --soft: #f4f2fa;
  --card: #ffffff;
  --violet: #5a3fd6;
  --green: #2f9e6e;
  --green-soft: #e6f4ec;
  --amber: #b45a0e;
  --amber-soft: #fceedb;
  --red: #c2304a;
  --red-soft: #fde8ec;
  --focus: #7c3aed;
  --rainbow: linear-gradient(90deg, #ff3cac, #ff8a00, #ffd23f, #34d399, #22d3ee, #7c3aed, #ff3cac);
  --radius: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font: 16px/1.55 'Plus Jakarta Sans', system-ui, sans-serif;
}
h1, h2, h3 { font-family: Sora, system-ui, sans-serif; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
a { color: var(--violet); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header with the Happy Heart mark */
.topbar {
  background: var(--night);
  background-image: linear-gradient(160deg, #2a1c4e 0%, #221f4e 35%, #173a3d 70%, #1d2346 100%);
  color: #fff;
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { width: 40px; height: 40px; display: block; }
.brand-name { font-family: Fredoka, system-ui, sans-serif; font-weight: 600; font-size: 24px; line-height: 1; }
.brand-by { display: block; font-size: 12px; font-weight: 600; color: #c9c4da; letter-spacing: 0.02em; margin-top: 3px; }
.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topnav a, .topnav button { color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 999px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.topnav a[aria-current="page"], .topnav a:hover, .topnav button:hover { background: rgba(255, 255, 255, 0.12); }
.rainbow-bar { height: 4px; background: var(--rainbow); }

main { max-width: 1120px; margin: 0 auto; padding: 28px 16px 64px; }

/* Buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #c8c0e4; }
.btn-primary { background: var(--plum); border-color: var(--plum); color: #fff; }
.btn-primary:hover { background: #3b3078; }
.btn-rainbow { background-image: var(--rainbow); background-size: 200% 100%; border: 0; color: #150a2e; font-weight: 800; box-shadow: 0 10px 26px rgba(124, 58, 237, 0.28); }
.btn-danger { color: var(--red); }
.btn-small { padding: 7px 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.linklike { background: none; border: 0; padding: 0; color: var(--violet); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }

label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.hint { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid #d6d0e8;
  background: #fff; color: var(--ink); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check input { margin-top: 4px; width: 18px; height: 18px; }

/* Cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 30px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet); margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--soft); color: var(--muted); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-violet { background: #ece6fc; color: var(--violet); }

.notice { padding: 12px 16px; border-radius: 12px; background: var(--amber-soft); color: #6d3708; font-weight: 600; }
.notice-ok { background: var(--green-soft); color: #1d6447; }
.notice-error { background: var(--red-soft); color: #8a1f33; }

.form-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
.form-card:hover { border-color: #c8c0e4; transform: translateY(-2px); }
.form-card h2 { font-size: 20px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--violet); }

.key { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.key code { background: var(--soft); padding: 8px 12px; border-radius: 10px; word-break: break-all; }
pre { background: #191433; color: #ece8ff; padding: 16px; border-radius: 12px; overflow-x: auto; margin: 0; line-height: 1.5; }

.message { border-top: 1px solid var(--line); padding: 16px 0; }
.message:first-child { border-top: 0; padding-top: 0; }
.message.unread { box-shadow: inset 4px 0 0 var(--violet); padding-left: 14px; }
.message dl { margin: 10px 0 0; display: grid; gap: 8px; }
.message dt { font-size: 13px; font-weight: 800; color: var(--muted); }
.message dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.route { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto auto; gap: 10px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.route:first-of-type { border-top: 0; }
@media (max-width: 760px) {
  .route { grid-template-columns: 1fr 1fr; }
  .route .route-email { grid-column: 1 / -1; }
}

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 22px; margin-bottom: 8px; }

dialog { border: 0; border-radius: var(--radius); padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(20, 10, 50, 0.35); }
dialog::backdrop { background: rgba(20, 14, 46, 0.55); }

/* Signed-out pages (sign in, landing) */
.auth { max-width: 440px; margin: 24px auto; }
.auth h1 { font-size: 28px; margin-bottom: 6px; }
.hero { background: var(--night); background-image: linear-gradient(160deg, #2a1c4e 0%, #221f4e 35%, #173a3d 70%, #1d2346 100%); color: #fff; }
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 56px 16px 64px; display: grid; gap: 36px; grid-template-columns: 1.1fr 0.9fr; align-items: center; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); }
.hero p { font-size: 18px; color: #ddd7ea; max-width: 34em; }
.hero pre { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; padding-top: 36px; } }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.features h3 { font-size: 18px; margin-bottom: 6px; }
footer.site { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: 14px; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* "Continue with Google" (Google's sign-in button guidelines: white, outlined, the G mark) */
.btn-google { width: 100%; background: #fff; border-color: #747775; color: #1f1f1f; font-family: Roboto, 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 600; gap: 12px; padding: 12px 18px; }
.btn-google:hover { background: #f8f8f8; border-color: #5f6368; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.row > select { width: auto; flex: 1; min-width: 200px; }
.guide { background: #ece6fc; border-radius: 14px; padding: 14px 18px; color: #2a1d63; }
.guide strong { display: block; margin-bottom: 2px; }
.guide p { margin: 4px 0 0; line-height: 1.5; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .dot { flex: none; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--soft); color: var(--muted); border: 2px solid var(--line); }
.steps .done .dot { background: var(--green-soft); color: var(--green); border-color: #bfe5cf; }
.steps .done .step-title { text-decoration: line-through; color: var(--muted); }
details > summary { list-style-position: outside; }
