/* ---------- Shared tokens (base values kept in sync with cohousing.css; --luna-color is notes-only, since Luna only exists on this page) ---------- */

:root {
    color-scheme: light;
    --page-bg: #fff8fb;
    --surface: #ffffff;
    --surface-strong: #fdf4f8;
    --text: #241523;
    --text-soft: #7c6471;
    --line: #f0dce4;
    --shadow: 0 20px 45px rgba(95, 48, 74, 0.12);
    --you-color: #8fb5ff;
    --mom-color: #f5b8c8;
    --dad-color: #9ed8bf;
    --luna-color: #caa6f5;
    --accent: #a65d7d;
    --accent-soft: rgba(166, 93, 125, 0.15);
}

/* The theme above is only the pre-load/fallback look. Once the app knows who's active, JS
   (see assets/js/user-theme.js) overrides these same custom properties, computed from that
   user's `color` field in the database - so there's no separate per-role block to keep in sync. */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: "Inter", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, var(--accent-soft), transparent 24%),
        linear-gradient(135deg, #fffafc 0%, var(--page-bg) 100%);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.25s ease, color 0.25s ease;
}

button,
input,
select {
    font: inherit;
}

/* ---------- Access overlay ---------- */

.access-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 22, 34, 0.78);
    backdrop-filter: blur(12px);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 50;
}

.access-overlay.is-hidden {
    display: none;
}

/* ---------- Floating navigation dock (glass-style, always docked at the bottom) ---------- */

.nav-dock {
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    transform: translateX(-50%);
    z-index: 40;
    display: flex;
    align-items: stretch;
    gap: 14px;
    max-width: calc(100vw - 24px);
    background: color-mix(in srgb, var(--surface) 55%, transparent);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid color-mix(in srgb, white 45%, var(--line) 55%);
    border-radius: 999px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    padding: 8px;
}

.nav-dock-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nav-dock-link svg {
    flex-shrink: 0;
}

/* Small vertical separator stripe between nav items, in the page's accent color */
.nav-dock-link:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -8px;
    width: 1.5px;
    height: 55%;
    background: var(--accent);
    opacity: 0.4;
    transform: translateY(-50%);
}

.nav-dock-link:hover,
.nav-dock-link:focus-visible {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    outline: none;
}

.nav-dock-link:active {
    transform: scale(0.95);
}

@media (max-width: 420px) {
    .nav-dock-link {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
}

.access-card {
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.access-card h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.access-copy {
    margin: 0 0 18px;
    color: var(--text-soft);
}

.access-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--text-soft);
}

.access-field input {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff;
    color: var(--text);
}

.access-button {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 11px 14px;
    background: var(--accent);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.access-error {
    min-height: 1.2rem;
    margin: 10px 0 0;
    color: #c35252;
    font-weight: 600;
}

/* ---------- Page shell / hero ---------- */

.page-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 18px 104px;
}

.hero-card,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-card {
    display: grid;
    grid-template-columns: 1.6fr 0.8fr;
    gap: 24px;
    padding: 28px;
    margin-bottom: 20px;
}

.hero-kicker,
.card-eyebrow,
.panel-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 8px;
}

.hero-copy h1 {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 3.2vw, 2.65rem);
    line-height: 1.1;
}

.hero-text {
    margin: 0;
    color: var(--text-soft);
    max-width: 620px;
    font-size: 1rem;
}

.hero-nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
}

.hero-nav-link {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.hero-nav-link:hover,
.hero-nav-link:focus-visible {
    text-decoration: underline;
}

.hero-panel {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
}

.panel-status {
    margin: 0;
    font-weight: 600;
    color: var(--text-soft);
}

.sync-status {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 700;
}

.card {
    padding: 22px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 16px;
}

.card-header h2 {
    margin: 0;
    font-size: 1.24rem;
}

/* ---------- Checklist ---------- */

.notes-form {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.notes-form input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 11px 16px;
    background: #fff;
    color: var(--text);
}

.notes-form-for-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-soft);
    white-space: nowrap;
}

.notes-form-for-caption {
    font-weight: 600;
}

.notes-form-for-field select {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
    background: #fff;
    color: var(--text);
}

.notes-form-button {
    border: 0;
    border-radius: 999px;
    padding: 11px 20px;
    background: var(--accent);
    color: white;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.notes-list {
    display: grid;
    gap: 10px;
}

.notes-empty-message {
    margin: 0;
    color: var(--text-soft);
}

.notes-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
}

.notes-item.is-you {
    background: color-mix(in srgb, var(--you-color) 24%, transparent);
    border-color: color-mix(in srgb, var(--you-color) 40%, transparent);
}

.notes-item.is-mom {
    background: color-mix(in srgb, var(--mom-color) 30%, transparent);
    border-color: color-mix(in srgb, var(--mom-color) 50%, transparent);
}

.notes-item.is-dad {
    background: color-mix(in srgb, var(--dad-color) 30%, transparent);
    border-color: color-mix(in srgb, var(--dad-color) 50%, transparent);
}

.notes-item.is-luna {
    background: color-mix(in srgb, var(--luna-color) 28%, transparent);
    border-color: color-mix(in srgb, var(--luna-color) 50%, transparent);
}

.notes-item-checkbox {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.notes-item-body {
    flex: 1;
    min-width: 0;
}

.notes-item-text {
    margin: 0;
    word-break: break-word;
}

.notes-item.is-done .notes-item-text {
    text-decoration: line-through;
    color: var(--text-soft);
}

.notes-item-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin: 4px 0 0;
}

.notes-item-meta {
    font-size: 0.82rem;
    color: var(--text-soft);
}

.notes-item-author-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-right: 6px;
}

.notes-item-author-swatch.is-everyone {
    width: 11px;
    height: 11px;
    vertical-align: -1px;
}

.notes-item-author-swatch.is-you {
    background: var(--you-color);
}

.notes-item-author-swatch.is-mom {
    background: var(--mom-color);
}

.notes-item-author-swatch.is-dad {
    background: var(--dad-color);
}

.notes-item-author-swatch.is-luna {
    background: var(--luna-color);
}

.notes-item-remove-button {
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.notes-item-remove-button:hover,
.notes-item-remove-button:focus-visible {
    background: var(--accent-soft);
    color: var(--accent);
    outline: none;
}

@media (max-width: 900px) {
    .hero-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 16px 12px 104px;
    }

    .hero-card,
    .card {
        padding: 18px;
    }

    .notes-form {
        flex-direction: column;
    }
}
