/* ============================================================
   TEST MANAGEMENT SITUATIONNEL — Widget CSS
   Préfixé .mw- pour éviter tout conflit
   Halo identique au widget DISC (wrapper ::before/::after)
   ============================================================ */

/* Import font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ===== HALO ANIMATION (même technique que DISC) ===== */
@property --mw-halo {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}
@keyframes mw-halo-spin {
    0% { --mw-halo: 0deg; }
    100% { --mw-halo: 360deg; }
}
@keyframes mw-halo-shimmer {
    0%,100% { opacity:0.5; }
    50% { opacity:0.7; }
}

/* ===== ROOT CONTAINER (with halo border like DISC) ===== */
.mw-root {
    position: relative;
    border-radius: 28px;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: #1a1a1a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.mw-root *, .mw-root *::before, .mw-root *::after { box-sizing: border-box; }

/* Halo layer 1 : bordure nette qui tourne */
.mw-root::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 28px;
    z-index: 0;
    background: conic-gradient(from var(--mw-halo, 0deg),
        transparent 0%, transparent 25%,
        rgba(167,139,250,0.6) 32%, rgba(128,89,250,0.8) 38%,
        rgba(6,60,255,0.7) 45%, rgba(56,189,248,0.5) 52%,
        rgba(128,89,250,0.7) 58%, transparent 68%, transparent 100%);
    animation: mw-halo-spin 5s linear infinite;
}

/* Halo layer 2 : glow flou diffus */
.mw-root::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 34px;
    z-index: -1;
    background: conic-gradient(from var(--mw-halo, 0deg),
        transparent 0%, transparent 25%,
        rgba(167,139,250,0.6) 32%, rgba(128,89,250,0.8) 38%,
        rgba(6,60,255,0.7) 45%, rgba(56,189,248,0.5) 52%,
        rgba(128,89,250,0.7) 58%, transparent 68%, transparent 100%);
    filter: blur(18px);
    opacity: 0.75;
    animation: mw-halo-spin 5s linear infinite, mw-halo-shimmer 3s ease-in-out infinite;
}

/* ===== INTRO SCREEN ===== */
.mw-intro {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 32px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}
.mw-intro-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(128, 89, 250, 0.15);
}
.mw-intro-icon span { font-size: 36px; }
.mw-intro-title {
    font-size: 28px; font-weight: 900;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #1a1a1a, #2D2B55);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.mw-intro-desc {
    font-size: 15px; color: #64748b; max-width: 560px;
    margin: 0 auto 24px; line-height: 1.7;
}
.mw-intro-badges {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 10px; margin-bottom: 28px;
}
.mw-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: #f8f9ff;
    border: 1px solid #e2e8f0; border-radius: 50px;
    font-size: 13px; font-weight: 600; color: #4A5568;
}
.mw-intro-preview {
    display: flex; justify-content: center; gap: 12px;
    margin-bottom: 32px; flex-wrap: wrap;
}
.mw-preview-style {
    padding: 10px 18px; border-radius: 12px;
    border: 2px solid; font-size: 14px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    background: #fff;
}
.mw-btn-start {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #8059FA, #063CFF);
    color: #fff; font-size: 16px; font-weight: 700;
    font-family: inherit; border: none; border-radius: 50px;
    cursor: pointer; transition: all 0.3s;
    box-shadow: 0 6px 24px rgba(128, 89, 250, 0.3);
}
.mw-btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(128, 89, 250, 0.4);
}
.mw-btn-start svg { width: 18px; height: 18px; }
.mw-live-badge {
    margin-top: 20px; font-size: 13px; font-weight: 600;
    color: #8059FA; opacity: 0.8;
}

/* ===== QUESTION SCREEN ===== */
.mw-question-wrap {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    opacity: 0; transform: translateY(12px);
    transition: all 0.4s ease;
}
.mw-question-wrap.visible { opacity: 1; transform: translateY(0); }

.mw-progress { margin-bottom: 28px; }
.mw-progress-info {
    display: flex; justify-content: space-between;
    margin-bottom: 8px;
}
.mw-progress-count { font-size: 14px; font-weight: 700; color: #1a1a1a; }
.mw-progress-pct { font-size: 13px; font-weight: 600; color: #8059FA; }
.mw-progress-bar {
    height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden;
}
.mw-progress-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, #8059FA, #063CFF);
    transition: width 0.4s ease;
}

.mw-layout {
    display: grid; grid-template-columns: 1fr 300px;
    gap: 32px; align-items: start;
}
.mw-q-panel {
    background: transparent; border-radius: 20px; padding: 0;
}
.mw-q-title {
    font-size: 18px; font-weight: 700;
    margin-bottom: 24px; line-height: 1.5; color: #1a1a1a;
}
.mw-options { display: flex; flex-direction: column; gap: 10px; }
.mw-option {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px; border: 2px solid #f1f5f9;
    border-radius: 14px; background: #fff;
    cursor: pointer; transition: all 0.25s;
    font-family: inherit; font-size: 14px;
    text-align: left; color: #4A5568 !important;
    line-height: 1.5; width: 100%;
}
.mw-option:hover {
    border-color: #c4b5fd; background: #faf8ff;
    transform: translateX(4px);
    color: #5B21B6 !important;
}
.mw-option.selected {
    border-color: #8059FA; background: #f0edff;
    color: #5B21B6 !important; font-weight: 600;
}
.mw-option-text { flex: 1; }

/* Radar panel */
.mw-radar-panel {
    position: sticky; top: 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 20px; padding: 20px;
    background: #fff;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.mw-radar-svg { width: 100%; max-width: 300px; height: auto; }

/* ===== RESULTS SCREEN ===== */
.mw-results {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    opacity: 0; transform: translateY(20px);
    transition: all 0.6s ease;
}
.mw-results.visible { opacity: 1; transform: translateY(0); }

.mw-result-header {
    text-align: center; padding: 40px 0 32px;
    margin-bottom: 32px;
    border-bottom: 2px solid #f1f5f9;
}
.mw-result-icon {
    width: 72px; height: 72px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 32px; color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}
.mw-result-title {
    font-size: 32px; font-weight: 900; margin-bottom: 8px;
}
.mw-result-subtitle {
    font-size: 17px; color: #64748b; font-weight: 500;
}

.mw-result-layout {
    display: grid; grid-template-columns: 1fr 300px;
    gap: 32px; align-items: start; margin-bottom: 32px;
}
.mw-result-left {}
.mw-result-right {
    display: flex; align-items: center; justify-content: center;
    border-radius: 20px; padding: 20px;
    background: #fff;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.mw-result-desc {
    font-size: 16px; color: #4A5568; line-height: 1.8;
    margin-bottom: 28px;
}

/* Bars */
.mw-result-bars { display: flex; flex-direction: column; gap: 16px; }
.mw-result-bar { }
.mw-result-bar.dominant { }
.mw-result-bar-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 6px;
}
.mw-result-bar-emoji { font-size: 18px; }
.mw-result-bar-label { font-size: 15px; font-weight: 700; }
.mw-result-bar-pct { font-size: 14px; font-weight: 800; color: #1a1a1a; margin-left: auto; }
.mw-result-bar-badge {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    padding: 3px 10px; border-radius: 50px;
    background: linear-gradient(135deg, #8059FA, #063CFF);
    color: #fff; letter-spacing: 0.5px;
}
.mw-result-bar-track {
    height: 10px; background: #f1f5f9; border-radius: 5px; overflow: hidden;
}
.mw-result-bar-fill {
    height: 100%; border-radius: 5px; width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Details cards */
.mw-result-details {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 24px;
}
.mw-detail-card {
    padding: 28px; border-radius: 16px;
    border: 1px solid #f1f5f9; background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.mw-detail-card.forces { border-left: 4px solid #22c55e; }
.mw-detail-card.vigilance { border-left: 4px solid #f59e0b; }
.mw-detail-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.mw-detail-card ul {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.mw-detail-card li {
    font-size: 14px; color: #4A5568; padding-left: 20px;
    position: relative; line-height: 1.5;
}
.mw-detail-card.forces li::before {
    content: '✓'; position: absolute; left: 0;
    color: #22c55e; font-weight: 700;
}
.mw-detail-card.vigilance li::before {
    content: '!'; position: absolute; left: 0;
    color: #f59e0b; font-weight: 700;
}

/* Conseil */
.mw-result-conseil {
    padding: 28px; border-radius: 16px;
    background: linear-gradient(135deg, #f0edff, #e8f4ff);
    border: 1px solid #c4b5fd;
    margin-bottom: 32px;
}
.mw-result-conseil h3 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.mw-result-conseil p { font-size: 15px; color: #4A5568; line-height: 1.7; }

/* All styles grid */
.mw-result-allstyles { margin-bottom: 32px; }
.mw-result-allstyles h3 {
    font-size: 20px; font-weight: 800;
    text-align: center; margin-bottom: 8px;
}
.mw-result-allstyles-sub {
    font-size: 15px; color: #64748b;
    text-align: center; margin-bottom: 24px;
}
.mw-styles-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.mw-style-card {
    border-radius: 16px; border: 2px solid;
    overflow: hidden; transition: all 0.3s;
}
.mw-style-card.active {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.mw-style-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
}
.mw-style-card-emoji { font-size: 20px; }
.mw-style-card-name { font-size: 15px; font-weight: 800; }
.mw-style-card-pct { margin-left: auto; font-size: 14px; font-weight: 700; color: #1a1a1a; }
.mw-style-card-quand {
    padding: 12px 18px; font-size: 13px;
    color: #64748b; line-height: 1.6;
}

/* Actions */
.mw-result-actions {
    display: flex; justify-content: center;
    gap: 16px; flex-wrap: wrap;
}
.mw-btn-restart, .mw-btn-share {
    padding: 14px 32px; border-radius: 50px;
    font-size: 15px; font-weight: 700;
    font-family: inherit; cursor: pointer;
    transition: all 0.3s; border: 2px solid;
}
.mw-btn-restart {
    background: #fff; color: #8059FA;
    border-color: #8059FA;
}
.mw-btn-restart:hover {
    background: #f0edff; transform: translateY(-2px);
}
.mw-btn-share {
    background: linear-gradient(135deg, #8059FA, #063CFF);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 16px rgba(128, 89, 250, 0.3);
    text-decoration: none; display: inline-flex; align-items: center; text-align: center;
}
.mw-btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(128, 89, 250, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mw-root { border-radius: 22px; }
    .mw-root::before { border-radius: 22px; }
    .mw-root::after { border-radius: 26px; }
    .mw-intro { padding: 32px 20px; border-radius: 18px; }
    .mw-intro-title { font-size: 24px; }
    .mw-intro-preview { gap: 8px; }
    .mw-preview-style { padding: 8px 12px; font-size: 12px; }
    .mw-layout { grid-template-columns: 1fr; }
    .mw-radar-panel { position: static; margin-bottom: 12px; order: -1; padding: 16px; }
    .mw-question-wrap { padding: 24px 18px; border-radius: 18px; }
    .mw-q-title { font-size: 16px; }
    .mw-option { padding: 14px 16px; font-size: 13px; }
    .mw-result-layout { grid-template-columns: 1fr; }
    .mw-result-right { order: -1; margin-bottom: 16px; }
    .mw-result-title { font-size: 26px; }
    .mw-result-details { grid-template-columns: 1fr; }
    .mw-results { padding: 24px 18px; border-radius: 18px; }
    .mw-styles-grid { grid-template-columns: 1fr; }
    .mw-result-actions { flex-direction: column; align-items: center; }
}
@media (max-width: 480px) {
    .mw-intro { padding: 24px 16px; }
    .mw-intro-title { font-size: 20px; }
    .mw-intro-badges { gap: 6px; }
    .mw-badge { font-size: 12px; padding: 6px 12px; }
    .mw-btn-start { padding: 14px 28px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .mw-root *, .mw-root *::before, .mw-root *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
