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

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

.header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.user-badge {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
}

.hero p {
    font-size: 1.125rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.main-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.action-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.action-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.upload-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.briefcase-icon { background: linear-gradient(135deg, #10b981, #047857); }
.edit-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.history-icon { background: linear-gradient(135deg, #f97316, #ea580c); }

.action-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.action-card p {
    color: #64748b;
    font-size: 0.875rem;
}

.section-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.section {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.voir-tout {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.voir-tout:hover {
    text-decoration: underline;
}

.cv-item, .offer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cv-item:hover, .offer-item:hover {
    background: #f8fafc;
    border-color: #3b82f6;
}

.cv-item:last-child, .offer-item:last-child {
    margin-bottom: 0;
}

.item-info h4 {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.item-date {
    font-size: 0.75rem;
    color: #64748b;
}

.item-company {
    font-size: 0.875rem;
    color: #64748b;
}

.item-action {
    background: #f1f5f9;
    color: #475569;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-action:hover {
    background: #e2e8f0;
}

.features-section {
    margin-top: 2rem;
}

.features-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.features-section p {
    color: #64748b;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.feature-1 .feature-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.feature-2 .feature-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.feature-3 .feature-icon { background: linear-gradient(135deg, #10b981, #047857); }
.feature-4 .feature-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.feature-5 .feature-icon { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.feature-6 .feature-icon { background: linear-gradient(135deg, #64748b, #475569); }

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.feature-card p {
    color: #64748b;
    font-size: 0.875rem;
}

/* Navigation styles */
.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.nav-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* User info styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1e293b;
    font-weight: 500;
}

.user-role {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-role.admin {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.user-role.collaborator {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.user-role.commercial {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.user-role.visitor {
    background: linear-gradient(135deg, #64748b, #475569);
}

/* Role Selector Styles */
.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-selector-trigger {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.role-selector-trigger:hover {
    opacity: 0.8;
}

.role-selector-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.role-selector-dropdown.active {
    display: block;
}

.role-selector-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.role-selector-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-selector-option:hover {
    background-color: #f8fafc;
}

.role-selector-option.selected {
    background-color: #e0f2fe;
}

.role-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.admin {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.role-badge.commercial {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.role-badge.collaborator {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.role-badge.visitor {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

.btn-auth {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-auth:hover {
    background: #2563eb;
}

.btn-auth.btn-secondary {
    background: #64748b;
}

.btn-auth.btn-secondary:hover {
    background: #475569;
}

/* Bouton secondaire générique */
.btn-secondary {
    background: #64748b;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

/* Style pour la modal d'information de fonctionnalités */
.feature-info {
    text-align: center;
}

.feature-info h2 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.feature-info p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Hide authentication modal when authentication is disabled */
#authModal {
    display: none !important;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.close {
    color: #64748b;
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #1e293b;
}

.auth-form {
    text-align: center;
}

.auth-form h2 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    margin: 0.5rem 0;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.auth-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #64748b;
}

.auth-info p {
    margin: 0.25rem 0;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .section-row {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .main-actions {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .nav {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }
}

/* Auth pages styles */
.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #1e293b;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-logout {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    margin-left: 1rem;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fee2e2;
    border-radius: 0.375rem;
}

.success-message {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #d1fae5;
    border-radius: 0.375rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: #64748b;
}

.auth-link a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.session-timer {
    font-size: 0.75rem;
    color: #f97316;
    margin-left: 0.5rem;
}
/* Password Reset - Success and Error Messages */
.success-message {
    background-color: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 4px;
}

.error-message {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 4px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Modal large pour sélecteur CV/Offre */
.modal-large .modal-content {
    max-width: 700px;
    width: 90%;
}

/* Modal extra-large pour résultats d'analyse - Taille modérée */
.modal-xlarge .modal-content {
    max-width: 1000px;
    width: 90%;
    max-height: 85vh;
    margin: 5vh auto;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

/* Bouton de fermeture pour la modal d'analyse */
.modal-xlarge .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #64748b;
    cursor: pointer;
    z-index: 10;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.modal-xlarge .close:hover {
    color: #1e293b;
    background: #f1f5f9;
    transform: scale(1.1);
}

/* Sélecteur CV/Offre */
.cv-offer-selector {
    padding: 1rem;
}

.selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.selector-column h3 {
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.selector-dropdown {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.selector-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
}

.selector-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Loader pour l'analyse */
.analysis-loader {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
}

.spinner {
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.analysis-loader p {
    color: #6b7280;
    font-size: 0.95rem;
}

/* Résultat de l'analyse */
.analysis-result {
    padding: 1rem;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.analysis-header h2 {
    color: #1f2937;
    margin: 0;
}

.btn-copy {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Contenu de l'analyse (HTML de n8n) */
.analysis-content {
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    line-height: 1.6;
}

/* Styles pour le HTML de n8n */
.analysis-content h1,
.analysis-content h2,
.analysis-content h3 {
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.analysis-content ul,
.analysis-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.analysis-content li {
    margin-bottom: 0.5rem;
}

.analysis-content strong {
    color: #374151;
    font-weight: 600;
}

.analysis-content p {
    margin-bottom: 1rem;
    color: #4b5563;
}

/* Responsive */
@media (max-width: 768px) {
    .selector-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-xlarge .modal-content {
        width: 98%;
        max-height: 95vh;
    }

    .analysis-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}
