* {
    box-sizing: border-box;
}

/* Blue Banner Header Styles */
.header-banner {
    background-color: #004f91;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 82, 163, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.header-language {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-language select {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #004f91;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.header-language select:hover {
    background: white;
    border-color: rgba(255, 255, 255, 0.8);
}

.header-language select:focus {
    outline: none;
    background: white;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Main content wrapper */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #f5f5f5;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Remove old language selector styles since it's now in header */
.language-selector {
    display: none;
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.form-container h1 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    padding-bottom: 10px;
}

.field-group {
    margin: 20px 0;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.required-indicator {
    color: #721c24;
    font-weight: bold;
    margin-left: 4px;
    font-size: 0.9em;
}

.field-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fefefe;
}

.field-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.field-input.readonly {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

.field-input-error {
    border-color: #dc3545;
}

.field-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

button {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

button:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

button:disabled,
button.disabled {
    background: #6c757d !important;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.form-actions {
    justify-content: center;
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.submit-btn {
    background: #007bff;
}

.error {
    color: #721c24;
    background: #f8d7da;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
}

.success {
    color: #155724;
    background: #d4edda;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
}

.error-icon, .success-icon {
    font-size: 24px;
    display: inline-block;
}

.file-input-wrapper {
    margin: 15px 0;
}

.file-input-hidden {
    display: none;
}

.btn-select-file {
    background: #17a2b8;
    margin-bottom: 15px;
    width: 100%;
}

.btn-select-file:hover {
    background: #138496;
}

.selected-files-display {
    min-height: 40px;
}

.selected-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 8px 0;
    transition: box-shadow 0.3s;
}

.selected-file-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.file-size {
    color: #6c757d;
    font-size: 14px;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.file-actions button {
    padding: 6px 12px;
    font-size: 14px;
    min-width: auto;
}

.btn-download {
    background: #17a2b8;
}

.btn-download:hover {
    background: #138496;
}

.btn-remove {
    background: #dc3545;
}

.btn-remove:hover {
    background: #c82333;
}

.no-files {
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}

#cgu-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 20px;
}

/* Styles pour le modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.modal-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.modal-message {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-confirm {
    background-color: #007bff;
    color: white;
}

.btn-confirm:hover {
    background-color: #0056b3;
}

.btn-cancel {
    background-color: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background-color: #545b62;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        gap: 10px;
        padding: 0 15px;
    }
    
    .header-banner {
        padding: 20px 0;
    }
    
    .logo-image {
        height: 40px;
    }

    .main-content {
        padding: 15px;
    }

    .form-container {
        padding: 20px;
    }

    .selected-file-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .file-actions {
        justify-content: center;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 35px;
    }
    
    .header-language select {
        padding: 6px 10px;
        font-size: 14px;
    }
}

/* File validation styles */
.file-constraints {
    margin: 8px 0;
}

.file-error {
    animation: fadeInError 0.3s ease-out;
}

@keyframes fadeInError {
    from { 
        opacity: 0; 
        transform: translateY(-5px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Toast System Styles - Modern UX/UI Design */
.toast-container {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 1001;
    max-width: 420px;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
    padding: 18px 22px;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast.success::before {
    content: '✓';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #10B981;
    font-weight: 600;
    width: 20px;
    height: 20px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.toast.error::before {
    content: '✕';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #EF4444;
    font-weight: 600;
    width: 20px;
    height: 20px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.toast-message {
    color: #374151;
    font-weight: 500;
    margin: 0;
    margin-left: 32px;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.toast.success .toast-message {
    color: #065F46;
}

.toast.error .toast-message {
    color: #7F1D1D;
}

/* Progress bar animation */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 0, 0, 0.05);
    transform: scaleX(0);
    transform-origin: left;
    animation: toast-progress 4s linear;
    border-radius: 0 0 12px 12px;
}

.toast.success::after {
    background: linear-gradient(90deg, #10B981, #059669);
}

.toast.error::after {
    background: linear-gradient(90deg, #EF4444, #DC2626);
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Modern hover effects */
.toast:hover {
    transform: translateX(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 12px rgba(0, 0, 0, 0.08);
}

.toast:hover::after {
    animation-play-state: paused;
}

/* Pulse animation for icons */
@keyframes pulse {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
}

.toast.success::before {
    animation: pulse 2s ease-in-out infinite;
}

.toast.error::before {
    animation: pulse 2s ease-in-out infinite;
}

/* Responsive design for toasts */
@media (max-width: 768px) {
    .toast-container {
        top: 75px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        transform: translateY(-100%);
        padding: 16px 20px;
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .toast:hover {
        transform: translateY(0) scale(1);
    }
    
    .toast-message {
        font-size: 13px;
        margin-left: 28px;
    }
    
    .toast.success::before,
    .toast.error::before {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s ease;
        animation: none;
    }
    
    .toast.success::before,
    .toast.error::before {
        animation: none;
    }
    
    .toast::after {
        animation: toast-progress-reduced 4s linear;
    }
}

@keyframes toast-progress-reduced {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Success Page Styles */
.success-content {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 80px;
    color: #28a745;
    margin-bottom: 20px;
    display: block;
    animation: successBounce 0.6s ease-out;
}

.success-content h1 {
    color: #28a745;
    margin-bottom: 30px;
    font-size: 2em;
    border: none;
    padding: 0;
}

.success-message {
    margin: 30px 0;
    color: #333;
    line-height: 1.6;
}

.success-message p {
    margin: 15px 0;
    font-size: 16px;
}

@keyframes successBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive design for success page */
@media (max-width: 768px) {
    .success-icon {
        font-size: 60px;
    }
    
    .success-content h1 {
        font-size: 1.5em;
    }
    
    .success-message p {
        font-size: 14px;
    }
}

.deadline-info strong {
    color: darkred;
}