* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

header {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.btn-cta, .btn-back {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-cta:hover, .btn-back:hover {
    background: var(--primary-dark);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero .subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    background: white;
    color: var(--primary);
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero .note {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark);
}

.how-it-works .steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.step-num {
    display: inline-flex;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--gray);
}

.diet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.diet-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--border);
    transition: border-color 0.2s, transform 0.2s;
}

.diet-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.diet-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.diet-card p {
    font-size: 0.9rem;
    color: var(--gray);
}

.compare-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.compare-col {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border);
    position: relative;
}

.compare-col.pro {
    border-color: var(--secondary);
}

.compare-col .badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--secondary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.compare-col h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.compare-col ul {
    list-style: none;
    margin-bottom: 2rem;
}

.compare-col li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    padding-left: 1.5rem;
    position: relative;
}

.compare-col li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: 700;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-pro {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-pro:hover {
    background: #059669;
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
}

details {
    background: white;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
}

details p {
    padding: 0 1.5rem 1rem;
    color: var(--gray);
}

.cta-final {
    text-align: center;
    background: var(--dark);
    color: white;
    padding: 3rem;
    border-radius: 12px;
}

.cta-final h2 {
    color: white;
    margin-bottom: 1.5rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Generator Page */
.generator-page {
    max-width: 900px;
}

.generator-form-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.generator-form-section h1 {
    margin-bottom: 0.5rem;
}

.generator-form-section > p {
    color: var(--gray);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group select,
.form-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.hint {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.25rem;
    display: block;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
}

.checkbox-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background: var(--primary);
    color: white;
    margin-top: 1rem;
}

.btn-large:hover {
    background: var(--primary-dark);
}

.form-note {
    text-align: center;
    margin-top: 1rem;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Results */
.results-section {
    margin-top: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.results-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.results-meta span {
    background: var(--light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.results-actions .btn-secondary {
    width: auto;
    padding: 0.5rem 1.5rem;
}

.macro-targets {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: center;
}

.macro-targets h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--gray);
}

.macro-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.macro {
    text-align: center;
}

.macro .label {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
}

.macro span:last-child {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.plan-days {
    display: grid;
    gap: 1.5rem;
}

.day-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.day-header {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.day-meals {
    padding: 1rem;
}

.meal {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.meal:last-child {
    border-bottom: none;
}

.meal-type {
    font-weight: 500;
    color: var(--gray);
    font-size: 0.9rem;
}

.meal-name {
    font-weight: 500;
}

.meal-macros {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray);
}

.day-totals {
    background: var(--light);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.upgrade-banner {
    background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    margin-top: 2rem;
}

.upgrade-banner h3 {
    margin-bottom: 0.5rem;
}

.upgrade-banner p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.upgrade-banner .btn-pro {
    width: auto;
    display: inline-block;
    padding: 0.75rem 2rem;
    background: white;
    color: var(--secondary);
}

.shopping-list {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--light);
    border-radius: 10px;
}

.shopping-list h3 {
    margin-bottom: 1rem;
}

.shopping-category {
    margin-bottom: 1rem;
}

.shopping-category h4 {
    font-size: 0.95rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.shopping-category ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.shopping-category li {
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.modal .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal h3 {
    margin-bottom: 0.5rem;
}

.modal form {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.modal input[type="email"] {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
}

.modal .btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
}

#waitlist-message {
    margin-top: 1rem;
    color: var(--secondary);
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 1rem;
    color: var(--gray);
}

/* Pro meal card extras */
.meal-instructions {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    color: var(--gray);
    padding-top: 0.5rem;
}

.meal-ingredients {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: var(--gray);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    nav {
        padding: 1rem;
    }

    main {
        padding: 1rem;
    }

    .meal {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .meal-macros {
        justify-content: flex-start;
    }

    .macro-row {
        gap: 1.5rem;
    }

    .results-meta {
        gap: 0.5rem;
    }
}

@media print {
    header, footer, .btn-secondary, .upgrade-banner, .form-note, .results-actions {
        display: none !important;
    }

    .results-section {
        box-shadow: none;
        padding: 0;
    }

    .day-card {
        break-inside: avoid;
    }
}
