:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --text: #1c2333;
    --muted: #6b7385;
    --primary: #3b4d68;
    --primary-hover: #2e3d54;
    --border: #d9dee8;
    --error-bg: #fdecec;
    --error-fg: #a12525;
    --success-bg: #e8f6ee;
    --success-fg: #1d6b3f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
h2 { margin: 0 0 .5rem; font-size: 1rem; color: var(--muted); font-weight: 600; }
a { color: var(--primary); }
.muted { color: var(--muted); }

/* Flash messages */
.flash { padding: .75rem 1rem; border-radius: 8px; margin: 1rem auto; max-width: 420px; }
.flash-error { background: var(--error-bg); color: var(--error-fg); }
.flash-success { background: var(--success-bg); color: var(--success-fg); }
.dash-page .flash { max-width: 1000px; }

/* Auth pages */
.auth-page { display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 1rem; }
.auth-card {
    width: 100%; max-width: 420px; margin-top: 6vh;
    background: var(--surface); padding: 2rem; border-radius: 12px;
    box-shadow: 0 4px 24px rgba(20, 30, 60, .08);
}
.auth-card .flash { margin: 1rem 0; max-width: none; }
.auth-card form { margin-top: 1.25rem; }

label { display: block; margin: 1rem 0 .25rem; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password] {
    width: 100%; padding: .65rem .75rem; font-size: 1rem;
    border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
small { display: block; margin-top: .25rem; }

button[type=submit] {
    width: 100%; margin-top: 1.5rem; padding: .75rem; font-size: 1rem; font-weight: 600;
    color: #fff; background: var(--primary); border: 0; border-radius: 8px; cursor: pointer;
}
button[type=submit]:hover { background: var(--primary-hover); }

/* Hidden trap field on the sign-up form (a person never sees or fills it in) */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Terms and privacy pages */
.legal { width: 100%; max-width: 720px; margin: 4vh 0; background: var(--surface); padding: 2rem; border-radius: 12px; box-shadow: 0 4px 24px rgba(20, 30, 60, .08); }
.legal h2 { margin: 1.6rem 0 .4rem; font-size: 1.05rem; color: var(--text); }
.legal p, .legal li { margin: .4rem 0; }
.legal ul { padding-left: 1.2rem; }
.legal-note { font-size: .85rem; color: var(--muted); margin-top: 1rem; }

.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; font-size: .9rem; }

/* Landing page: a green circle shrinks, "listdetail" fades in inside it, then the sign-in rises in below.
   Timeline (see the animation delays): 0s circle starts shrinking, 0.25s word fades in (0.5s), 0.75s sign-in appears. */
.landing-page { margin: 0; background: #f3faf6; }
.landing-shell {
    --size: clamp(8rem, 26vmin, 11rem);      /* final circle diameter */
    --start-scale: 9;                         /* how many times bigger the circle starts */
    position: relative; overflow: hidden; min-height: 100vh; min-height: 100svh;
    display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem;
    background: radial-gradient(1100px 560px at 50% -8%, #d3f6e2 0%, #f3faf6 55%, #ffffff 100%);
}
.landing-shell .stage { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 420px; }

.mark {
    position: relative; z-index: 2; flex: none; width: var(--size); height: var(--size); border-radius: 50%;
    display: grid; place-items: center;
    background: radial-gradient(circle at 30% 24%, #55e892 0%, #16c761 44%, #09a24d 100%);
    box-shadow: 0 18px 48px rgba(14, 180, 92, .38), inset 0 -8px 20px rgba(0, 0, 0, .12);
}
.mark-word {
    margin: 0; color: #fff; font-size: calc(var(--size) * .165); font-weight: 800; letter-spacing: -.02em; line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .28);
}
.reveal { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; margin-top: 1.6rem; }
.tagline { max-width: 24rem; margin: 0 0 1.3rem; text-align: center; font-size: 1.08rem; line-height: 1.5; color: #2c3a4f; }
.landing-shell .auth-card { margin-top: 0; }
.site-footer { text-align: center; padding: 1.2rem 0 0; font-size: .85rem; color: var(--muted); }

/* The intro (only on a fresh visit: not replayed after a failed sign-in) */
.intro .mark { transform: scale(var(--start-scale)); animation: mark-shrink .75s cubic-bezier(.22, .8, .2, 1) forwards; }
.intro .mark-word { opacity: 0; animation: word-in .5s ease-out .25s forwards; }
.intro .reveal { opacity: 0; visibility: hidden; animation: reveal-in .5s ease-out .75s forwards; }

@keyframes mark-shrink { from { transform: scale(var(--start-scale)); } to { transform: scale(1); } }
@keyframes word-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes reveal-in {
    from { opacity: 0; transform: translateY(16px); visibility: hidden; }
    to   { opacity: 1; transform: none; visibility: visible; }
}
@media (prefers-reduced-motion: reduce) {
    .intro .mark, .intro .mark-word, .intro .reveal { animation: none; transform: none; opacity: 1; visibility: visible; }
}
/* Dashboard */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: .75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar nav { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.brand { font-weight: 700; }
form.inline { display: inline; margin: 0; }
.dash-page .link-button {
    width: auto; margin: 0; padding: 0; background: none; color: var(--primary);
    font-weight: 500; font-size: .9rem; text-decoration: underline;
}
.dash-page .link-button:hover { background: none; color: var(--primary-hover); }

.dashboard { max-width: 1000px; margin: 2rem auto; padding: 0 1.5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card { background: var(--surface); padding: 1.25rem; border-radius: 12px; box-shadow: 0 2px 12px rgba(20, 30, 60, .06); }
.card p { margin: 0; font-size: 1.05rem; word-break: break-word; }
.placeholder { min-height: 180px; }
