:root {
    --teal: #00897B;
    --teal-dark: #00695C;
    --teal-light: rgba(0, 137, 123, 0.12);
    --bg: #F5F5F5;
    --card: #FFFFFF;
    --text: #263238;
    --muted: #78909C;
    --error: #c62828;
    --radius: 16px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
.app-header {
    background: #00695C;
    color: #ffffff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-height: 56px;
}
.app-header a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.app-header a:hover {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}
.app-header nav a:hover { text-decoration: underline; }
.app-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    color: #ffffff;
}
.app-header .nav-logo {
    width: 36px;
    height: 36px;
    display: block;
    flex-shrink: 0;
}
.app-header nav {
    display: flex;
    gap: 20px;
    align-items: center;
}
.app-header nav .btn-nav {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.4);
}
.app-header nav .btn-nav:hover {
    background: rgba(255,255,255,0.3);
    text-decoration: none;
}
.container { max-width: 560px; margin: 0 auto; padding: 24px 20px 48px; }
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card h1 { margin: 0 0 8px; font-size: 1.5rem; color: var(--teal); }
.card .subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input, .form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-light);
}
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
    background: var(--teal);
    color: white;
    width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }
.btn-secondary {
    background: var(--teal-light);
    color: var(--teal);
}
.btn-danger { background: #c62828; color: white; }
.btn-ghost { background: transparent; color: var(--teal); }
.msg { padding: 12px; border-radius: 12px; margin-bottom: 16px; font-size: 0.9rem; }
.msg.error { background: #ffebee; color: var(--error); }
.msg.success { background: #e8f5e9; color: #2e7d32; }
.links { text-align: center; margin-top: 20px; }
.links a { color: var(--teal); text-decoration: none; font-weight: 600; }
.links a:hover { text-decoration: underline; }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee; }
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--muted); font-size: 0.9rem; }
.stat-value { font-weight: 600; color: var(--text); }
.bmi-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.bmi-normal { background: #c8e6c9; color: #2e7d32; }
.bmi-under { background: #bbdefb; color: #1565c0; }
.bmi-over { background: #ffe0b2; color: #e65100; }
.bmi-obese { background: #ffcdd2; color: #c62828; }
.profile-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal h3 { margin: 0 0 12px; color: var(--text); }
.modal p { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
@media (max-width: 600px) {
    .app-header { flex-wrap: wrap; gap: 12px; }
    .container { padding: 16px; }
}

/* ----- Landing page ----- */
.landing { padding: 0; max-width: 100%; }
.hero {
    background: linear-gradient(160deg, #00897B 0%, #004D40 50%, #00352e 100%);
    color: white;
    padding: 72px 24px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
    position: relative;
}
.hero .tagline {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    opacity: 0.92;
    max-width: 480px;
    margin: 0 auto 32px;
    line-height: 1.5;
    position: relative;
}
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }
.hero .btn-hero-primary {
    background: white;
    color: #00695C;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hero .btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.hero .btn-hero-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.4);
    transition: background 0.2s;
}
.hero .btn-hero-secondary:hover { background: rgba(255,255,255,0.25); }
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 24px;
}
.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
}
.section-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto 48px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
}
.feature-card {
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.feature-card .feature-img {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--teal-light) 0%, #e0f2f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--teal);
}
.feature-card .feature-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.feature-card .feature-body { padding: 24px; }
.feature-card h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: var(--text);
}
.feature-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.55;
}
.landing-footer {
    background: #263238;
    color: rgba(255,255,255,0.8);
    padding: 40px 24px;
    text-align: center;
}
.landing-footer a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}
.landing-footer a:hover { text-decoration: underline; }
.landing-footer .links { margin-top: 16px; }
.landing-footer .links a + a { margin-left: 20px; }
.landing-footer .copy { font-size: 0.85rem; margin-top: 20px; opacity: 0.7; }
.nav-transparent .app-header {
    background: transparent;
    box-shadow: none;
}
.nav-transparent .app-header a,
.nav-transparent .app-header .brand { color: #ffffff; }
.nav-solid .app-header {
    background: #00695C;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-solid .app-header a,
.nav-solid .app-header .brand { color: #ffffff; }
