/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.06);
    --transition: 150ms ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--gray-800);
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--gray-50) 100%);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 700px; }

/* ── Navbar ── */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(239, 246, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}
.logo:hover { text-decoration: none; }
.logo svg { color: var(--primary); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-100); }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }

.btn-google {
    background: #fff;
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
}
.btn-google:hover { background: #f8fafc; box-shadow: var(--shadow-lg); }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--gray-100); color: var(--danger); }

/* ── Input ── */
.input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-800);
    background: #fff;
    transition: border-color var(--transition);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.input-sm { max-width: 100px; }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* ── Hero ── */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: var(--gray-900);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--gray-500);
    margin-bottom: 36px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

/* ── App Preview Mock ── */
.app-preview {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.preview-header {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--gray-200);
}

.preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.preview-dot.red { background: #ef4444; }
.preview-dot.yellow { background: #f59e0b; }
.preview-dot.green { background: #10b981; }

.preview-content { display: flex; min-height: 280px; }

.preview-sidebar {
    width: 130px;
    padding: 16px 12px;
    border-right: 1px solid var(--gray-200);
    background: #f8fafc;
}

.preview-list {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 2px;
}
.preview-list.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.preview-list .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.preview-items { flex: 1; padding: 16px; }

.preview-category {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 8px 0 4px;
    border-bottom: 1px solid #f1f5f9;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}
.preview-item .check {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    flex-shrink: 0;
}
.preview-item .check.checked {
    background: var(--primary);
    border-color: var(--primary);
    position: relative;
}
.preview-item .check.checked::after {
    content: '';
    position: absolute;
    top: 1px; left: 4px;
    width: 4px; height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.preview-item.done .text { text-decoration: line-through; color: var(--gray-400); }
.preview-item .text { flex: 1; color: var(--gray-700); }
.preview-item .qty {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 500;
}

/* ── Features ── */
.features {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
    text-align: center;
}

.features h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 48px;
    color: var(--gray-900);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    text-align: left;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 16px;
}

.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--gray-800); }
.feature-card p { color: var(--gray-500); font-size: 0.9rem; line-height: 1.6; }

/* ── CTA ── */
.cta {
    text-align: center;
    padding: 80px 24px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-top: 1px solid var(--gray-200);
}
.cta h2 { font-size: 2rem; font-weight: 700; margin-bottom: 12px; color: var(--gray-900); }
.cta p { color: var(--gray-500); margin-bottom: 28px; font-size: 1.1rem; }

/* ── Page header ── */
.section { padding: 32px 0; }

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}
.back-link:hover { color: var(--primary); text-decoration: none; }

/* ── New list form ── */
.new-list-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.new-list-form .input { flex: 1; }

/* ── Lists grid ── */
.lists-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: box-shadow var(--transition);
}
.list-card:hover { box-shadow: var(--shadow); }

.list-card-link {
    flex: 1;
    padding: 16px;
    color: inherit;
}
.list-card-link:hover { text-decoration: none; }

.list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.list-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 999px;
}

.list-card-meta {
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.btn-delete-list {
    margin-right: 8px;
    flex-shrink: 0;
}

/* ── Add item form ── */
.add-item-form {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 24px;
}

.add-item-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.add-item-row .input:first-child { flex: 2; min-width: 150px; }
.add-item-row .select { flex: 1; min-width: 140px; }

/* ── Category header ── */
.category-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 12px 0 4px;
    border-bottom: 1px solid var(--gray-100);
}

/* ── Item ── */
.item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--gray-100);
    transition: opacity 0.2s;
}

.item-checked {
    opacity: 0.5;
}

.item-checked .item-name {
    text-decoration: line-through;
    color: var(--gray-400);
}

.item-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray-300);
    flex-shrink: 0;
    border-radius: 50%;
    transition: all var(--transition);
}
.item-check:hover { background: var(--gray-100); }
.item-checked .item-check { color: var(--success); }

.item-info {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.item-name {
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.item-quantity {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.btn-delete-item {
    width: 28px;
    height: 28px;
    opacity: 0;
    transition: opacity var(--transition);
}
.item:hover .btn-delete-item { opacity: 1; }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-400);
}
.empty-state h3 { font-size: 1.1rem; margin: 16px 0 8px; color: var(--gray-500); }
.empty-state p { font-size: 0.875rem; }

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 24px 0;
    font-size: 0.85rem;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-200);
}
.footer a { color: var(--gray-400); }
.footer a:hover { color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 48px 24px;
        gap: 40px;
        text-align: center;
    }
    .hero-actions { justify-content: center; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .hero h1 { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .features-grid { grid-template-columns: 1fr; }
    .features h2 { font-size: 1.5rem; }
    .cta h2 { font-size: 1.5rem; }

    .nav-user span:not(.avatar) { display: none; }

    .add-item-row {
        flex-direction: column;
    }
    .add-item-row .input,
    .add-item-row .select {
        width: 100%;
        max-width: none;
    }

    .btn-delete-item { opacity: 1; }

    .preview-sidebar { display: none; }
}
