/* ============================================
   STYLES COMMUNS - Simulateur SEA
   ============================================ */

@import url('variables.css');
@import url('fast.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg-white);
    color: var(--color-text-main);
    height: 100vh;
    overflow: hidden;
    /* Scroll géré par les panneaux */
}

/* ============ LAYOUT PRINCIPAL ============ */
.wizard {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
}

/* ============ SIDEBARS (Wizard & History) ============ */
.sidebar {
    width: 17.5em;
    /* 280px / 16 */
    min-width: 17.5em;
    background: var(--color-bg-light);
    border-right: 0.0625em solid var(--color-divider);
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow-y: auto;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1em 1.5em;
    border-top: 0.0625em solid var(--color-divider);
    background: var(--color-bg-white);
}

.last-sim-link {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.8125em;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.last-sim-link:hover {
    text-decoration: underline;
}

/* ============ CONTENU CENTRAL ============ */
.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--color-bg-white);
}

header {
    padding: 3.75em 3em 2.5em;
    border-bottom: 0.0625em solid var(--color-border-light);
    margin-bottom: 2.5em;
    background: linear-gradient(to bottom, var(--color-bg-light), var(--color-bg-white));
}

header h1 {
    font-family: var(--font-main);
    font-size: var(--fs-xxl);
    color: var(--color-text-main);
    font-weight: 500;
    margin-bottom: 0.25em;
}

header p {
    color: var(--color-text-secondary);
    font-size: var(--fs-md);
    max-width: 37.5em;
}

.form-card {
    max-width: 56.25em;
    width: 100%;
    margin: 0 auto;
    padding: 0 3em 3.75em;
}

/* ============ COURSE PANEL (Sticky) ============ */
.course-panel {
    width: 23.75em;
    /* 380px */
    min-width: 23.75em;
    background: var(--color-bg-white);
    border-left: 0.0625em solid var(--color-divider);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}

.course-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 2.5em 2em;
    position: relative;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    padding-right: 2.5em;
}

.course-body ul,
.course-body ol {
    padding-left: 1.25em;
    margin-top: 0.75em;
    margin-bottom: 0.75em;
    list-style-position: inside;
}

.course-body li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}

#courseInner {
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0.75em);
}

#courseInner.active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.course-category {
    font-size: 0.6875em;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 1.5em;
}

.close-course {
    position: absolute;
    top: 0;
    right: 0;
    width: 2em;
    height: 2em;
    border-radius: var(--br-round);
    border: none;
    background: var(--color-border-light);
    color: var(--color-text-secondary);
    font-size: 1.25em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 5;
}

.close-course:hover {
    background: #e8eaed;
    color: var(--color-text-main);
}

/* ============ FORM ELEMENTS ============ */
.form-group {
    margin-top: 2.5em;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: var(--fs-sm);
    color: #3c4043;
    margin-bottom: 0;
}

.standalone-label {
    margin-bottom: 0.75em !important;
}

.label-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8em;
    height: 1.8em;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: var(--br-round);
    font-size: var(--fs-xs);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.help-icon:hover {
    background: #d2e3fc;
}

.help-icon.active {
    background: var(--color-primary);
    color: var(--color-bg-white);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.875em 1em;
    border: 0.0625em solid var(--color-border);
    border-radius: var(--br-md);
    font-size: var(--fs-sm);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25em center;
    padding-right: 2.5em;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 0.125em rgba(26, 115, 232, 0.2);
}

.hint {
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
    margin-bottom: 2em;
}

.navigation {
    margin-top: 3.75em;
    padding-top: 2em;
    border-top: 0.0625em solid var(--color-divider);
    display: flex;
    gap: 1em;
}

.btn {
    padding: 0 1.5em;
    height: 2.75em;
    border-radius: var(--br-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.char-count {
    margin-top: 0.5em;
    color: var(--color-text-secondary);
    font-size: var(--fs-xs);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 0.0625em 0.1875em rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: var(--color-success-hover);
}

.btn-secondary {
    background: white;
    color: var(--color-primary);
    border: 0.0625em solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-light);
}

/* ============ LOADING SPINNER ============ */
.loading {
    background: rgba(255, 255, 255, 0.8);
    z-index: 100;
    top: 0;
    left: 0;
}

.loading p {
    margin-top: 1em;
}

.spinner {
    width: 3.125em;
    height: 3.125em;
    border: 0.25em solid var(--color-divider);
    border-top-color: var(--color-primary);
    border-radius: var(--br-round);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(0.75em);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 64em) {
    /* 1024px - Course panel becomes an overlay */
    .course-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        min-width: 100%;
        height: 100%;
        z-index: 2000;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        border-left: none;
        display: flex !important; /* Ensure it's flex even if hidden by transform */
    }

    .course-panel.active {
        transform: translateX(0);
    }
    
    .course-content-wrapper {
        padding: 4em 1.5em 2.5em;
    }
    
    .close-course {
        top: 1em;
        right: 1em;
        width: 3em;
        height: 3em;
    }
}

@media (max-width: 48em) {
    /* 768px - Global Mobile Adjustments */
    .wizard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        min-height: auto;
        flex-direction: row;
        border-right: none;
        border-bottom: 0.0625em solid var(--color-divider);
        position: sticky;
        top: 0;
        overflow-y: visible;
        overflow-x: auto;
        white-space: nowrap;
        background: var(--color-bg-white);
    }

    .sidebar-footer {
        display: none; /* Hide footer on mobile sidebar to save space */
    }

    body {
        overflow: auto;
    }

    .vh100.oh {
        height: auto;
        overflow: auto;
    }

    .form-container {
        height: auto;
        overflow: visible;
    }

    header {
        padding: 2em 1.5em;
        margin-bottom: 1.5em;
    }

    header h1 {
        font-size: 1.5em;
    }

    .form-card {
        padding: 0 1.5em 2em;
    }

    .navigation {
        margin-top: 2em;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

