:root {
    /* Brand Colors (Humm Style) */
    --primary-color: #2D3748; /* Dark Gray */
    --primary-hover: #1A202C;
    --secondary-color: #3182CE; /* Blue */
    --bg-color: #F7FAFC; /* Gray 50 */
    --surface-color: #FFFFFF;
    --text-main: #2D3748; /* Gray 800 */
    --text-muted: #718096; /* Gray 500 */
    
    /* Star Rating */
    --star-empty: #E2E8F0;
    --star-filled: #ECC94B;
    
    /* UI Elements */
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.app-container {
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h2 {
    font-weight: 700;
    font-size: 2rem;
    color: var(--primary-color);
    letter-spacing: -1px;
}

/* Views & Animations */
.view {
    display: none;
    flex: 1;
}

.view.active {
    display: block;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Cards */
.glass-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid #E2E8F0;
    transition: box-shadow 0.3s ease;
}

.card-header {
    margin-bottom: 2.5rem;
}

.card-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.intro-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    background: #EDF2F7;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-top: 1.5rem;
    text-align: left;
}

/* Forms */
.form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Make some fields full width */
.form-group:nth-child(1), /* Honeypot */
.form-group.consent-group,
.btn-block {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    padding: 0.8rem 1rem;
    border: 1px solid #CBD5E0;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    background-color: #FFFFFF;
}

input:focus, select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: #F7FAFC;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid #E2E8F0;
    cursor: pointer;
}

.checkbox-label input {
    margin-top: 0.3rem;
}

.checkbox-label span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

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

.btn-secondary {
    background-color: #EDF2F7;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #E2E8F0;
}

/* Diagnostic UI */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: #EDF2F7;
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--secondary-color);
    width: 0%;
    transition: width 0.4s ease;
}

.diagnostic-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.diagnostic-header h2 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.scale-guide {
    background: #EBF8FF;
    border-left: 4px solid var(--secondary-color);
    padding: 0.8rem;
    margin-bottom: 2rem;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    font-size: 0.85rem;
    color: #2B6CB0;
    text-align: center;
}

.question-item {
    margin-bottom: 1.5rem;
    background: #FFFFFF;
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stars {
    display: flex;
    gap: 0.5rem;
}

.star-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--star-empty);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.2rem;
}

.star-btn:hover {
    transform: scale(1.1);
}

.star-btn.active, .star-btn.hover-active {
    color: var(--star-filled);
}

.rating-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.diagnostic-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E2E8F0;
}

/* Report UI */
.report-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #EDF2F7;
    padding-bottom: 1.5rem;
}

.report-logo {
    max-height: 60px;
    margin-bottom: 1rem;
}

.report-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.summary-box {
    background: #F7FAFC;
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
}

.dashboard-stats {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-box {
    text-align: center;
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid #E2E8F0;
    min-width: 200px;
}

.score-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1;
    margin: 0.5rem 0;
}

.level-display {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

.strengths-gaps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.strengths h3 { color: #38A169; margin-bottom: 1rem; }
.gaps h3 { color: #E53E3E; margin-bottom: 1rem; }

.strengths ul, .gaps ul {
    list-style-position: inside;
    color: var(--text-main);
}

.strengths ul li, .gaps ul li {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #F7FAFC;
    border-radius: 4px;
}

.observation-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid #E2E8F0;
}

.observation-item h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #EDF2F7;
    padding-bottom: 0.5rem;
}

.obs-text { margin-bottom: 1rem; color: var(--text-main); }
.rec-text { 
    background: #EBF8FF; 
    padding: 1rem; 
    border-radius: 4px; 
    font-size: 0.95rem;
    color: #2B6CB0;
}

.next-steps-container {
    background: #EDF2F7;
    padding: 2rem;
    border-radius: var(--border-radius-sm);
    margin-top: 3rem;
}

.next-steps-container h3 {
    margin-bottom: 1rem;
}

.next-steps-container ul li {
    margin-bottom: 0.8rem;
    margin-left: 1.5rem;
}

.report-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #E2E8F0;
    color: var(--text-muted);
    font-style: italic;
}

/* Loading Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden { display: none; }

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #E2E8F0;
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    .form-container, .strengths-gaps {
        grid-template-columns: 1fr;
    }
    
    .glass-card { padding: 1.5rem; }
    
    .diagnostic-footer {
        flex-direction: column-reverse;
        gap: 1rem;
    }
    
    .btn { width: 100%; }
    
    .rating-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .observation-item h4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* --- NATIVE PRINT MODE --- */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .app-container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* Hide everything except the report */
    .main-header,
    #welcome-view,
    #diagnostic-view,
    .results-actions {
        display: none !important;
    }

    #results-view {
        display: block !important;
    }

    .glass-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Prevent breaking inside important blocks */
    .report-header,
    .summary-box,
    .dashboard-stats,
    .chart-container,
    .observation-item,
    .next-steps-container {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 20px !important;
    }
    
    /* Ensure grids/flexboxes format correctly in PDF */
    .strengths-gaps {
        display: flex !important;
        flex-direction: row !important;
        gap: 20px !important;
        page-break-inside: avoid !important;
    }
    
    .strengths, .gaps {
        width: 48% !important;
    }

    .report-logo {
        max-height: 50px !important;
    }
    
    #radarChart {
        width: 500px !important;
        height: 500px !important;
        margin: 0 auto !important;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
