/* Basketly web theme — mirrors the palette and type of the app (lib/main.dart):
   warm cream ground, terracotta red accent, Hind body, Rozha One headings. */
@import url('https://fonts.googleapis.com/css2?family=Hind:wght@400;500;600;700&family=Rozha+One&display=swap');

:root {
    --bg: #FBF5EA;
    --surface: #FFFCF6;
    --text: #2B1B13;
    --muted: #6E5A4D;
    --faint: #8F7B68;
    --primary: #A5301A;
    --accent: #B5361D;
    --on-accent: #ffffff;
    --danger: #7A2413;
    --divider: #EBDDC6;
    --divider-subtle: #F3E9D6;
    --highlight: #F6E0A4;
    --on-highlight: #7A2413;
    --chip: #F1E5C8;
    --success: #2E6B3F;
    --error-bg: #FBE3DC;
    --success-bg: #E1F0E4;
    --shadow: 0 1px 2px rgba(43, 27, 19, .06), 0 8px 24px rgba(43, 27, 19, .06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17110D;
        --surface: #221A15;
        --text: #F3E9D6;
        --muted: #BBA894;
        --faint: #857463;
        --primary: #FF9A82;
        --accent: #C8412A;
        --danger: #B5361D;
        --divider: #3A2D25;
        --divider-subtle: #2B211B;
        --highlight: #4A3327;
        --on-highlight: #F6E0A4;
        --chip: #332720;
        --success: #7FC08F;
        --error-bg: #3B1B14;
        --success-bg: #1E3024;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Hind', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 400; line-height: 1.2; }
h1, h2 { font-family: 'Rozha One', Georgia, serif; }
h3 { font-weight: 600; }

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

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    border-bottom: 1px solid var(--divider);
}
.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-family: 'Rozha One', Georgia, serif;
    font-size: 1.4rem;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand small {
    display: block;
    font-family: 'Hind', sans-serif;
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.1;
}
.nav { display: flex; gap: 6px; }
.nav a {
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
}
.nav a:hover, .nav a.active { background: var(--highlight); color: var(--on-highlight); }

/* Layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.card {
    width: calc(100% - 40px);
    max-width: 760px;
    margin: 32px auto;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.card-narrow { max-width: 480px; }

.page-title { text-align: center; padding: 40px 20px 0; }
.page-title h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.8rem); color: var(--primary); }
.page-title p { margin: 8px 0 0; color: var(--muted); }

.card h1 { margin: 0 0 4px; font-size: 2rem; color: var(--primary); }
.card h2 {
    margin: 32px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--divider);
    font-size: 1.4rem;
    color: var(--primary);
}
.card h3 { margin: 20px 0 4px; }
.card ul { padding-left: 22px; }
.card li { margin: 6px 0; }
.meta { color: var(--faint); font-size: .9rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 24px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font: 600 1rem 'Hind', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn-block { display: flex; width: 100%; }
.btn-ghost { background: var(--chip); color: var(--text); }

/* Alerts */
.alert { padding: 14px 16px; margin-bottom: 20px; border-radius: 12px; border-left: 4px solid; }
.alert.error { background: var(--error-bg); border-color: var(--accent); color: var(--danger); }
.alert.success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
@media (prefers-color-scheme: dark) { .alert.error { color: #FFA08C; } }

/* Forms */
label { display: block; margin-bottom: 6px; font-weight: 600; }
input[type="text"], input[type="email"], select, textarea {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 20px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--divider);
    border-radius: 12px;
    font: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
textarea { resize: vertical; min-height: 150px; }

/* Landing page */
.hero { text-align: center; padding: 72px 20px 80px; }
.hero h1 { margin: 0 0 16px; font-size: clamp(2.6rem, 8vw, 4.6rem); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { max-width: 640px; margin: 0 auto 32px; font-size: 1.2rem; color: var(--muted); }

.features { padding: 72px 0; background: var(--surface); border-block: 1px solid var(--divider); }
.features h2 { text-align: center; margin: 0 0 40px; font-size: clamp(1.8rem, 5vw, 2.4rem); color: var(--primary); }
.feature-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature { padding: 28px; background: var(--bg); border: 1px solid var(--divider); border-radius: 20px; }
.feature .icon {
    width: 48px; height: 48px; margin-bottom: 14px;
    display: grid; place-items: center;
    background: var(--highlight); color: var(--on-highlight);
    border-radius: 14px;
}
.feature .icon svg { width: 26px; height: 26px; }
.feature h3 { margin: 0 0 8px; font-size: 1.2rem; }
.feature p { margin: 0; color: var(--muted); }

.cta { text-align: center; padding: 80px 20px; }
.cta h2 { margin: 0 0 12px; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--primary); }
.cta p { margin: 0 0 28px; color: var(--muted); font-size: 1.1rem; }

.footer { border-top: 1px solid var(--divider); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.footer nav { display: flex; gap: 20px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--primary); }

/* Shared list page */
.list-owner { color: var(--muted); font-size: .95rem; }
.badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
}
.badge-edit { background: var(--highlight); color: var(--on-highlight); }
.badge-view { background: var(--chip); color: var(--muted); }

.items { list-style: none; margin: 18px 0 0; padding: 0 !important; }
.items li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0;
    padding: 13px 0;
    border-bottom: 1px solid var(--divider-subtle);
}
.items li:last-child { border-bottom: 0; }
.check {
    flex: none;
    width: 22px; height: 22px; margin-top: 3px;
    border: 2px solid var(--faint);
    border-radius: 7px;
    display: grid; place-items: center;
}
.completed .check { background: var(--success); border-color: var(--success); }
.completed .check::after {
    content: '';
    width: 5px; height: 10px;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}
.item-name { font-weight: 600; }
.item-extra { font-size: .9rem; color: var(--muted); }
.completed .item-name, .completed .item-extra { text-decoration: line-through; color: var(--faint); }

.open-app { margin-top: 24px; }
.get-app { display: block; margin-top: 14px; text-align: center; font-size: .9rem; color: var(--muted); }

/* Download page */
.center { text-align: center; }
.center .store-links { margin-top: 28px; }
