:root {
    --primary: #AA6568;
    --primary-dark: #8a5052;
    --secondary: #8C8272;
    --bg-color: #F3EFEC;
    --card-bg: #FFFFFF;
    --text-main: #4F4F66;
    --text-muted: #7A7A8C;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --font-family: 'Outfit', sans-serif;
    --radius: 16px;
    --shadow: 0 10px 30px -5px rgba(170, 101, 104, 0.15);
    /* Tint shadow with primary */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 10px;
    margin-bottom: 40px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 20%;
    /* Start at 20% */
    transition: width 0.5s ease;
}

/* Wizard Steps */
.step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step.active {
    display: block;
}

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

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

.step-header {
    margin-bottom: 30px;
}

.step-pill {
    background: #EFF6FF;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.step-header h2 {
    margin-top: 15px;
    font-size: 1.8rem;
    color: var(--text-main);
}

/* Questions */
.question-group {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F1F5F9;
}

.question-group:last-child {
    border-bottom: none;
}

.question-group label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #334155;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.option-card {
    position: relative;
    cursor: pointer;
}

.option-card input {
    position: absolute;
    opacity: 0;
}

.option-card span {
    display: block;
    padding: 15px;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.option-card input:checked+span {
    background: #EFF6FF;
    border-color: var(--primary);
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.option-card:hover span {
    border-color: #CBD5E1;
}

/* Buttons */
.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

button {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-family);
}

.btn-next,
.btn-submit {
    background: var(--primary);
    color: white;
    margin-left: auto;
    /* Push to right if alone */
}

.btn-next:hover,
.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-prev {
    background: transparent;
    color: var(--text-muted);
    border: 2px solid #E2E8F0;
}

.btn-prev:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
}

/* Results Section */
.hidden {
    display: none !important;
}

.result-card {
    text-align: center;
    padding: 20px 0;
}

.result-card h2 {
    font-size: 2rem;
    margin-bottom: 40px;
}

/* Accelerometer Gauge */
.gauge-wrapper {
    position: relative;
    width: 300px;
    height: 160px;
    /* Half circle height */
    margin: 0 auto 30px;
    overflow: hidden;
}

.gauge {
    position: relative;
    width: 300px;
    height: 150px;
    /* Gradient Background */
    background: conic-gradient(from 0.75turn at 50% 100%,
            var(--danger) 0deg,
            var(--warning) 90deg,
            var(--success) 180deg);
    border-top-left-radius: 150px;
    border-top-right-radius: 150px;
    overflow: hidden;
}

.gauge-fill {
    display: none;
}

/* We simply rotate a needle */
.needle {
    position: absolute;
    bottom: 0;
    /* Align with bottom of gauge-wrapper */
    left: 50%;
    width: 4px;
    height: 140px;
    background: #1E293B;
    transform-origin: bottom center;
    transform: rotate(-90deg);
    /* Start at 0 */
    transition: transform 2s cubic-bezier(0.1, 0, 0.1, 1);
    z-index: 10;
    border-radius: 4px;
}

.gauge-cover {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 110px;
    background: var(--card-bg);
    border-top-left-radius: 110px;
    border-top-right-radius: 110px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.05);
}

#score-number {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
    color: var(--text-main);
}

.score-status {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 10px;
    color: var(--primary);
}

.result-details p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 20px auto 40px;
    line-height: 1.6;
}

/* CTA */
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    text-decoration: none;
    padding: 18px 36px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.5);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.btn-restart {
    background: transparent;
    color: var(--text-muted);
    margin-top: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border: none;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .app-container {
        padding: 20px;
    }

    .app-header h1 {
        font-size: 2rem;
    }

    .options {
        grid-template-columns: 1fr;
    }

    .gauge-wrapper,
    .gauge {
        width: 260px;
        height: 130px;
    }

    .gauge {
        border-top-left-radius: 130px;
        border-top-right-radius: 130px;
    }

    .needle {
        height: 120px;
    }

    .gauge-cover {
        width: 180px;
        height: 90px;
        border-top-left-radius: 90px;
        border-top-right-radius: 90px;
    }

    #score-number {
        font-size: 3rem;
    }
}