/* ===== KERN-STILE ===== */
:root {
    --primary-color: #b98c2e;
    --primary-hover: #C7A358;
    --secondary-color: #2e5cb9;
    --border-color: #e0e0e0;
    --background-light: #f9f9f9;
    --error-color: #c62828;
    --error-bg: #ffebee; /* Hinzugefügt */
    --success-color: #2e7d32;
    --font-color: #333;
    --light-text: #777;
    --transition-speed: 0.3s;
}

/* ===== QUIZ-CONTAINER ===== */
.sma-test-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

/* Progress Bar Styling */
.progress-container {
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
}

#progressBar {
    height: 8px;
    background-color: #B98C2E;
    border-radius: 4px;
    overflow: hidden;
}

#progressBar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--light-text);
}

.progress-text span {
    font-weight: bold;
    color: var(--primary-color);
}

/* ===== FRAGEGRUPPEN ===== */
.question-group {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.question-group.active {
    display: block;
}

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

/* ===== BUTTONS ===== */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.button-group button {
    flex: 1;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.button-group button.prev-button {
    background: #f0f0f0;
    color: var(--font-color);
}

.button-group button.next-button,
.button-group button.result-button {
    background: var(--primary-color);
    color: white;
}

.button-group button:hover:not(:disabled) { /* :disabled hinzugefügt */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.button-group button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== EINGABEFELDER ===== */
#quizForm label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    margin-bottom: 0.8rem;
    border-bottom: 1px dashed var(--border-color);
}

#quizForm input[type="number"] {
    width: 60px;
    height: 46px;
    padding: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    transition: all var(--transition-speed);
}

#quizForm input[type="number"].error { /* Fehlerklasse hinzugefügt */
    border-color: var(--error-color);
}

#quizForm input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 3px rgba(185, 140, 46, 0.2);
}

/* ===== ERGEBNISSE ===== */
.result-container {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.result-container.visible {
    display: block;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.archetype-result {
    padding: 1rem;
    background: var(--background-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.archetype-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.archetype-score {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

/* ===== DIAGRAMM ===== */
.chart-container {
    position: relative;
    height: 400px;
    margin: 2rem 0;
}

#resultChart {
    width: 100% !important;
    height: 100% !important;
}

/* ===== E-MAIL-FORMULAR ===== */
#email-form-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: none; /* Standardmäßig ausgeblendet */
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#email-results-form input[type="text"],
#email-results-form input[type="email"],
#email-results-form input[type="number"],
#email-results-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition-speed);
}

#email-results-form textarea {
    min-height: 100px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.checkbox-group input {
    margin-right: 0.5rem;
}

.checkbox-group.error {
    border: 2px solid var(--error-color);
    padding: 10px;
    border-radius: 8px;
    animation: shake 0.5s;
}

.checkbox-group a {
    color: var(--primary-color);
    text-decoration: underline;
}

.checkbox-group a:hover {
    color: var(--primary-hover);
}

#submit-email-results {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

#submit-email-results:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

#submit-email-results:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== FEHLER/ERFOLGSMELDUNGEN ===== */
.error-messages {
    background: var(--error-bg);
    border-left: 4px solid var(--error-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
    color: var(--error-color);
    display: none; /* Standardmäßig ausgeblendet */
}

/* Erfolgsmeldung */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.success-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
}

.close-overlay {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

.close-overlay:hover {
    background: var(--primary-hover);
}

/* Spam-Check Styling */
#sma-spam-check.error {
    border-color: #c62828;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Formular-Container */
#email-form-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
    display: none; /* Initial versteckt */
}

.email-form-intro {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.email-form-intro p {
    margin: 0;
    color: var(--font-color);
    line-height: 1.5;
}

/* Inline-Fehlermeldungen */
.inline-error {
    color: #c62828;
    font-size: 0.85rem;
    display: none;
    margin-top: 0.25rem;
    animation: shake 0.5s;
}

input.error {
    border-color: #c62828 !important;
    background-color: #ffebee;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Input-Fehlerstatus */
#quizForm input[type='number'].error {
    border-color: #c62828;
    background-color: #ffebee;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .sma-test-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    #quizForm label {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #quizForm input[type="number"] {
        width: 100%;
        margin-top: 0.5rem;
    }
}