/* === Étape 1 : Formulaire initial === */

.eaieg-step-1 {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
}

.eaieg-step-1 .eaieg-step-line {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.eaieg-step-1 .eaieg-step-line .eaieg-step-left, .eaieg-step-1 .eaieg-step-line .eaieg-step-right{
    width: 50%;
}

.eaieg-step-1 .eaieg-step-left {
    height: 100%;
    background-color: white;
}

.eaieg-step-1 .eaieg-step-left div {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px;
}

.eaieg-step-1 .eaieg-step-left div h2 {
    margin: 0;
    color: #2e1a4c;
}

.eaieg-step-1 .eaieg-step-right div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
}

.eaieg-step {
    padding: 3rem;
    color: #fff;
}


.eaieg-step-frame {
    display: flex;
    width: 100%;
    align-items: stretch;
    gap: 20px;
}

.eaieg-step-frame .eaieg-step {
    flex: 1 1 auto;
}

.eaieg-step-frame__rail {
    flex: 0 0 20px;
    width: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
}

.eaieg-step-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.eaieg-step-labels p {
    background: #fff;
    color: #2e1a4c;
    padding: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.eaieg-step-fields > div {
    margin-bottom: 2rem;
}

.eaieg-step-fields textarea,
.eaieg-step-fields input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid #ccc;
    color: #fff;
    resize: vertical;
}

.eaieg-step-fields input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #fff;
    margin-right: 0.5rem;
    vertical-align: middle;
    border-radius: 2px;
    cursor: pointer;
}

.eaieg-step-fields input[type="radio"]:checked {
    background-color: #fff;
}

.eaieg-step-fields label {
    display: inline-block;
    margin: 0.5rem 1.5rem 0.5rem 0;
    cursor: pointer;
    font-size: 0.95rem;
    text-transform: uppercase;
}

/* === Étapes 2 et 4 : Sujet / Résumé === */

.eaieg-step-2 .eaieg-step-question {
    background-color: #FFFFFF;
}

.eaieg-step-confirmation {
    background-color: #ec1d7b;
}

.eaieg-step-confirmation .eaieg-confirm-header {
    background-color: #fff;
    color: #ec1d7b;
    padding: 1.5rem;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.eaieg-step-confirmation textarea {
    width: 100%;
    padding: 1.5rem;
    border: 1px solid #fff;
    background: #ec1d7b;
    color: #fff;
    resize: none;
    font-size: 1rem;
    line-height: 1.6;
}

/* === Étape 3 : Titres et sous-titres === */
.eaieg-step-3 .eaieg-step-line-contents {
    margin-top: 20px;
}

.eaieg-step-title-choice {
    background-color: #ec1d7b;
    padding: 3rem;
    color: #fff;
}

.eaieg-title-choice-header {
    background-color: #fff;
    color: #ec1d7b;
    padding: 1.5rem;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.eaieg-title-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.eaieg-title-col,
.eaieg-subtitle-col {
    display: flex;
    flex-direction: column;
}

.eaieg-title-col .eaieg-title-header,
.eaieg-subtitle-col .eaieg-subtitle-header {
    background-color: #6a0d47;
    color: #fff;
    padding: 0.8rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
}

.eaieg-title-option,
.eaieg-subtitle-option {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.eaieg-title-option input,
.eaieg-subtitle-option input {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #fff;
    margin-right: 0.75rem;
    border-radius: 2px;
    cursor: pointer;
}

.eaieg-title-option input:checked,
.eaieg-subtitle-option input:checked {
    background-color: #fff;
}

.eaieg-title-option label,
.eaieg-subtitle-option label {
    cursor: pointer;
    font-size: 0.95rem;
    text-transform: uppercase;
}

/* === Étape 5 : Table des matières avec accordéon === */
.eaieg-toc {
    background-color: #ec1d7b;
    color: #fff;
    padding: 2rem;
}

.eaieg-toc-header {
    background-color: #fff;
    color: #ec1d7b;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.eaieg-toc-row {
    display: flex;
    background-color: #6a0d47;
    padding: 1rem;
    font-weight: bold;
    margin-bottom: 1px;
    cursor: default;
}

.eaieg-toggleable, .eaieg-toggle {
    cursor: pointer;
}

.eaieg-toc-label {
    flex: 1;
}

.eaieg-toc-title {
    flex: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eaieg-arrow {
    margin-left: 1rem;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.eaieg-toc-subchapters {
    background-color: #7b1950;
    padding: 1rem 2rem;
}

.eaieg-toc-sub {
    margin-bottom: 0.5rem;
    font-style: italic;
}

.eaieg-step-subchapters {
    display: none !important;
}

.eaieg-step-subchapters.open {
    display: flex !important;
}

.eaieg-step-subchapter-left {
    opacity: 0;
}

.hidden {
    display: none;
}

/* === Étape 6 : Bouton Lancer === */
.eaieg-step-launch {
    background-color: #38a8df;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    height: 100%;
    text-align: center;
    position: relative;
}

.eaieg-launch-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
}

.eaieg-launch-circle {
    width: 100%;
    height: 100%;
    border: 6px solid #fff;
    border-radius: 50%;
    position: relative;
}

.eaieg-launch-text {
    position: absolute;
    width: 100%;
    height: 100%;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
    text-align: center;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-90deg);
    white-space: pre-wrap;
    padding: 2rem;
}

.eaieg-launch-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: transparent;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.eaieg-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.eaieg-controls--top {
    margin: 0;
    justify-content: center;
}

.eaieg-controls--bottom {
    width: 100%;
    justify-content: center;
    margin: 10px 0 20px;
}

#eaieg-form-container {
    padding-top: 100px ;
}

#eaieg-form-header {
    padding-top: 50px !important;
}

/* Responsive adjustments for controls */
@media (max-width: 768px) {
    .eaieg-controls {
        gap: 15px;
    }
    
    .eaieg-controls--bottom {
        margin: 8px 0 15px;
    }

    .eaieg-form-temp-cred-container {
        padding-top: 200px;
    }

    #eaieg-form-header {
        padding-top: 0px !important;
    }
    

    #eaieg-form-container {
        padding-top: 180px ;
    }
}

#eaieg-form-wrapper {
    background-color: rgb(56, 34, 98);
}

#eaieg-form-wrapper:before, #eaieg-form-wrapper:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
    background-color: rgb(255, 255, 255);
}

#eaieg-form-wrapper:after {
    right: 0;
    left: auto;
}



#aieg-form-container {
    padding: 100px 0 40px; 
    min-height: calc(100vh - 60px); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 40px;
}

.eaieg-form-content {
    width: 100%;
    flex: 1 0 auto;
}

.eaieg-header-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex: 1;
    position: relative;
}

.eaieg-btn {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.35));
}

.eaieg-btn span {
    color: #FFFFFF;
}

.eaieg-gen-btn {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.eaieg-gen-btn span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    color: #FFFFFF;
    text-transform: uppercase;
    font-size: 40px;
    font-weight: bold;
}

.eaieg-step-titles {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.eaieg-step-titles div {
    width: 50%;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.6);
}

.eaieg-step-titles div h2 {
    text-align: center;
    margin: 0;
    color: white;
    font-size: 16px !important;
    font-weight: 400 !important;
    text-transform: uppercase;
}

.eaieg-step-line-contents {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.eaieg-step-line-contents div {
    width: 50%;
}

.eaieg-step-chapters, .eaieg-step-subchapters {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 20px;
}

.eaieg-step-chapters .eaieg-step-chapter-left,
.eaieg-step-chapters .eaieg-step-chapter-right,
.eaieg-step-subchapters .eaieg-step-subchapter-left,
.eaieg-step-subchapters .eaieg-step-subchapter-right
{
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.6);
}

.eaieg-step-subchapters .eaieg-step-subchapter-left {
    display: flex;
    justify-content: center;
    align-items: center;
}

.eaieg-step-chapters .eaieg-step-chapter-left, .eaieg-step-subchapters .eaieg-step-subchapter-left {
    width: 30%;
}

.eaieg-step-chapters .eaieg-step-chapter-right, .eaieg-step-subchapters .eaieg-step-subchapter-right {
    width: 70%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.eaieg-step-chapters h2, .eaieg-step-subchapters h2 {
    text-align: center;
    margin: 0;
    color: white !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    text-transform: uppercase;
}

.eaieg-step-2 .eaieg-step-question h2, .eaieg-step-3 .eaieg-step-question h2, .eaieg-step-4 .eaieg-step-question h2, .eaieg-step-5 .eaieg-step-question h2 {
    color: #ec1d7b;
}

.eaieg-step-left h2, .eaieg-step-question h2 {
    background-color: white;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 0;
}

.eaieg-step-question {
    background-color: #FFFFFF;
    padding: 10px;
    margin-bottom: 20px;
}

.eaieg-step-question h2 {
    text-align: center;
}

#eaieg-form-wrapper textarea {
    background-color: transparent;
    border: 1px solid white;
    color: white;
    outline: none;
    border-radius: 0;
}

#eaieg-form-wrapper [type="radio"]:checked,
#eaieg-form-wrapper [type="radio"]:not(:checked) {
    position: absolute;
    left: -9999px;
}
#eaieg-form-wrapper [type="radio"]:checked + label,
#eaieg-form-wrapper [type="radio"]:not(:checked) + label
{
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    line-height: 20px;
    display: inline-block;
    text-transform: uppercase;
}
#eaieg-form-wrapper [type="radio"]:checked + label:before,
#eaieg-form-wrapper [type="radio"]:not(:checked) + label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
}
#eaieg-form-wrapper [type="radio"]:checked + label:after,
#eaieg-form-wrapper [type="radio"]:not(:checked) + label:after {
    content: '';
    width: 14px;
    height: 14px;
    background: #FFFFFF;
    position: absolute;
    top: 2px;
    left: 2px;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}
#eaieg-form-wrapper [type="radio"]:not(:checked) + label:after {
    opacity: 0;
    -webkit-transform: scale(0);
    transform: scale(0);
}
#eaieg-form-wrapper [type="radio"]:checked + label:after {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
}

#eaieg-form-container-error, #eaieg-form-container .loader, .eaieg-step-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
}

#eaieg-form-container .loader, .eaieg-step-error {
    height: 100%;
}

#eaieg-form-container-error p, #eaieg-form-container .loader p, .eaieg-step-error h3 {
    color: #FFFFFF !important;
    text-transform: uppercase;
    font-size: 28px;
    font-weight: bold;
}

.eaieg-step-error h3 {
    font-size: 32px;
    margin-bottom: 1px;
}

.eaieg-step-error p {
    color: #FFFFFF;
    font-size: 14px;
    text-align: center;
}

.swal2-actions button {
    padding: 6px 18px !important;
}

.eaieg-form-temp-cred-container p {
    color: #FFFFFF ;
    text-transform: uppercase;
    font-size: 18px;
    max-width: 400px;
}

/* Keep credit counter pinned to the left, while controls stay centered */
.eaieg-form-temp-cred-container {
    position: absolute;
    left: 0;
}

.text-center {
    text-align: center;
}

/* === Loading Overlay (video) === */
#eaieg-loading-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#eaieg-loading-overlay.is-visible {
    display: flex;
}

#eaieg-loading-overlay video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
