/* Quiz Modern Styles */

:root {
    --primary: #A9112C;
    --primary-light: #C52A44;
    --secondary: #0f172a;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --border-gray: #e2e2e2;
    --text-main: #1e293b;
    --text-muted: #475569;
    --text-light: #94a3b8;
    --font-main: 'Mulish', sans-serif;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.quiz-body {
    background-color: var(--bg-light);
    font-family: var(--font-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.quiz-header {
    background: white;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo-area {
    display: flex;
    justify-content: center;
    width: 100%;
}

.quiz-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem 1.5rem 3rem;
}

.wizard-card {
    background: white;
    width: 680px;
    /* Standardized width */
    max-width: 100%;
    min-height: 520px;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.result-card,
.loading-card {
    width: 680px;
    max-width: 100%;
    min-height: 520px;
    padding: 3rem 0;
    /* Remove background, border, shadow */
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Progress Bar */
.progress-container {
    margin-bottom: 3rem;
}

.progress-bar-bg {
    background-color: var(--border-gray);
    height: 6px;
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    height: 100%;
    transition: width 0.4s ease;
}

.step-info {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 700;
}

.step-text {
    color: var(--text-light);
}

.step-percentage {
    color: var(--primary);
}

/* Question Styles */
.question-content {
    flex: 1;
}

.question-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 2.5rem;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.options-grid {
    display: grid;
    gap: 1rem;
}

.option-btn {
    display: flex;
    align-items: center;
    text-align: left !important;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 1.5px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn .option-radio {
    flex-shrink: 0;
}

.option-btn span {
    flex: 1;
}

.option-btn.flash-select {
    border-color: var(--primary);
    background-color: rgba(169, 17, 44, 0.1);
    transform: scale(0.98);
}

.option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-light);
    border-radius: 50%;
    margin-right: 1.25rem;
    position: relative;
    transition: all 0.2s ease;
}

.option-btn:hover {
    border-color: var(--primary);
    background-color: rgba(169, 17, 44, 0.02);
}

.option-btn.selected {
    border-color: var(--primary);
    background-color: rgba(169, 17, 44, 0.05);
    font-weight: 700;
}

.option-btn.selected .option-radio {
    border-color: var(--primary);
}

.option-btn.selected .option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

/* Form Layouts */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1.5px solid var(--border-gray);
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(169, 17, 44, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

/* Segmented Toggle for Role */
.role-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.toggle-btn {
    padding: 1.25rem;
    border: 1.5px solid var(--border-gray);
    border-radius: var(--radius-md);
    background: white;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(169, 17, 44, 0.05);
    box-shadow: inset 0 0 0 1px var(--primary);
}

/* Actions */
.quiz-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-back {
    color: var(--text-light) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.95rem;
    padding: 0 !important;
}

.btn-back:hover {
    color: var(--text-muted) !important;
    background: transparent !important;
}

/* Loading Styles */
.loading-card {
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    min-height: 520px;
}

.loader-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.loader-circle {
    width: 64px;
    height: 64px;
    border: 4px solid var(--bg-gray);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

.quiz-footer {
    padding: 1rem 0 5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

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

/* Results Report Style */
.result-card {
    padding: 4rem;
    min-height: auto;
}

.report-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.score-visual {
    position: relative;
    display: inline-flex;
    margin-bottom: 2rem;
    justify-content: center;
    align-items: center;
}

.score-ring {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        var(--ring-color) calc(var(--progress) * 3.6deg),
        #e5e7eb calc(var(--progress) * 3.6deg)
    );
    mask: radial-gradient(farthest-side, transparent calc(100% - 16px), white calc(100% - 15px));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 16px), white calc(100% - 15px));
    transition: --progress 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-ring::after {
    content: '';
    position: absolute;
    inset: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: -1;
}

.score-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.score-number {
    display: block;
    font-size: 3rem;
    font-weight: 900;
    color: var(--secondary);
    line-height: 1;
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
    margin-top: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.report-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.report-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Feedback Groups */
.feedback-group {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2.5rem;
    text-align: left;
}

.group-header-container {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 1rem;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.group-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

.group-header.success {
    color: #059669;
}

.group-header.warning {
    color: #d97706;
}

.group-header.info {
    color: #2563eb;
}

.feedback-item {
    margin-bottom: 0.75rem;
}

.feedback-item:last-child {
    margin-bottom: 0;
}

.feedback-accordion {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.feedback-accordion:hover {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.feedback-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.feedback-icon.success {
    color: #10b981;
}

.feedback-icon.warning {
    color: #f59e0b;
}

.feedback-icon.info {
    color: #3b82f6;
}

.accordion-toggle-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    color: var(--text-light);
}

.accordion-header.active .accordion-toggle-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-content.active {
    max-height: 500px;
}

.accordion-body {
    padding: 0 1.25rem 1.25rem;
}

.item-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.item-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Responsive */

/* Tablet */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem;
    }

    .wizard-card,
    .result-card,
    .loading-card {
        width: 100%;
        padding: 2.5rem 2rem;
        min-height: auto;
    }

    .question-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .report-title {
        font-size: 1.5rem;
    }

    .report-desc {
        font-size: 1rem;
    }

    .feedback-group {
        padding: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .quiz-header {
        padding: 0.75rem 0;
    }

    .logo-area img {
        height: 50px !important;
    }

    .quiz-container {
        padding: 0.5rem 0.75rem 1.5rem;
        align-items: flex-start;
    }

    .wizard-card,
    .result-card,
    .loading-card {
        width: 100%;
        padding: 1.75rem 1.25rem;
        min-height: auto;
        border-radius: 16px;
    }

    .progress-container {
        margin-bottom: 1rem;
    }

    .step-info {
        font-size: 0.8rem;
    }

    .question-title {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }

    .option-btn {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }

    .option-radio {
        width: 18px;
        height: 18px;
        margin-right: 1rem;
    }

    /* Form adjustments */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .form-grid .form-group {
        margin-bottom: 0;
    }

    .role-toggle {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .toggle-btn {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .form-input {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    /* Actions */
    .quiz-actions {
        margin-top: 1.5rem;
        flex-direction: column-reverse;
        gap: 1rem;
        align-items: stretch;
    }

    .btn-back {
        width: 100%;
        justify-content: center;
        padding: 0.75rem !important;
    }

    .btn-next,
    .btn-primary {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }

    /* Loading */
    .loader-circle {
        width: 56px;
        height: 56px;
    }

    .loading-card h3 {
        font-size: 1.25rem;
    }

    .loading-card p {
        font-size: 0.9rem;
    }

    /* Results */
    .report-header {
        padding: 0;
    }

    .score-visual {
        margin-bottom: 1.5rem;
    }

        .score-ring {
        width: 130px;
        height: 130px;
    }

    .score-number {
        font-size: 2.5rem;
    }

    .score-label {
        font-size: 0.65rem;
    }

    .report-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .report-desc {
        font-size: 0.95rem;
        max-width: 100%;
    }

    .feedback-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1.5rem !important;
    }

    .feedback-group {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .group-header {
        font-size: 0.9rem;
        padding-bottom: 0.75rem;
        margin-bottom: 1rem;
    }

    .item-title {
        font-size: 0.9rem;
    }

    .item-text {
        font-size: 0.85rem;
    }

    .btn-large {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }

    .quiz-footer {
        padding: 2rem 0 3rem;
        font-size: 0.85rem;
    }
}

/* Extra small mobile */
@media (max-width: 375px) {

    .wizard-card,
    .result-card,
    .loading-card {
        padding: 1.25rem 1rem;
    }

    .question-title {
        font-size: 1.15rem;
    }

    .option-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .form-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .report-title {
        font-size: 1.15rem;
    }

        .score-ring {
        width: 120px;
        height: 120px;
    }

    .score-number {
        font-size: 2.25rem;
    }
}

/* Feedback Icons & Muted Colors */
.icon-muted {
    width: 20px;
    height: 20px;
    /* margin-right is handled by accordion-title gap */
}

.icon-muted.success {
    color: #34d399;
    /* Emerald 400 */
}

.icon-muted.warning {
    color: #fbbf24;
    /* Amber 400 */
}

.icon-muted.info {
    color: #60a5fa;
    /* Blue 400 */
}

/* Empty State */
.feedback-item.empty-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.empty-icon {
    width: 24px;
    height: 24px;
}

.empty-icon.success {
    color: #10b981;
    /* Emerald 500 */
}

.empty-icon.warning {
    color: #f59e0b;
    /* Amber 500 */
}

.empty-icon.info {
    color: #3b82f6;
    /* Blue 500 */
}