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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ECF0F1;
    color: #333;
    line-height: 1.6;
}

/* Container & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-container {
    max-width: 800px;
    margin: 2rem auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.card h1, .card h2, .card h3 {
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Forms */
.form {
    margin-top: 1.5rem;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2E5984;
    box-shadow: 0 0 0 3px rgba(46, 89, 132, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #999;
}

.form-group small.error {
    color: #E74C3C;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    font-weight: 400;
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Checklists */
.checklist {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.checklist-item {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
}

.checklist-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #2E5984;
    color: white;
}

.btn-primary:hover {
    background-color: #1F3E5A;
}

.btn-outline {
    background-color: white;
    color: #2E5984;
    border-color: #2E5984;
}

.btn-outline:hover {
    background-color: #ECF0F1;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #e0ffe0;
    color: #1B6B38;
    border: 1px solid #C8F7C8;
}

.alert-danger {
    background-color: #ffe0e0;
    color: #B73329;
    border: 1px solid #F5C4C4;
}

.alert-danger div {
    margin-bottom: 0.5rem;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    margin-bottom: 1rem;
}

.status.success {
    background-color: #e0ffe0;
    color: #1B6B38;
}

.status.pending {
    background-color: #FFF4E0;
    color: #9A6C00;
}

.status.warning {
    background-color: #FFE5CC;
    color: #CC5200;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.badge-success {
    background-color: #e0ffe0;
    color: #1B6B38;
}

.badge-warning {
    background-color: #FFF4E0;
    color: #9A6C00;
}

.badge-danger {
    background-color: #ffe0e0;
    color: #B73329;
}

.badge-dark {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Stats */
.stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
}

.stats > div {
    text-align: center;
}

.stats strong {
    display: block;
    font-size: 2rem;
    color: #2E5984;
    margin-bottom: 0.5rem;
}

.stats small {
    color: #999;
}

/* Food search */
.food-search {
    margin-top: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.food-list {
    list-style: none;
    margin-top: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.food-list li {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.food-list li:last-child {
    border-bottom: none;
}

.food-list small {
    display: block;
    color: #999;
    margin-top: 0.25rem;
}

/* Auth page */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2E5984 0%, #1ABC9C 100%);
}

.auth-box {
    background: white;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.auth-box .subtitle {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-footer a {
    color: #2E5984;
    text-decoration: none;
}

/* Risk score */
.risk-score {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

/* Landing Page */
.landing-hero {
    background: linear-gradient(135deg, #2E5984 0%, #1ABC9C 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.landing-hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.landing-hero p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    max-width: 600px;
    opacity: 0.9;
}

.landing-section {
    padding: 60px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.landing-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #1a1a1a;
    border-bottom: 3px solid #2E5984;
    padding-bottom: 10px;
}

.landing-section p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #555;
}

.landing-section-safe {
    background: #f9f9f9;
}

.landing-note {
    margin-top: 30px;
    text-align: center;
    color: #666;
}

.landing-how-intro {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
}

.landing-footer-note {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #999;
}

.btn-hero {
    display: inline-block;
    padding: 15px 40px;
    background: white;
    color: #2E5984;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.btn-hero:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.foods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.food-card {
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.food-card.danger {
    background: #ffe0e0;
    border-color: #E74C3C;
}

.food-card.danger h3 {
    color: #E74C3C;
}

.food-card.success {
    background: #e0ffe0;
    border-color: #27AE60;
}

.food-card.success h3 {
    color: #27AE60;
}

.food-card h3 {
    margin-bottom: 10px;
}

.food-card ul {
    margin-left: 20px;
}

.food-card li {
    margin-bottom: 8px;
}

.landing-mechanism {
    background: #f5f7fa;
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
}

.mechanism-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

.step-number {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: #2E5984;
    color: white;
    border-radius: 50%;
    line-height: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.step h3 {
    margin-bottom: 10px;
}

.landing-how {
    background: #f9f9f9;
    padding: 60px 20px;
    text-align: center;
}

.landing-how h2 {
    color: #1a1a1a;
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.how-card {
    padding: 30px 20px;
}

.how-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #2E5984;
}

.how-card p {
    color: #666;
    font-size: 1rem;
}

.landing-cta {
    background: linear-gradient(135deg, #2E5984 0%, #1ABC9C 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.landing-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    border: none;
    color: white;
}

.landing-cta p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.landing-footer {
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

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

    .btn-block {
        width: 100%;
    }

    .auth-box {
        padding: 2rem;
    }

    .stats {
        flex-direction: column;
    }

    .landing-hero h1 {
        font-size: 2rem;
    }

    .landing-hero p {
        font-size: 1.1rem;
    }

    .landing-section h2 {
        font-size: 1.5rem;
    }

    .landing-cta h2 {
        font-size: 1.8rem;
    }
}
