/* --- EMTO DESIGN SYSTEM & CSS --- */

:root {
    --bg-color: hsl(220, 20%, 8%);
    --card-bg: rgba(22, 28, 38, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: hsl(210, 20%, 96%);
    --text-secondary: hsl(210, 10%, 75%);
    --text-muted: hsl(210, 8%, 55%);
    
    /* EMTO Brand colors */
    --emto-red: hsl(350, 68%, 36%);
    --emto-red-hover: hsl(350, 75%, 45%);
    --emto-red-glow: rgba(139, 27, 47, 0.35);
    
    /* System Colors */
    --success-green: hsl(142, 72%, 40%);
    --success-glow: rgba(34, 197, 94, 0.25);
    --error-red: hsl(350, 75%, 48%);
    --error-glow: rgba(220, 38, 38, 0.25);
    
    --shadow-large: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Decor Elements */
.background-decor {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, var(--emto-red-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

.background-decor-2 {
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

/* Header */
.app-header {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 2.5rem 1rem 1.5rem;
    z-index: 10;
}

.logo-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-large);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.logo-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.logo-img {
    height: 48px;
    object-fit: contain;
}

/* Container & Cards */
.app-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    box-shadow: var(--shadow-large);
    backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.card.active {
    display: flex;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h2 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 40%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Registration Form */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"], input[type="password"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: var(--transition-smooth);
    width: 100%;
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--emto-red);
    box-shadow: 0 0 0 3px var(--emto-red-glow);
    background: rgba(0, 0, 0, 0.4);
}

.error-msg {
    color: var(--error-red);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 2.2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
}

.primary-btn {
    background: var(--emto-red);
    color: white;
    box-shadow: 0 4px 15px var(--emto-red-glow);
}

.primary-btn:hover:not(:disabled) {
    background: var(--emto-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--emto-red-glow);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.success-btn {
    background: var(--success-green);
    color: white;
    box-shadow: 0 4px 15px var(--success-glow);
}

.success-btn:hover {
    background: hsl(142, 72%, 35%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--success-glow);
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

/* Quiz Wizard Styles */
.quiz-progress-bar-container {
    margin-bottom: 2rem;
}

.quiz-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emto-red), #b52a42);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.1, 0.8, 0.1, 1);
}

.category-badge {
    background: var(--emto-red-glow);
    border: 1px solid rgba(139, 27, 47, 0.3);
    color: hsl(350, 75%, 70%);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-block;
    margin-bottom: 1.2rem;
}

.question-text {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

/* Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.option-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    user-select: none;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.option-item.selected {
    background: rgba(139, 27, 47, 0.15);
    border-color: var(--emto-red);
    box-shadow: 0 4px 20px rgba(139, 27, 47, 0.1);
}

.option-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.option-item.selected .option-radio {
    border-color: var(--emto-red);
}

.option-item.selected .option-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--emto-red);
    display: block;
}

.option-text {
    font-size: 1.05rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.option-item.selected .option-text {
    color: var(--text-primary);
    font-weight: 500;
}

/* Correct / Incorrect states */
.option-item.correct {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: var(--success-green) !important;
}

.option-item.correct .option-radio {
    border-color: var(--success-green) !important;
}

.option-item.correct .option-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--success-green) !important;
    display: block;
}

.option-item.incorrect {
    background: rgba(220, 38, 38, 0.12) !important;
    border-color: var(--error-red) !important;
}

.option-item.incorrect .option-radio {
    border-color: var(--error-red) !important;
}

.option-item.incorrect .option-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--error-red) !important;
    display: block;
}

/* Feedback Area */
.feedback-area {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem 2rem;
    margin-bottom: 2.5rem;
    display: none;
    align-items: flex-start;
    gap: 1.5rem;
    animation: slideUp 0.3s ease-out;
}

.feedback-area.active {
    display: flex;
}

.feedback-status {
    font-size: 2.5rem;
    line-height: 1;
}

.feedback-text-container h4 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.feedback-area.correct-feedback {
    border-color: var(--success-green);
    background: rgba(34, 197, 94, 0.05);
}

.feedback-area.correct-feedback h4 {
    color: var(--success-green);
}

.feedback-area.incorrect-feedback {
    border-color: var(--error-red);
    background: rgba(220, 38, 38, 0.05);
}

.feedback-area.incorrect-feedback h4 {
    color: var(--error-red);
}

.explanation-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.quiz-actions {
    display: flex;
    justify-content: flex-end;
}

.hidden {
    display: none !important;
}

/* Completion section */
.result-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.success-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.score-display {
    text-align: center;
    margin-bottom: 2.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 16px;
}

.score-num {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.completion-message {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(0, 0, 0, 0.2);
    width: 100%;
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: underline;
    transition: var(--transition-smooth);
}

.app-footer a:hover {
    color: var(--text-primary);
}

/* Responsive adjustment */
@media(max-width: 600px) {
    .card {
        padding: 2rem 1.5rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .question-text {
        font-size: 1.25rem;
    }
}
