/* ===== Design Tokens ===== */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(139, 92, 246, 0.5);

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;

    --accent-violet: #8b5cf6;
    --accent-violet-light: #a78bfa;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    --gradient-main: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-blue) 50%, var(--accent-cyan) 100%);
    --gradient-warm: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-violet) 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Language Toggle ===== */
.lang-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    padding: 10px 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(20px);
    letter-spacing: 0.02em;
}

.lang-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-violet);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* ===== Screens ===== */
.screen {
    display: none;
    min-height: 100vh;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

/* ===== Intro Screen ===== */
.intro-container {
    max-width: 640px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-violet);
    top: -100px;
    right: -100px;
    animation: orbFloat 8s ease-in-out infinite alternate;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--accent-blue);
    bottom: -50px;
    left: -100px;
    animation: orbFloat 10s ease-in-out infinite alternate-reverse;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-cyan);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat 12s ease-in-out infinite alternate;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, -30px) scale(1.15);
    }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.15;
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-weight: 300;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle strong {
    color: var(--text-primary);
    font-weight: 600;
}

.instructions-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 36px;
    backdrop-filter: blur(20px);
    text-align: left;
}

.instructions-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent-violet-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.instructions-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.instructions-card p:last-child {
    margin-bottom: 0;
}

/* ===== Buttons ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--gradient-main);
    color: #fff;
    border: none;
    border-radius: var(--radius-xl);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-violet);
    transform: translateY(-2px);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ===== Progress Bar ===== */
.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-card);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 10%;
    background: var(--gradient-main);
    border-radius: 100px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* ===== Quiz Container ===== */
.quiz-container {
    max-width: 720px;
    width: 100%;
}

.question-area {
    animation: fadeIn 0.4s ease;
}

.question-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-violet-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ===== Option Items ===== */
.option-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.option-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.option-item.ranked {
    border-color: var(--border-active);
    background: rgba(139, 92, 246, 0.06);
}

.option-label {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.option-item.ranked .option-label {
    color: var(--text-primary);
}

/* ===== Rank Selector ===== */
.rank-selector {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.rank-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.rank-btn:hover {
    border-color: var(--accent-violet);
    color: var(--accent-violet-light);
    background: rgba(139, 92, 246, 0.08);
}

.rank-btn.active {
    background: var(--accent-violet);
    border-color: var(--accent-violet);
    color: #fff;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.rank-btn.used {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

.rank-btn.active.used {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}

/* ===== Validation Message ===== */
.validation-msg {
    font-size: 0.85rem;
    color: var(--accent-amber);
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.validation-msg.visible {
    opacity: 1;
}

/* ===== Quiz Nav ===== */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    gap: 12px;
}

/* ===== Results Screen ===== */
.results-container {
    max-width: 760px;
    width: 100%;
    text-align: center;
}

.results-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 10px;
}

.results-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 40px;
}

.chart-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 36px;
    backdrop-filter: blur(20px);
}

/* ===== Score Cards ===== */
.score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.score-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 22px 16px;
    text-align: center;
    transition: var(--transition);
}

.score-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.score-card-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.score-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.score-card-value {
    font-size: 1.8rem;
    font-weight: 800;
}

/* ===== Dominant Card ===== */
.dominant-card {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 36px;
    text-align: left;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow);
}

.dominant-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.dominant-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .screen {
        padding: 24px 16px;
    }

    .instructions-card {
        padding: 20px;
    }

    .option-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .rank-selector {
        align-self: flex-end;
    }

    .quiz-nav {
        flex-direction: column;
    }

    .quiz-nav button {
        width: 100%;
        justify-content: center;
    }

    .score-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}