:root {
    /* Color Palette */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);

    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Area Colors */
    --relationships-color: #ef4444;
    --body-color: #3b82f6;
    --community-color: #f59e0b;
    --work-color: #10b981;
    --entertainment-color: #8b5cf6;
    --personal-color: #6b7280;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    body {
        background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem;
    }
}

.container {
    width: 100%;
    max-width: 900px;
    background: var(--card-bg);
    border-radius: 32px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    min-height: 600px;
}

/* Page Management */
.page {
    display: none;
    padding: 1.5rem;
    animation: fadeIn 0.4s ease-out forwards;
}

.page.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .page {
        padding: 4rem;
    }
}

/* Landing Page */
#landing-page {
    text-align: center;
}

.logo-placeholder {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

#landing-page h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#landing-page .subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.features-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
    text-align: left;
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 20px;
    transition: transform 0.2s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

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

/* Test Page Header */
.page-header {
    margin-bottom: 2.5rem;
}

.back-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-gradient);
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.instruction-text {
    background: #eff6ff;
    color: #1e40af;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
}

/* Area Styling */
.area {
    margin-bottom: 4rem;
    border-left: 6px solid #e2e8f0;
    padding-left: 1.5rem;
}

.area.relationships {
    border-color: var(--relationships-color);
}

.area.body {
    border-color: var(--body-color);
}

.area.community {
    border-color: var(--community-color);
}

.area.work {
    border-color: var(--work-color);
}

.area.entertainment {
    border-color: var(--entertainment-color);
}

.area.personal {
    border-color: var(--personal-color);
}

.area-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Unit Styling */
.unit {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.unit-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.unit-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Sliders */
.sliders {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .sliders {
        grid-template-columns: 1fr 1fr;
    }
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.slider-value {
    background: var(--primary-gradient);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: monospace;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 2px solid #6366f1;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 2px solid #6366f1;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.15rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -3px rgba(99, 102, 241, 0.4);
}

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

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

@media (min-width: 640px) {
    .button-group {
        flex-direction: row;
        justify-content: center;
    }
}

.sticky-buttons {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: -1.5rem;
    border-top: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .sticky-buttons {
        margin-left: -4rem;
        margin-right: -4rem;
        margin-bottom: -4rem;
        padding: 2rem 4rem;
    }
}

/* Results Customization */
.hero-box {
    background: var(--primary-gradient) !important;
    color: white;
    text-align: center;
    padding: 3rem !important;
    border-radius: 24px;
    margin-bottom: 2rem;
}

.overall-score {
    font-size: 4rem;
    font-weight: 900;
}

.insight-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.insight-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.action-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .action-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.action-card {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.badge {
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.contribution {
    background: #dcfce7;
    color: #166534;
}

.improvement {
    background: #fee2e2;
    color: #991b1b;
}

.area-label {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    display: inline-block;
}

.area-label.relationships {
    background: var(--relationships-color);
}

.area-label.body {
    background: var(--body-color);
}

.area-label.community {
    background: var(--community-color);
}

.area-label.work {
    background: var(--work-color);
}

.area-label.entertainment {
    background: var(--entertainment-color);
}

.area-label.personal {
    background: var(--personal-color);
}

/* Table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.summary-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.table-wrapper.hidden {
    display: none;
}

/* Print Overrides */
@media print {
    body {
        background: white;
        padding: 0;
        display: block;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
        border: none;
        background: none;
    }

    .page {
        display: none !important;
    }

    #results-page {
        display: block !important;
        padding: 0;
    }

    .back-link,
    .btn,
    .progress-container {
        display: none !important;
    }
}