@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;600;700&display=swap');

:root {
    --primary: #0f172a;
    --accent: #fbbf24;
    --accent-hover: #f59e0b;
    --bg-dark: #020617;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background Overlay */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/quiz_bg.png') no-repeat center center/cover;
    z-index: -1;
    filter: brightness(0.3) blur(2px);
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.5) 0%, rgba(2, 6, 23, 1) 100%);
    z-index: -1;
}

/* Quiz Container */
.quiz-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    perspective: 1000px;
}

.card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Step Typography */
h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 1rem;
}

.step-indicator {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
}

.title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.description {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

input, select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

input:focus, select:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1);
}

/* Buttons */
.btn-container {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary);
    flex: 2;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(251, 191, 36, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    flex: 1;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Animations */
.step {
    display: none;
    animation: slideIn 0.5s ease forwards;
}

.step.active {
    display: block;
}

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

/* Multi-choice items */
.option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.3);
}

.option-card.selected {
    background: rgba(251, 191, 36, 0.1);
    border-color: var(--accent);
}

.option-card i {
    font-size: 1.5rem;
    color: var(--accent);
}

/* Loading Overlay */
#loading {
    position: absolute;
    inset: 0;
    background: var(--bg-dark);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--accent);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section Enhanced */
.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.total-box {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.2) 100%);
    border: 1px solid var(--accent);
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px -5px rgba(251, 191, 36, 0.2);
}

.total-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
    font-family: 'Outfit', sans-serif;
    margin-top: 0.5rem;
}

.breakdown-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.detail-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.detail-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.detail-info i {
    color: var(--accent);
    background: rgba(251, 191, 36, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 1.25rem;
}

.detail-label {
    font-weight: 500;
    color: var(--text-main);
}

.detail-value {
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

.detail-value.deduction {
    color: #f87171;
}

.ai-section {
    margin-top: 3rem;
}

.ai-brief {
    background: rgba(255, 255, 255, 0.04);
    padding: 2rem;
    border-radius: 20px;
    border-left: 5px solid var(--accent);
    font-style: italic;
    line-height: 1.8;
    color: #e2e8f0;
    position: relative;
}

.ai-brief::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 4rem;
    color: rgba(251, 191, 36, 0.1);
    font-family: serif;
}

@media (max-width: 640px) {
    .quiz-container {
        padding: 1rem;
    }
    .card {
        padding: 1.5rem;
        border-radius: 20px;
    }
    .title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    .description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    .total-box {
        padding: 1.5rem;
    }
    .total-value {
        font-size: 2.25rem;
    }
    .btn-container {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    .btn {
        width: 100%;
        padding: 1.125rem;
    }
    .option-card {
        padding: 1rem;
    }
    .detail-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .detail-value {
        align-self: flex-end;
    }
    .ai-brief {
        padding: 1.5rem;
        font-size: 0.95rem;
    }
}

/* Very small devices (iPhone SE, etc) */
@media (max-width: 380px) {
    .title {
        font-size: 1.25rem;
    }
    .total-value {
        font-size: 2rem;
    }
}
