:root {
    --bg-color: #09090b;
    --card-bg: rgba(24, 24, 27, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --item-bg: rgba(255, 255, 255, 0.03);
    --item-hover-bg: rgba(255, 255, 255, 0.08);
    --item-active-border: #6366f1;
    --radius: 16px;
    --font-family: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Background Pattern */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.08), transparent 25%);
    pointer-events: none;
}

.background-pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.3;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.app-container {
    width: 100%;
    max-width: 580px;
    min-height: 500px;
    margin: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: min-height 0.4s ease;
}

/* Typography */
h1,
h2,
h3 {
    color: var(--text-main);
    font-weight: 600;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

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

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-out {
    animation: fadeOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Screens */
.screen {
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Loader */
.loader-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Start Screen */
.start-screen {
    text-align: center;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.start-title {
    font-size: 28px;
    line-height: 1.2;
    background: linear-gradient(to bottom right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.start-description {
    font-size: 16px;
    max-width: 400px;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 20px -5px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 25px -5px var(--primary-glow);
}

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

/* Quiz UI */
.quiz-header {
    position: relative;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-line-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
}

.progress-line {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--primary-glow);
}

.group-tag {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.question-title {
    font-size: 22px;
    margin-bottom: 32px;
    line-height: 1.4;
}

/* Option Tiles */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-tile {
    background: var(--item-bg);
    border: 1px solid var(--card-border);
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.option-tile:hover {
    background: var(--item-hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.01);
}

.option-tile.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 1px var(--primary);
}

.option-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s;
}

.option-tile:hover .option-icon {
    color: var(--text-main);
}

.option-tile.selected .option-icon {
    color: var(--primary);
}

.option-label {
    flex: 1;
    font-size: 15px;
    color: var(--text-main);
}

/* Result Screen */
.result-screen {
    text-align: center;
    justify-content: center;
    align-items: center;
}

.score-badge {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 24px;
    text-shadow: 0 0 30px var(--primary-glow);
}

.result-title {
    font-size: 24px;
    margin-bottom: 16px;
}

.result-description {
    font-size: 16px;
    margin-bottom: 40px;
}

/* Offer Card */
.offer-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 12px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.offer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.offer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.offer-icon-main {
    color: var(--primary);
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.offer-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.offer-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.offer-list-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.offer-benefits {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.offer-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.benefit-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    color: #10b981;
    /* Success Green */
    margin-top: 3px;
}

/* Buttons Variants */
.btn-block {
    width: 100%;
    display: flex;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-shiny {
    position: relative;
    overflow: hidden;
    background: linear-gradient(45deg, var(--primary), #818cf8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-shiny::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(45deg) translate(-100%, -100%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: rotate(45deg) translate(-100%, -100%);
    }

    20% {
        transform: rotate(45deg) translate(100%, 100%);
    }

    100% {
        transform: rotate(45deg) translate(100%, 100%);
    }
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--card-border);
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 600px) {
    body {
        align-items: flex-start;
    }

    .app-container {
        margin: 0;
        min-height: 100vh;
        height: auto;
        border-radius: 0;
        border: none;
        overflow-y: visible;
    }

    .screen {
        padding: 24px;
    }

    .start-title {
        font-size: 24px;
    }

    .question-title {
        font-size: 20px;
    }
}