:root {
    --primary-color: #ff4757;
    --secondary-color: #2f3542;
    --accent-color: #ffa502;
    --bg-light: #f1f2f6;
    --white: #ffffff;
    --dark: #1e272e;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Body */
body {
    background-color: var(--bg-light);
    color: var(--secondary-color);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: background 0.3s ease;
}

.logo {
    font-size: 26px;
    font-weight: bold;
    color: var(--secondary-color);
}
.logo span { color: var(--primary-color); }

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}
.nav-links li a {
    text-decoration: none;
    margin: 0 20px;
    color: var(--secondary-color);
    transition: color 0.3s;
}
.nav-links li a:hover { color: var(--primary-color); }

.btn-primary {
    background: var(--primary-color);
    color: white !important;
    padding: 10px 20px;
    border-radius: 25px;
    transition: 0.3s;
}
.btn-primary:hover {
    background: var(--accent-color);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 8% 80px;
    min-height: 90vh;
    background: linear-gradient(135deg, #ff4757, #ffa502);
    color: var(--white);
}
.hero-content { flex: 1; }
.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
}
.hero-content h1 span { color: var(--dark); }
.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}
.hero-btns a {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-main {
    background: var(--white);
    color: var(--primary-color);
    margin-right: 15px;
}
.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.btn-secondary {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}
.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* Hero Image */
.hero-image img {
    max-width: 500px;
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 80px 8%;
    background: var(--white);
}
.feature-card {
    text-align: center;
    padding: 40px 20px;
    border-radius: 15px;
    background: var(--bg-light);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.feature-card i {
    font-size: 45px;
    color: var(--accent-color);
    margin-bottom: 15px;
    transition: color 0.3s;
}
.feature-card:hover i { color: var(--primary-color); }

/* Footer */
footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 40px 8%;
}
footer p {
    margin-bottom: 15px;
}
footer .socials i {
    margin: 0 10px;
    font-size: 20px;
    color: var(--white);
    transition: color 0.3s;
}
footer .socials i:hover { color: var(--primary-color); }

/* Responsive */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }
    .hero-image img {
        margin-top: 40px;
        max-width: 80%;
    }
    .nav-links {
        display: none;
    }
}

/* Fond spécifique pour la page de login */
/* Fond spécifique pour la page de login / commande */
.login-page {
    background: linear-gradient(135deg, #f1f2f6 0%, #dfe4ea 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Aligne le formulaire en haut */
    min-height: 100vh; /* Minimum toute la hauteur, mais peut s'étirer */
    margin: 0;
    padding: 40px 20px; /* Espace de sécurité en haut et en bas */
    overflow-y: auto; /* Active le scroll si nécessaire */
}

.form-box {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.back-home {
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 0.9rem;
    transition: 0.3s;
}

.back-home:hover { color: var(--primary-color); }

.form-logo {
    font-size: 22px;
    font-weight: bold;
}

.form-logo span { color: var(--primary-color); }

h2 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.subtitle {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* Style des inputs avec icônes */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a4b0be;
}

.input-group input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid #f1f2f6;
    border-radius: 12px;
    outline: none;
    transition: 0.3s;
    font-size: 1rem;
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: #fff;
}

/* Bouton */
.btn-login {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-login:hover {
    background: #ff6b81;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
}

.form-footer {
    margin-top: 25px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

/* Style du message d'erreur */
#message {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #e74c3c;
}

/* Ajustement pour la boîte d'inscription qui a plus de champs */
.register-box {
    max-width: 450px; /* Un peu plus large pour le confort */
    animation: fadeIn 0.5s ease-in-out;
}

/* Petite animation d'entrée pour le formulaire */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Style spécifique pour le champ téléphone si nécessaire */
input[id="telephone"] {
    letter-spacing: 1px;
}

/* Variables de couleurs */
:root {
    --primary: #ff4757;
    --sidebar-bg: #2f3542;
    --bg-gray: #f4f7f6;
    --white: #ffffff;
    --text-main: #2f3542;
    --text-muted: #a4b0be;
}

body.dashboard-body {
    background-color: var(--bg-gray);
    font-family: 'Poppins', sans-serif;
    margin: 0;
}

.dashboard-wrapper {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    padding: 30px 20px;
    position: fixed;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    color: white;
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 50px;
    text-align: center;
}

.sidebar-logo span { color: var(--primary); }

.sidebar nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 15px;
    display: block;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: 0.3s;
}

.sidebar nav a.active, .sidebar nav a:hover {
    background: rgba(255, 71, 87, 0.1);
    color: var(--primary);
}

.sidebar nav a i { margin-right: 10px; }

.btn-logout {
    margin-top: auto;
    background: transparent;
    border: 1px solid #57606f;
    color: white;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.btn-new-order {
    background: linear-gradient(135deg, var(--primary), #ff6b81);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 20px;
}

.stat-icon.purple { background: #f3e5f5; color: #9c27b0; }
.stat-icon.orange { background: #fff3e0; color: #ff9800; }
.stat-icon.green { background: #e8f5e9; color: #4caf50; }

/* Orders Grid */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.order-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
    border-top: 4px solid var(--primary);
}

/* Badges de statut */
.status-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
}

.status-success { background: #d4edda; color: #155724; }
.status-warning { background: #fff3e0; color: #e67e22; }
.status-info { background: #d1ecf1; color: #0c5460; }

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.order-price {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Mise en page spécifique pour le grand formulaire de commande */
.order-form-box {
    max-width: 700px; /* Plus large pour permettre deux colonnes */
    width: 95%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Deux colonnes */
    gap: 15px;
    text-align: left;
}

/* Faire en sorte que certains champs prennent toute la largeur */
.full-width {
    grid-column: span 2;
}

.input-row {
    display: flex;
    gap: 10px;
    grid-column: span 2;
}

.input-row .input-group {
    flex: 1;
}

.order-form-box textarea {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #f1f2f6;
    border-radius: 12px;
    font-family: inherit;
    resize: none;
    outline: none;
}

.order-form-box textarea:focus {
    border-color: var(--primary);
}

/* Animation de succès */
#result p {
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-weight: bold;
    animation: slideIn 0.5s ease;
}

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

/* Style uniforme pour Inputs, Selects et Textareas */
.input-group select, 
.input-group input, 
.input-group textarea {
    width: 100%;
    padding: 14px 15px 14px 45px; /* Espace à gauche pour l'icône */
    border: 2px solid #f1f2f6;
    border-radius: 12px;
    background-color: #fff;
    font-size: 1rem;
    color: var(--secondary-color);
    outline: none;
    transition: 0.3s;
    appearance: none; /* Supprime le style par défaut du navigateur */
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Ajout d'une flèche personnalisée pour les selects */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group:has(select)::after {
    content: '\f107'; /* Icône flèche FontAwesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    color: #a4b0be;
    pointer-events: none;
}

/* Focus state */
.input-group select:focus, 
.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.1);
}

/* Ajustement spécifique pour la grille */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Pour mobile : repasser sur une seule colonne */
@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .full-width, .input-row {
        grid-column: span 1;
    }
    .input-row {
        flex-direction: column;
    }
}

/* Aligne l'icône en haut pour les champs de texte longs */
.input-group:has(textarea) i {
    top: 20px; 
    transform: none;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f2f6; /* Petite ligne de séparation */
}

.back-home {
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.back-home i {
    margin-right: 5px;
}

/* Tracking Page */
.tracking-timeline {
    display: flex;
    justify-content: space-between;
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    position: relative;
}

/* Ligne horizontale qui relie les étapes */
.tracking-timeline::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 10%;
    width: 80%;
    height: 4px;
    background: #e1e2e6;
    z-index: 1;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-icon {
    width: 45px;
    height: 45px;
    background: #e1e2e6;
    color: #a4b0be;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 18px;
    transition: 0.3s;
}

/* Classes pour activer les étapes de couleur */
.step.active .step-icon {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 5px rgba(255, 71, 87, 0.2);
}
.step.active p {
    font-weight: bold;
    color: var(--secondary-color);
}

.tracking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.tracking-card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.tracking-card h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.detail-row span {
    color: #7f8c8d;
}

/* Styles pour le tableau Admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f2f6;
    font-size: 0.9rem;
}

.admin-table th {
    background-color: #f8f9fa;
    color: #57606f;
    font-weight: 600;
}

.admin-table tbody tr:hover {
    background-color: #fcfcfc;
}

/* Select compact pour changer le statut rapidement */
.select-status-admin {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    background-color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
}