:root {
    --primary-color: #0d6efd;
    --primary-dark: #0d6efd;
    --secondary-color: #0d6efd;
    --accent-color: #d1dce5;
    --light-bg: #f4f7f9;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
    --success-color: #5a7d9a;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #d7e1ec 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.register-wrapper {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    animation: fadeIn 0.8s ease-out;
    display: flex;
    min-height: 90vh;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.left-panel {
    flex: 0 0 40%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    top: -100px;
    right: -100px;
}

.left-panel::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    bottom: -80px;
    left: -80px;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.logo-img {
    height: 120px;
    width: auto;
    object-fit: contain;
    margin-right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
}

.app-name {
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.left-panel h2 {
    font-weight: 700;
    font-size: 32px;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.left-panel p {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.features {
    position: relative;
    z-index: 2;
    margin-top: 20px;
}

.feature {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.feature i {
    font-size: 20px;
    margin-right: 15px;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.feature span {
    font-weight: 500;
}

.right-panel {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    max-height: 90vh;
}

.right-panel h3 {
    font-weight: 700;
    font-size: 28px;
    color: #333;
    margin-bottom: 5px;
}

.right-panel .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 15px;
}

.form-container {
    width: 100%;
}

.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 20px;
}

.section-title i {
    margin-right: 10px;
    font-size: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}

.form-label .required {
    color: var(--danger-color);
}

.input-with-icon {
    position: relative;
}

.input-with-icon .form-control,
.input-with-icon .form-select {
    padding-right: 45px;
    height: 48px;
    border-radius: var(--border-radius);
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    z-index: 3;
    pointer-events: none;
}

.input-with-icon .form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.password-toggle {
    cursor: pointer;
    color: #666;
    pointer-events: auto !important;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.form-text {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.alert {
    border-radius: var(--border-radius);
    padding: 14px 18px;
    margin-bottom: 25px;
    font-size: 14px;
    border: none;
}

.alert-info {
    background-color: #e8f4fd;
    color: #0366d6;
    border-left: 4px solid #0366d6;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-register {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(90, 125, 154, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 125, 154, 0.3);
}

.password-strength {
    height: 5px;
    border-radius: 5px;
    margin-top: 8px;
    background: #eee;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

.strength-weak { width: 25%; background: var(--danger-color); }
.strength-fair { width: 50%; background: var(--warning-color); }
.strength-good { width: 75%; background: #3498db; }
.strength-strong { width: 100%; background: var(--success-color); }

.strength-text {
    font-size: 13px;
    margin-top: 5px;
    font-weight: 500;
}

/* Stepper Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e1e5e9;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background: var(--primary-color);
    color: white;
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-align: center;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.step-line {
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e1e5e9;
    z-index: 1;
}

.step-line-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s ease;
}

.step.completed .step-label {
    color: var(--success-color);
}

.step-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 10px;
}

.btn-next, .btn-prev {
    padding: 12px 25px;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all 0.3s;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-next {
    margin-left: auto;
    background-color: var(--primary-color);
    color: white;
}

.btn-prev {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #666;
}

.is-invalid {
    border-color: var(--danger-color) !important;
}

.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.step-anchor {
    scroll-margin-top: 20px;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* --- OPTIMISATION MOBILITY ET TABLETTES --- */
@media (max-width: 992px) {
    body {
        padding: 10px;
    }

    .register-wrapper {
        flex-direction: column;
        min-height: auto;
        border-radius: 16px;
    }

    .left-panel {
        flex: none;
        padding: 30px 20px;
        text-align: center;
    }

    .logo-container {
        justify-content: center;
        margin-bottom: 15px;
    }

    .logo-img {
        height: 90px;
    }

    .app-name {
        font-size: 20px;
    }

    .left-panel h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .left-panel p, 
    .features {
        display: none; /* Masqué sur écran mobile pour que l'utilisateur accède immédiatement au formulaire */
    }

    .right-panel {
        padding: 25px 20px;
        max-height: none;
        overflow-y: visible;
    }

    .right-panel h3 {
        font-size: 22px;
        text-align: center;
    }

    .right-panel .subtitle {
        text-align: center;
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .step-indicator {
        margin-bottom: 25px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .step-label {
        font-size: 11px;
    }

    .step-line {
        top: 16px;
    }

    .step-buttons {
        flex-direction: column-reverse;
    }

    .btn-next, .btn-prev, .btn-register {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .form-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}