:root {
    /* Exact colors sampled from KasaHealth Logo */
    --primary-navy: #184e85;  /* From "Kasa" */
    --primary-teal: #26b797;  /* From "Health" */
    --accent-teal: #e2f6f2;   /* Soft background companion */
    --text-main: #2c3e50;
    --text-light: #576574;
    --bg-surface: #ffffff;
    --bg-page: #f9fbfb;       /* Very subtle clinical blue-tint */
    --border-soft: #e2e8f0;
    
    --color-success: #26b797; /* Re-mapped success to brand teal */
    --color-danger: #e74c3c;
    --color-warning: #f59e0b;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-card: 0 10px 25px -5px rgba(30, 77, 123, 0.08), 0 8px 10px -6px rgba(30, 77, 123, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; color: var(--primary-navy); }

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-navy { color: var(--primary-navy); }
.text-teal { color: var(--primary-teal); }
.text-danger { color: var(--color-danger); }
.text-light { color: var(--text-light); }
.text-muted { color: #94a3b8; }
.font-bold { font-weight: 700; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.py-4 { padding: 2.5rem 0; }
.w-100 { width: 100%; display: block; }
.block-center { margin-left: auto; margin-right: auto; }
.flex-between { display: flex; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* Navigation */
nav {
    position: fixed;
    top: 0; width: 100%; z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.logo-wrap { display: flex; align-items: center; height: 100%; }
.logo-wrap img { height: 55px; object-fit: contain; } /* Mobile size */

.lang-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-navy);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: 0.2s;
}
.lang-toggle:hover {
    background: var(--accent-teal);
    border-color: var(--primary-teal);
}

@media (min-width: 768px) {
    .logo-wrap img { height: 85px; } /* Crisp, large size for laptops and desktops */
    .nav-container { padding: 1.5rem 2rem; }
}

/* Main Container (SPA layout) */
.app-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem 2rem;
    max-width: 500px; /* Mobile focused */
    margin: 0 auto;
    width: 100%;
}

section { width: 100%; }
.hidden { display: none !important; }
.active-screen { display: block; animation: slideUp 0.4s ease forwards; }
.hidden-screen { display: none; }

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

/* Screen 1: Landing */
.badge { display: inline-flex; gap: 0.5rem; padding: 0.4rem 1rem; background: var(--accent-teal); color: var(--primary-teal); border-radius: 30px; font-weight: 700; font-size: 0.85rem; margin-bottom: 1.5rem; }
.hero-content { text-align: center; }
.hero-content h1 { font-size: 2.8rem; line-height: 1.1; margin-bottom: 1rem; }
.hero-content h1 span { color: var(--primary-teal); }
.hero-content p { color: var(--text-light); margin-bottom: 2rem; }

.action-card { background: white; padding: 2.5rem 1.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.icon-pulse { width: 60px; height: 60px; background: var(--accent-teal); color: var(--primary-teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto 1.5rem; animation: pulseSoft 2s infinite; }

@keyframes pulseSoft {
    0% { box-shadow: 0 0 0 0 rgba(43, 191, 158, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(43, 191, 158, 0); }
    100% { box-shadow: 0 0 0 0 rgba(43, 191, 158, 0); }
}

.footer-note { text-align: center; margin-top: 1.5rem; font-size: 0.75rem; color: #a0aec0; font-weight: 600; text-transform: uppercase; }

/* Screen 2: Instructions */
.instruction-header { text-align: center; margin-bottom: 2rem; }
.instruction-header h2 { font-size: 2rem; }
.steps-grid { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 2rem; }
.step-card { background: white; padding: 1.5rem; border-radius: var(--radius-md); box-shadow: 0 4px 6px rgba(0,0,0,0.02); display: flex; flex-direction: column; align-items: center; text-align: center; }
.step-card h4 { margin-top: 1rem; margin-bottom: 0.3rem; }
.step-card p { font-size: 0.9rem; color: var(--text-light); }

.anim-container { height: 60px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.anim-float { animation: float 3s ease-in-out infinite; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-shake { animation: shake 2.5s ease-in-out infinite; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); } 20%, 40%, 60%, 80% { transform: translateX(5px); } }

/* Screen 3: Recording Timer */
.timer-container { position: relative; width: 200px; height: 200px; margin: 2rem auto; }
.timer-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 4rem; font-weight: 800; color: var(--primary-navy); font-family: 'Poppins', sans-serif; }
.timer-text .sec { font-size: 1.5rem; color: var(--text-light); }
.success-text { color: var(--color-success); font-weight: 700; }

.progress-ring__circle {
    transition: stroke-dashoffset 0.1s linear;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* Screen 4: Results & Risk Meter */
.mega-text { font-size: 2.2rem; margin-bottom: 0.5rem; font-family: 'Poppins', sans-serif;}
.glass-card { background: white; border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-card); }

/* --- Risk Meter Component --- */
.risk-meter-container {
    width: 100%;
    max-width: 320px;
    margin: 1.5rem auto;
    position: relative;
    padding-bottom: 15px;
}
.risk-segments {
    display: flex;
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    background: #eee;
}
.segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: transparent; /* Text only shows active state */
    transition: 0.3s;
}
.segment.low { background-color: var(--color-success); }
.segment.med { background-color: var(--color-warning); }
.segment.high { background-color: var(--color-danger); }

.risk-arrow {
    position: absolute;
    bottom: -10px;
    transform: translateX(-50%);
    font-size: 1.5rem;
    transition: left 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    left: 16%; /* Default Low */
}

/* Active Segment Text State */
.risk-segments.active-low .low { color: white; }
.risk-segments.active-med .med { color: white; }
.risk-segments.active-high .high { color: white; }

/* Status specific */
.text-low { color: var(--color-success); }
.text-med { color: var(--color-warning); }
.text-high { color: var(--color-danger); }

/* Spinners */
.spinner { width: 50px; height: 50px; border: 5px solid var(--accent-teal); border-top-color: var(--primary-teal); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.primary-btn {
    background: var(--primary-navy); color: white; padding: 1rem 1.5rem; border-radius: var(--radius-sm);
    font-weight: 700; border: none; cursor: pointer; transition: all 0.3s;
}
.primary-btn:hover { background: #153a5e; transform: translateY(-2px); box-shadow: 0 8px 15px rgba(30, 77, 123, 0.2); }
.outline-btn {
    background: transparent; color: var(--primary-navy); border: 2px solid var(--primary-navy);
    padding: 0.9rem 1.5rem; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; transition: 0.3s;
}
.outline-btn:hover { background: var(--accent-teal); border-color: var(--primary-teal); color: var(--primary-teal); }
.btn-large { font-size: 1.1rem; padding: 1.2rem; }

/* --- Screen 3.5: Symptoms Questionnaire --- */
.symptom-card {
    background: white;
    border: 2px solid #eb8c34; /* Orange border matching Swaasa vibe */
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}
.symptom-title {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    line-height: 1.4;
}
.symptom-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}
.symptom-chip {
    border: 2px solid var(--border-soft);
    padding: 0.6rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    background-color: var(--bg-surface);
}
.symptom-chip.active {
    background-color: var(--accent-teal);
    border-color: var(--primary-teal);
    color: var(--primary-teal);
}
.symptom-chip:hover:not(.active) {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}
.no-symptom {
    text-align: center;
    margin-top: 0.5rem;
}
.submit-btn {
    border-radius: 30px;
    padding: 0.8rem 2.5rem;
    background: #d1d5db; /* Default disabled/grayish style */
    color: white;
    box-shadow: none;
}
.submit-btn.active-submit {
    background: var(--primary-teal);
    box-shadow: 0 8px 15px rgba(38, 183, 151, 0.3);
}
.submit-btn.active-submit:hover {
    background: #1f9d81;
    transform: translateY(-2px);
}

/* --- Quality Warning Banner --- */
.warning-banner {
    background: #fef3c7;
    color: #92400e;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-warning);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: slideUp 0.3s ease-out;
}
.warning-banner i {
    font-size: 1.4rem;
    color: var(--color-warning);
}

/* --- Spectrogram Image --- */
.spectrogram-img-wrap {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #1e1e1e; /* Dark theme looking like a medical monitor */
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    padding: 0.2rem;
}
.spectrogram-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    filter: contrast(1.2) brightness(1.1);
    border-radius: 4px;
}