@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', Tahoma, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    padding: 20px;
    color: #1f2937;
}

.conteneur {
    background: rgba(255, 255, 255, 0.98);
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 900px;
    text-align: center;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

h1 {
    color: #111827;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 2rem;
}

h2 {
    color: #111827;
    margin-bottom: 20px;
    font-weight: 600;
}

.sous-titre {
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

/* Zone de dépôt */
.zone-depot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 2.5px dashed #cbd5e1;
    border-radius: 20px;
    padding: 50px 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
    background: #f8fafc;
}

.zone-depot:hover,
.zone-depot.survol {
    border-color: #6366f1;
    background: #eef2ff;
    transform: translateY(-2px);
}

.icone {
    font-size: 3rem;
    transition: transform 0.3s;
}

.zone-depot:hover .icone {
    transform: scale(1.1);
}

#texte-zone {
    font-weight: 500;
    font-size: 1.1rem;
}

/* Aperçu de l'image */
.apercu {
    display: none;
    max-width: 100%;
    max-height: 250px;
    border-radius: 12px;
    margin-top: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Bouton */
.btn {
    margin-top: 25px;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn:hover:not(:disabled) {
    opacity: 0.95;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    background: #cbd5e1;
    box-shadow: none;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.message {
    margin-top: 25px;
    padding: 0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.message.succes {
    padding: 16px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #10b981;
}

.message.erreur {
    padding: 16px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #ef4444;
}

/* ===== Spinner de chargement ===== */
.chargement {
    display: none;
    margin-top: 30px;
    text-align: center;
    color: #4b5563;
    font-weight: 500;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid #f3f4f6;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: rotation 0.8s linear infinite;
}

@keyframes rotation {
    to { transform: rotate(360deg); }
}

/* ===== Affichage du planning ===== */
.resultat {
    margin-top: 30px;
    text-align: left;
}
.resultat:empty {
    display: none;
}

/* Métadonnées */
.carte-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
}
.badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}
.absence {
    background: #fffbeb;
    color: #b45309;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #fcd34d;
}

/* Grille des jours */
.grille-jours {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.carte-jour {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.carte-jour:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #c7d2fe;
}

.entete-jour {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}
.nom-jour {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    letter-spacing: 0.5px;
}
.total-jour {
    background: #eef2ff;
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.tranches {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tranche {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #334155;
    font-weight: 500;
}
.tranche span {
    color: #64748b;
    font-size: 0.85rem;
}

.repos {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.95rem;
    padding: 10px;
}
.statut {
    background: #fee2e2;
    color: #b91c1c;
    text-align: center;
    padding: 6px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Total semaine */
.total-semaine {
    margin-top: 30px;
    text-align: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 16px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}
.total-semaine strong {
    font-size: 1.4rem;
    font-weight: 700;
}

.zone-approbation {
    margin-top: 40px;
    padding: 30px;
    background-color: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.separateur {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin-bottom: 25px;
}

.texte-validation {
    font-size: 1.05rem;
    color: #475569;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-action {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}
.btn-action:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.message-action {
    margin-top: 20px;
    font-weight: 600;
    font-size: 1rem;
}

.message-action.succes { color: #059669; }
.message-action.erreur { color: #dc2626; }
.message-action.chargement-texte { color: #4f46e5; }

/* Styles communs pour formulaires (login, register, settings) */
form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 0.95rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 1rem;
    color: #111827;
    background-color: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background-color: #fff;
}

/* Responsivité Mobile */
@media (max-width: 768px) {
    .conteneur {
        padding: 20px;
        margin-top: 10px;
        margin-bottom: 10px;
        border-radius: 16px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .grille-jours {
        grid-template-columns: 1fr;
    }
    
    .zone-depot {
        padding: 30px 20px;
    }
}