:root {
    --primary: #2d3436;
    --accent: #0984e3; /* Blue accent for medical/trust feel */
    --accent-light: #74b9ff;
    --bg: #f8faff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text: #2d3436;
    --text-muted: #636e72;
    --border: #dfe6e9;
    --shadow-bold: 0 20px 40px rgba(0, 0, 0, 0.08);
    --bmi-under: #74b9ff;
    --bmi-normal: #00b894;
    --bmi-over: #fdcb6e;
    --bmi-obese: #d63031;
}

[data-theme="dark"] {
    --primary: #dfe6e9;
    --bg: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.95);
    --text: #f0f6fc;
    --text-muted: #8b949e;
    --border: #30363d;
    --shadow-bold: 0 20px 40px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Header & Nav */
header {
    height: 70px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--card-bg);
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-selector {
    display: flex;
    background: var(--border);
    border-radius: 20px;
    padding: 2px;
}

.lang-selector button {
    border: none;
    background: none;
    padding: 4px 10px;
    border-radius: 18px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
}

.lang-selector button.active {
    background: var(--accent);
    color: white;
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero-section {
    max-width: 800px;
    margin: 4rem auto 3rem;
    text-align: center;
    padding: 0 2rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    border-radius: 30px;
    font-size: 0.75rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-title span {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* Tool Section */
.tool-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.card-glass {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-bold);
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.primary-btn {
    width: 100%;
    background: var(--accent);
    color: white;
    border: none;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(9, 132, 227, 0.2);
}

.primary-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

/* Result Box */
.result-box {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.5s ease-out;
}

.bmi-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.bmi-value-circle {
    width: 100px;
    height: 100px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(9, 132, 227, 0.3);
}

#bmi-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.bmi-value-circle small {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.8;
}

.bmi-status-badge {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
}

/* Range Bar */
.bmi-range-bar {
    position: relative;
    height: 12px;
    margin: 3rem 0 2rem;
}

.range-segments {
    display: flex;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.segment { flex: 1; }
.blue { background: var(--bmi-under); }
.green { background: var(--bmi-normal); }
.yellow { background: var(--bmi-over); }
.red { background: var(--bmi-obese); }

.range-pointer {
    position: absolute;
    top: -15px;
    left: 0%; /* Dynamic */
    width: 4px;
    height: 40px;
    background: var(--text);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.advice-box {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 16px;
    border-left: 4px solid var(--accent);
}

.advice-box h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

/* History Section */
.history-section {
    max-width: 600px;
    margin: 3rem auto;
    padding: 0 2rem;
}

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

.section-header h2 {
    font-size: 1.4rem;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
}

.history-list {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.history-item {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child { border: none; }

.hist-main { display: flex; align-items: center; gap: 1rem; }
.hist-val { font-weight: 800; color: var(--accent); font-size: 1.2rem; }
.hist-status { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.hist-date { font-size: 0.75rem; color: var(--text-muted); }

.empty-msg { text-align: center; padding: 2rem; color: var(--text-muted); font-weight: 600; }

/* Compliance Section */
.compliance-info {
    max-width: 600px;
    margin: 4rem auto;
    padding: 0 2rem;
    display: grid;
    gap: 1.5rem;
}

.info-card {
    background: rgba(0,0,0,0.03);
    padding: 1.5rem;
    border-radius: 12px;
}

[data-theme="dark"] .info-card { background: rgba(255,255,255,0.03); }

.info-card h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

footer {
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

.footer-logo { font-weight: 800; margin-bottom: 0.5rem; color: var(--text-muted); }
.footer-content p { font-size: 0.8rem; color: var(--text-muted); }

.hidden { display: none; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .input-grid { grid-template-columns: 1fr; }
    .bmi-display { flex-direction: column; gap: 1rem; }
}
