@font-face {
    font-family: 'Inter';
    src: url('assets/inter-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: 'Inter', Arial, sans-serif;
}

.sse-step { margin-bottom: 4px; }
.final-answer { font-weight:bold; }


.main-wrapper {
    width: 768px;
    min-height: 100vh;
    margin: 0 auto;
    position: relative;
    background: #000;
    box-shadow: 0 0 64px 0 #222 inset;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    gap: 32px;
}

.logo-container {
    width: 540px;
    height: 440px;
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    margin: 0 auto 32px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}
.logo-container img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
.logo-bg-binary { 
    z-index: 1;
    object-fit: cover;
    border-radius: 32px;
    display: block;
    transform: scale(1.2);
}
.logo-bg-main {
    z-index: 2;
    transform: scale(0.5);
}
.logo-bg-top { z-index: 3; }

@media (max-width: 700px) {
    .main-wrapper {
        width: 80vw !important;
        min-width: 0 !important;
        box-shadow: none;
        padding: 0 0 18px 0;
    }
    .logo-container {
        width: 97vw !important;
        height: 44vw !important;
        min-width: 0;
        max-width: 99vw;
        min-height: 60px;
        max-height: 42vw;
    }
}


#sendBtn:disabled {
    background: #888 !important;
    color: #eee !important;
    border-color: #aaa !important;
    cursor: not-allowed;
    opacity: 0.7;
}


.card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: rgba(0,0,0,0.2);
    border-radius: 18px;
    border: 3px solid rgba(250,223,115,0.5);
    margin-bottom: 16px;
    box-shadow: 0 4px 32px 0 rgba(0,0,0,0.5);
    transition: box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
}
.card-main {
    width: 690px;
    height: 87px;
    margin-bottom: 18px;
    background: #000;
}
.card-img.card-img-large {
    width: 136px; height: 81px;
    position: absolute; left: 551px; top: 50%; transform: translateY(-50%);
    border-radius: 12px;
    object-fit: cover;
}
.card-img.card-img-side {
    width: 153px; height: 83px;
    position: absolute; left: 3px; top: 52%; transform: translateY(-50%);
    border-radius: 12px;
    object-fit: cover;
}
.card-title {
    margin: auto;
    width: 100%;
    text-align: center;
    font-size: 41px;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 12px #000;
}
.gold { color: #d29924; }
.white { color: #ebe0cc; }
.card-small {
    width: 690px;
    height: 87px;
    margin-bottom: 18px;
}
.card-img.card-img-avatar {
    width: 94px; height: 94px;
    position: absolute; left: 1px; top: -9px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff3;
}
.card-img.card-img-banner {
    width: 257px; height: 87px;
    position: absolute; left: 1px; top: 0;
    object-fit: cover;
    border-radius: 18px;
}
.card-img.card-img-banner2 {
    width: 251px; height: 79px;
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    border-radius: 18px;
    object-fit: cover;
}
.card-wide {
    width: 385px;
    height: 156px;
    background: #00000036;
    border: 3px solid rgba(250,223,115,0.49);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.card-img.card-img-banner3 {
    width: 298px; height: 150px;
    position: absolute; left: 50%; top: -19px; transform: translateX(-50%);
    border-radius: 18px;
    object-fit: cover;
}
.background-deco {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 480px;
    height: 270px;
    background: url('img/bg-ellipse.png') center/cover no-repeat;
    opacity: 0.12;
    z-index: 0;
    pointer-events: none;
    margin-top: 30px;
}
.footer {
    width: 386px;
    height: 64px;
    background: #00000087;
    border: 1px solid #d7902d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 43px;
    font-weight: bold;
    margin-top: 44px;
    border-radius: 16px;
    letter-spacing: 1px;
}

@media (max-width: 800px) {
    .main-wrapper { width: 100vw !important; }
    .card, .card-main, .card-small, .card-wide, .footer { width: 96vw !important; }
}

.question-page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 48px;
    padding-top: 60px;
}

/* -------------------- FORMULAIRE -------------------- */
.question-form {
    width: 430px;
    background: #181818ee;
    border: 2px solid #FFD70044;
    border-radius: 18px;
    box-shadow: 0 0 32px #000a;
    padding: 32px 32px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0 auto;
}
.input-row {
    display: flex;
    gap: 12px;
}
.question-form input[type="text"] {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #111;
    color: #FFD700;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}
.question-form select {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #111;
    color: #FFD700;
    font-size: 16px;
    margin-bottom: 10px;
    outline: none;
    appearance: none;
    width: 100%;
    box-sizing: border-box;
}
.question-form select[multiple] {
    min-height: 120px;
    height: 170px;
    font-size: 16px;
    padding: 10px;
}
.question-form label {
    display: block;
    margin-bottom: 6px;
    margin-top: 16px;
    color: #FFD700;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 1rem;
}
.question-form select:focus {
    border-color: #FFD700;
    box-shadow: 0 0 4px #FFD70044;
}
.question-form button {
    padding: 13px 0;
    border-radius: 8px;
    background: #FFD700;
    color: #000;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 17px;
    width: 100%;
}
.question-form button:hover, .question-form button:focus {
    background: linear-gradient(90deg, #fff7b3 65%, #FFD700 100%);
    color: #000;
    box-shadow: 0 4px 32px #ffd70061, 0 1px 0 #fff4 inset;
    text-decoration: none;
    border: none;
}

.answer-box {
    min-height: 180px;
    background: #181818;
    border-radius: 8px;
    border: 1px solid #333;
    padding: 18px 12px;
    color: #FFF;
    font-size: 18px;
    line-height: 1.7;
    box-shadow: 0 2px 8px #0005;
    margin-bottom: 8px;
}

@media (max-width: 700px) {
    .question-form {
        width: 99vw !important;
        min-width: unset !important;
        max-width: 100vw !important;
        padding: 13vw 2vw 8vw 2vw;
        font-size: 1.09rem;
        gap: 8px;
    }
    .input-row,
    .question-form select,
    .question-form input[type="text"] {
        font-size: 1.04rem;
    }
    .question-form select,
    .question-form input[type="text"] {
        padding: 14px 9px;
        min-height: 44px;
        width: 100% !important;
    }
    .question-form select[multiple] {
        min-height: 90px !important;
        height: 135px !important;
        font-size: 1.01rem;
    }
    .question-form button {
        font-size: 1.1rem;
        padding: 12px 0;
    }
    .answer-box {
        min-height: 90px;
        font-size: 1.02rem;
        padding: 10px 2vw;
    }
}

/* ------------------- BOUTONS ACTIONS ------------------- */
.action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}
.mini-btn {
    min-width: 180px;
    max-width: 220px;
    padding: 11px 0 10px 0;
    background: #FFD700;
    color: #181818;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 1.09rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 16px #0005, 0 1px 0 #fff6 inset;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.16s, color 0.12s;
    margin: 0 auto;
    letter-spacing: 0.02em;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.mini-btn:hover, .mini-btn:focus {
    background: linear-gradient(90deg, #fff7b3 65%, #FFD700 100%);
    color: #000;
    box-shadow: 0 4px 32px #ffd70061, 0 1px 0 #fff4 inset;
    text-decoration: none;
    border: none;
}
@media (max-width: 600px) {
    .mini-btn {
        min-width: 95vw;
        max-width: 98vw;
        font-size: 1rem;
    }
    .action-buttons { width: 100%; }
}

/* ----------------- POPUP (MODAL) -------------------- */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(10,10,15,0.82);
    transition: background 0.2s;
}

.modal-content {
    position: relative;
    background: linear-gradient(120deg,#1a1a1a 93%,#292817 100%);
    border-radius: 28px;
    color: #fffbe7;
    padding: 54px 46px 36px 46px;
    min-width: 320px;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 12px 48px #000b, 0 1.5px 0 #ffd70022 inset;
    animation: popup-fadein 0.19s;
    max-height: 80vh;
    overflow-y: auto;

    /* AJOUTS CRUCIAUX */
    box-sizing: border-box;
}

@keyframes popup-fadein {
    from { transform: translateY(36px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.module-title {
    color: #ffd700;
    font-size: 2.1rem;
    margin-bottom: 24px;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 8px #000b,0 0 2px #ffd70022;
    font-family: inherit;
}
.close-btn {
    position: absolute;
    top: 16px;
    right: 26px;
    background: #FFD700;
    color: #000;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    font-size: 1.2rem;
    min-width: 42px;
    min-height: 36px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 10px #0007;
    z-index: 2;
    transition: background 0.15s, color 0.15s, transform 0.09s;
}
.close-btn:hover {
    background: #fff7b3;
    color: #222;
    transform: scale(1.09);
    box-shadow: 0 4px 18px #ffd70061;
}
.module-card {
    background: #232217;
    border-radius: 14px;
    margin-bottom: 21px;
    box-shadow: 0 1.5px 8px #0006;
    padding: 18px 20px 16px 18px;
    transition: box-shadow 0.14s;
}
.module-card:last-child { margin-bottom: 0; }
.module-card .mod-title {
    font-weight: bold;
    color: #FFD700;
    font-size: 1.16rem;
    letter-spacing: 0.01em;
    margin-bottom: 2px;
}
.module-card .mod-status {
    color: #6aff97;
    margin-left: 9px;
    font-size: 0.99rem;
    font-weight: 700;
    vertical-align: middle;
}
.module-card .mod-status.fail { color: #f77b6d; }
.module-card .mod-time {
    color: #f3e1b0;
    font-size: 0.96rem;
    margin-left: 12px;
}
.module-card .mod-response {
    margin-top: 11px;
    color: #fffbe7;
    font-size: 1.08rem;
    line-height: 1.63;
    word-break: break-word;
}

@media (max-width: 700px) {
    .modal-content {
        min-width: unset !important;
        width: 98vw !important;
        max-width: 99vw !important;
        padding: 8vw 3vw 8vw 3vw !important;
        font-size: 1.09rem;
        box-sizing: border-box; /* reste en box-sizing même sur mobile */
    }
    .module-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    .module-card {
        padding: 13px 3vw 11px 3vw;
        font-size: 1.01rem;
    }
    .close-btn {
        top: 7px;
        right: 8px;
        min-width: 32px;
        min-height: 26px;
        font-size: 1.01rem;
    }
}
