/* The Happiness Ring Planner — brand: the logo blues on white and ivory.
   Playfair Display for headings, Poppins for text, Dancing Script for the name. */

:root {
  --blue: #0068C8;
  --blue-dark: #0052A0;
  --sky: #0B8BD6;
  --sky-soft: #e6f3fd;
  --ivory: #fbf9f6;
  --white: #ffffff;
  --ink: #282626;
  --muted: #5f6b7a;
  --line: #dfe8f1;
  --danger: #b3261e;
  --ok: #2e7d4f;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 104, 200, .06), 0 8px 24px rgba(0, 104, 200, .07);

  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Poppins', system-ui, -apple-system, sans-serif;
  --font-script: 'Dancing Script', cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-head); color: var(--blue); line-height: 1.2; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.script { font-family: var(--font-script); color: var(--sky); font-size: 1.6rem; line-height: 1; }

.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---- Cards, forms, buttons ---- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

label { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin: 14px 0 6px; }
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--sky); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 500;
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 20px; cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--blue); border-color: var(--line); }
.btn-ghost:hover { background: var(--sky-soft); }
.btn-link { background: none; color: var(--sky); padding: 8px 0; }
.btn-danger { background: transparent; color: var(--danger); border-color: #f0c9c6; }
.btn-small { padding: 6px 14px; font-size: .85rem; }
.btn-block { width: 100%; margin-top: 16px; }

.message { min-height: 1.4em; margin: 14px 0 0; font-size: .9rem; color: var(--muted); }
.message.error { color: var(--danger); }
.message.ok { color: var(--ok); }

/* ---- Sign in ---- */
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; text-align: left; }
.login-logo { display: block; width: 200px; height: auto; margin: 0 auto 18px; }
.login-card h1 { font-size: 1.7rem; }

/* ---- App shell ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { display: block; height: 44px; width: auto; }
.brand-sub { font-family: var(--font-head); color: var(--blue); font-size: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.back { display: inline-block; margin-bottom: 16px; color: var(--sky); text-decoration: none; font-size: .9rem; }

/* ---- Wedding list ---- */
.wedding-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wedding-tile { display: block; text-decoration: none; color: inherit; transition: transform .12s ease; }
.wedding-tile:hover { transform: translateY(-2px); }
.wedding-tile h3 { margin-bottom: 6px; }
.tile-meta { color: var(--muted); font-size: .88rem; margin: 0; }
.pill {
  display: inline-block; margin-top: 12px;
  background: var(--sky-soft); color: var(--sky);
  border-radius: 999px; padding: 3px 12px; font-size: .8rem; font-weight: 500;
}
.empty { text-align: center; padding: 40px 24px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---- Wedding home ---- */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 50%, #10A0F0 100%);
  color: var(--white);
  border-radius: calc(var(--radius) + 4px);
  padding: 40px 32px;
  margin-bottom: 24px;
}
.hero .script { color: #d6efff; font-size: 1.8rem; }
.hero h1 { color: var(--white); font-size: 2.4rem; margin: 6px 0 10px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; opacity: .92; margin: 0; }
.countdown { margin-top: 22px; display: flex; align-items: baseline; gap: 10px; }
.countdown strong { font-family: var(--font-head); font-size: 3rem; line-height: 1; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.section-tile { padding: 18px; }
.section-tile h3 { margin-bottom: 4px; }
.section-tile p { margin: 0; font-size: .85rem; }
.soon { color: var(--sky); font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }

.access-list { list-style: none; padding: 0; margin: 0 0 4px; }
.access-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; word-break: break-all; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; min-width: 0; }

.notes { white-space: pre-wrap; }

/* ---- Checklist ---- */
a.section-live { text-decoration: none; color: inherit; border-color: #b9d8f5; transition: transform .12s ease; }
a.section-live:hover { transform: translateY(-2px); }
a.section-live .soon { text-transform: none; letter-spacing: 0; font-size: .8rem; }

.progress { height: 8px; background: var(--sky-soft); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #10A0F0); border-radius: 999px; transition: width .3s ease; }
.progress-card { margin-bottom: 16px; padding: 18px 24px; }
.progress-text strong { font-family: var(--font-head); color: var(--blue); font-size: 1.2rem; }

.segmented { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.segmented button { font: inherit; font-size: .85rem; border: 0; background: none; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.segmented button.active { background: var(--blue); color: var(--white); }

.checklist-groups { display: grid; gap: 16px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.group-head h2 { font-size: 1.2rem; margin: 0; }
.group-head .muted { font-size: .85rem; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist > li { border-top: 1px solid var(--line); }
.checklist > li:first-child { border-top: 0; }
.check-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.check-item input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--blue); cursor: pointer; }
.check-body { flex: 1; min-width: 0; }
.check-title { display: block; margin: 0; font-size: .95rem; font-weight: 400; color: var(--ink); cursor: pointer; }
.is-done .check-title { color: var(--muted); text-decoration: line-through; }
.check-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; font-size: .78rem; }
.due { color: var(--muted); }
.due.overdue { color: var(--danger); font-weight: 500; }
.who { border-radius: 999px; padding: 0 9px; background: var(--sky-soft); color: var(--blue); font-weight: 500; }
.who-planner { background: #fdf0e3; color: #9a5b14; }
.who-couple { background: #eaf6ee; color: var(--ok); }
.check-notes { margin: 6px 0 0; font-size: .85rem; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.check-actions { display: flex; gap: 10px; flex: none; }
.danger-link { color: var(--danger); }
.item-form { padding: 8px 0 12px; }
.check-label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; font-size: .9rem; cursor: pointer; }
.check-label input { width: 18px; height: 18px; accent-color: var(--blue); }
.checklist-group.is-private { background: #fbfaf7; border-style: dashed; }
.private-note { margin: 0 0 6px; font-size: .8rem; color: #9a5b14; }
.private-tag { color: #9a5b14; }
.group-head .danger-link { margin-left: auto; }
.templates-card h3 { margin-bottom: 2px; }
.templates-card /* ---- Planner dashboard ---- */
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-hello { min-width: 0; }
.eyebrow { margin: 0 0 4px; font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); }
.dash-hello h1 { margin: 0 0 6px; }
.dash-headline { margin: 0 0 2px; font-size: 1rem; }
.dash-books { margin: 0; font-size: .85rem; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { display: grid; justify-items: center; min-width: 96px; padding: 10px 16px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); }
.stat strong { font-family: var(--font-head); font-size: 1.6rem; line-height: 1.1; color: var(--blue); font-variant-numeric: tabular-nums; }
.stat span { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat-late { background: #fdeceb; border-color: #f4c9c6; }
.stat-late strong, .stat-late span { color: var(--danger); }
.stat-new { background: var(--sky-soft); border-color: #b9d8f5; }

.dash-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.range { display: flex; align-items: center; gap: 10px; }
.range-label { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.coming-up { display: grid; gap: 16px; }
.cu-card { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 20px; }
.cu-card:nth-child(even) { border-left-color: #10A0F0; }
.cu-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.cu-title { min-width: 0; }
.cu-title h2 { margin: 0 0 2px; font-size: 1.35rem; }
.cu-title h2 a { text-decoration: none; color: inherit; }
.cu-title h2 a:hover { text-decoration: underline; }
.cu-title p { margin: 0; font-size: .85rem; }
.cu-count { display: grid; justify-items: end; align-content: start; gap: 2px; flex: none; text-align: right; }
.cu-count strong { font-family: var(--font-head); font-size: 2.2rem; line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; }
.cu-count > span:not(.chip-late) { font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chip-late { margin-top: 6px; border-radius: 999px; padding: 1px 10px; font-size: .75rem; font-weight: 600; background: #fdeceb; color: var(--danger); }

.cu-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cu-list { min-width: 0; border-radius: 12px; padding: 12px 14px; background: var(--ivory); border: 1px solid var(--line); }
.cu-ours { background: #fbfaf7; border-style: dashed; }
.cu-list h3 { margin: 0 0 6px; font-family: var(--font-body); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.cu-ours h3 { color: #9a5b14; }
.cu-list h3 span { color: var(--muted); }
.cu-list ul { list-style: none; padding: 0; margin: 0; }
.cu-task { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); transition: opacity .3s ease; }
.cu-task:first-child { border-top: 0; }
.cu-task input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--blue); cursor: pointer; }
.cu-task-body { flex: 1; min-width: 0; display: grid; }
.cu-task-body a { color: var(--ink); text-decoration: none; font-size: .9rem; line-height: 1.4; }
.cu-task-body a:hover { color: var(--blue); text-decoration: underline; }
.cu-task-body .muted { font-size: .74rem; }
.cu-due { flex: none; font-size: .75rem; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.cu-due.late { color: var(--danger); font-weight: 600; }
.cu-due.today { color: var(--blue); font-weight: 600; }
.cu-due.soon { color: var(--blue); }
.cu-done { opacity: .35; text-decoration: line-through; }
.cu-empty { margin: 4px 0 0; font-size: .85rem; }
.cu-more { display: inline-block; margin-top: 6px; font-size: .8rem; text-decoration: none; }

/* ---- Comments ---- */
.comment-toggle { color: var(--muted); }
.comment-toggle.has-comments { color: var(--blue); font-weight: 600; }
.comments { margin: 0 0 12px 32px; padding: 12px 16px; background: var(--ivory); border: 1px solid var(--line); border-radius: 12px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; }
.comment { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.comment.from-planner { border-left: 3px solid var(--blue); }
.comment-head { display: flex; align-items: baseline; gap: 10px; font-size: .8rem; }
.comment-head .danger-link { margin-left: auto; padding: 0; }
.comment p { margin: 4px 0 0; font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.comment-form { display: grid; gap: 8px; justify-items: start; }
.comment-form textarea { min-height: 64px; }

.checklist > li.is-focused { background: var(--sky-soft); border-radius: 12px; box-shadow: 0 0 0 2px #b9d8f5; padding: 0 10px; transition: background 1.5s ease; }

/* ---- Activity ---- */
.activity-card { margin-bottom: 24px; border-color: #b9d8f5; }
.activity-list { list-style: none; padding: 0; margin: 8px 0 0; }
.activity { padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.activity:first-child { border-top: 0; }
.activity a { color: var(--ink); text-decoration: none; }
.activity a:hover em { text-decoration: underline; }
.activity em { font-style: normal; color: var(--blue); }
.activity-detail { margin: 4px 0 0; padding-left: 10px; border-left: 2px solid var(--line); color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.activity-time { font-size: .78rem; }
.pill-new { background: var(--blue); color: var(--white); margin-left: 6px; }

.template-picks { justify-content: flex-start; }
.template-picks { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 720px) {
  .page { padding: 24px 16px 48px; }
  .topbar { padding: 12px 16px; }
  .topbar .who { display: none; }
  .check-item { flex-wrap: wrap; }
  .check-actions { width: 100%; padding-left: 32px; }
  .comments { margin-left: 0; }
  .cu-lists { grid-template-columns: 1fr; }
  .cu-card { padding: 16px; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.9rem; }
}
