@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Karla:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #042444;
    --color-primary-dark: #031a2f;
    --color-secondary: #B35600;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #ea580c;
    --color-neutral: #f5f5f5;
    --color-border: #e5e7eb;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* ================================
   LAYOUT PRINCIPAL
   ================================ */

.container-fluid {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
}

/* ================================
   FORMULAIRE MULTI-ÉTAPES
   ================================ */

.form-container {
    position: relative;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.form-sidebar {
    width: 40%;
    background: white;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 10;
}

.form-content {
    width: 60%;
    background: linear-gradient(135deg, #042444 0%, #031a2f 100%);
    padding: 0;
    overflow: hidden;
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 5;
}

.form-image-container {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-image {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
}

.form-header {
    margin-bottom: 40px;
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--color-border);
}

.form-header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

.brand-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    animation: pulse-icon 3s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.form-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.form-header-tagline {
    font-family: 'Karla', sans-serif;
    font-size: 12px;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 4px 0 0 0;
    font-weight: 600;
}

/* ================================
   ÉTAPES FORM
   ================================ */

.form-steps {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-right: 10px;
}

.form-steps::-webkit-scrollbar {
    width: 6px;
}

.form-steps::-webkit-scrollbar-track {
    background: transparent;
}

.form-steps::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.form-steps::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.form-step {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.form-step.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.form-step h3 {
    font-family: 'Oswald', sans-serif;
    margin-bottom: 24px;
    color: var(--color-secondary);
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="date"],
.form-field input[type="password"],
.form-field textarea,
.form-field select, select {
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
    background: white;
}

.form-field input[type="text"]:focus,
.form-field input[type="email"]:focus,
.form-field input[type="tel"]:focus,
.form-field input[type="date"]:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: linear-gradient(to bottom, #fafbfc, white);
}

.form-field input::placeholder {
    color: #d1d5db;
}

/* Radio & Checkbox */

.form-group-radio,
.form-group-checkbox {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group-radio label,
.form-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    text-transform: none;
    letter-spacing: normal;
    transition: var(--transition);
}

.form-group-radio input[type="radio"],
.form-group-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-group-radio label:hover,
.form-group-checkbox label:hover {
    color: var(--color-primary);
    transform: translateX(4px);
}

/* ================================
   PROGRES BAR
   ================================ */

.progress-container {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--color-neutral);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.steps-indicator {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-neutral);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Oswald', sans-serif;
    color: var(--color-text-light);
    transition: var(--transition);
    cursor: pointer;
}

.step-dot.active {
    background: var(--color-primary);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(4, 36, 68, 0.4);
}

.step-dot.completed {
    background: var(--color-secondary);
    color: white;
    border-color: transparent;
}

.step-dot:hover:not(.completed) {
    transform: scale(1.05);
    border-color: var(--color-primary);
}

/* ================================
   BOUTONS
   ================================ */

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 40px;
}

.button {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.button-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.button-primary:active {
    transform: translateY(0);
}

.button-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.button-secondary:hover {
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ================================
   ITEMS SYSTÈME (Tags pour inputs)
   ================================ */

.items-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.items-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
    background: white;
}

.items-input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(4, 36, 68, 0.1);
}

.items-input-group .button-primary {
    padding: 12px 20px;
    white-space: nowrap;
}

.items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.item-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.item-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.item-tag button:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

/* ================================
   ANIMATIONS GSAP
   ================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   MESSAGES
   ================================ */

.message {
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInLeft 0.4s ease-out;
    text-align: center;
    justify-content: center;
    max-width: 500px;
}

.message.success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid var(--color-success);
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--color-danger);
    margin-left: 20px;
}

.message.info {
    background: #dbeafe;
    color: #0c4a6e;
    border-left: 4px solid var(--color-primary);
}

/* ================================
   MODAL
   ================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1024px) {
    .form-sidebar {
        width: 50%;
        padding: 40px 30px;
    }

    .form-content {
        width: 50%;
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .form-container {
        flex-direction: column;
        overflow: hidden;
        overflow-x: hidden;
        height: 100vh;
    }

    .form-sidebar {
        width: 100%;
        padding: 40px 24px;
        min-height: 100vh;
        max-height: 100vh;
        height: 100vh;
    }

    .form-content {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: static !important;
        visibility: hidden !important;
        right: auto !important;
        top: auto !important;
    }

    .form-image {
        display: none !important;
        visibility: hidden !important;
    }

    .form-image-container {
        display: none !important;
        visibility: hidden !important;
    }

    .form-header {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .form-header-brand {
        flex-direction: column;
        gap: 12px;
    }

    .brand-icon {
        width: 50px;
        height: 50px;
    }

    .form-header h1 {
        font-size: 24px;
    }

    .form-header-tagline {
        font-size: 11px;
    }

    .steps-indicator {
        gap: 8px;
    }

    .step-dot {
        width: 32px;
        height: 32px;
        font-size: 10px;
    }

    .button-group {
        flex-direction: column-reverse;
    }

    .button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-container {
        flex-direction: column;
        overflow-x: hidden;
        height: 100vh;
    }

    .form-sidebar {
        width: 100%;
        padding: 24px 16px;
        min-height: 100vh;
        max-height: 100vh;
        height: 100vh;
    }

    .form-content {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: static !important;
        visibility: hidden !important;
    }

    .form-image-container {
        display: none !important;
        visibility: hidden !important;
    }

    .form-image {
        display: none !important;
        visibility: hidden !important;
    }

    .form-header h1 {
        font-size: 20px;
    }

    .form-header p {
        font-size: 12px;
    }

    .form-fields {
        gap: 16px;
    }

    .steps-indicator {
        gap: 4px;
    }

    .step-dot {
        width: 28px;
        height: 28px;
        font-size: 9px;
    }
}

/* ================================
   LOADER
   ================================ */

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   SCROLL BAR PERSONNALISÉE
   ================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ================================
   FOCUS VISIBLE POUR ACCESSIBILITÉ
   ================================ */

*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
