/* CSS principal de l'application */
:root {
    --primary-color: #4a9ff0;
    --primary-dark: #3886d6;
    --secondary-color: #f9a826;
    --accent-color: #ff6b6b;
    --success-color: #6bcb77;
    --danger-color: #ff6b6b;
    --background-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #6c757d;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
    --tile-gradient-1: linear-gradient(135deg, #ffefba 0%, #ffffff 100%);
    --tile-gradient-2: linear-gradient(135deg, #e0f7fa 0%, #ffffff 100%);
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.app-container {
    position: relative;
    min-height: 100vh;
}

/* Login Page */
.login-container {
    max-width: 450px;
    margin: 100px auto;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.login-header p {
    color: var(--text-secondary);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 159, 240, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
}

.form-error {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
    min-height: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #e25f5f;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-icon i {
    margin-right: 8px;
}

.btn-icon:hover {
    color: var(--primary-color);
}

/* Main App Layout */
.main-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    gap: 15px;
}

/* Progress Steps */
.progress-container {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.progress-container::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.progress-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 25%;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step-label {
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 500;
}

/* Page Content */
.page-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.page-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Tiles */
.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.tile {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tile:nth-child(odd) {
    background: var(--tile-gradient-1);
}

.tile:nth-child(even) {
    background: var(--tile-gradient-2);
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.tile.selected {
    border: 2px solid var(--primary-color);
}

.tile-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.tile-content {
    font-size: 14px;
    color: var(--text-secondary);
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.tile-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
}

.tile-actions button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tile-actions button:hover {
    background-color: white;
    color: var(--primary-color);
}

.tile-actions .delete-btn:hover {
    color: var(--danger-color);
}

/* Summary Page */
.summary-container {
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

.summary-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.summary-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.summary-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.summary-content {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: var(--border-radius);
    font-size: 14px;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--card-bg);
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    z-index: 1001;
    min-width: 300px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    visibility: visible;
    opacity: 1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(74, 159, 240, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-app {
        padding: 10px;
    }
    
    .page-content {
        padding: 20px;
    }
    
    .tiles-container {
        grid-template-columns: 1fr;
    }
    
    .progress-container {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .progress-step {
        width: 50%;
    }
    
    .app-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-controls {
        width: 100%;
        justify-content: center;
    }
    
    .step-label {
        font-size: 12px;
    }
}