/* ============================================================
   www/client/assets/css/client.css
   Espace client Motofly — Design cohérent avec Reback Admin
   ============================================================ */

:root {
    --primary:        #ff6c2f;
    --primary-dark:   #e85a1f;
    --primary-light:  #fff0eb;
    --secondary:      #5d7186;
    --success:        #37A593;
    --warning:        #fac71f;
    --danger:         #ef5f5f;
    --info:           #20C8E9;
    --purple:         #8579da;
    --dark:           #313b5e;
    --body-bg:        #f3f3f9;
    --card-bg:        #ffffff;
    --sidebar-bg:     #313b5e;
    --sidebar-width:  260px;
    --topbar-height:  70px;
    --text-primary:   #313b5e;
    --text-secondary: #5d7186;
    --text-muted:     #98a6ad;
    --border-color:   #eef0f7;
    --font:           'Inter', sans-serif;
    --radius:         10px;
    --radius-sm:      6px;
    --shadow:         0 2px 16px rgba(49,59,94,0.08);
    --shadow-sm:      0 1px 6px rgba(49,59,94,0.06);
    --transition:     all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--body-bg); color: var(--text-primary); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ============================================================
   PAGES AUTH (login, register, forgot-password)
   ============================================================ */
.auth-body { background: var(--body-bg); min-height: 100vh; display: flex; align-items: stretch; }
.auth-wrapper { display: flex; width: 100%; min-height: 100vh; }

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--dark) 0%, #1a2240 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 60px 50px;
    position: relative; overflow: hidden;
}
.auth-left::before {
    content: ''; position: absolute; top: -100px; right: -100px;
    width: 400px; height: 400px; background: var(--primary);
    opacity: 0.08; border-radius: 50%;
}
.auth-left::after {
    content: ''; position: absolute; bottom: -80px; left: -80px;
    width: 300px; height: 300px; background: var(--primary);
    opacity: 0.06; border-radius: 50%;
}
.auth-left-content { position: relative; z-index: 1; max-width: 420px; }

.auth-brand {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 48px; text-decoration: none;
}
.auth-brand-icon { font-size: 36px; }
.auth-brand-name { font-size: 28px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }

.auth-left-content h2 { font-size: 28px; font-weight: 700; color: #fff; line-height: 1.35; margin-bottom: 16px; }
.auth-left-content p  { color: rgba(255,255,255,0.65); font-size: 15px; line-height: 1.7; margin-bottom: 40px; }

.auth-features { display: flex; flex-direction: column; gap: 14px; }
.auth-feature {
    display: flex; align-items: center; gap: 14px;
    color: rgba(255,255,255,0.75); font-size: 14px;
}
.auth-feature i {
    font-size: 20px; color: var(--primary);
    background: rgba(255,108,47,0.15);
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; flex-shrink: 0;
}

.auth-right {
    width: 500px; background: #fff;
    display: flex; align-items: center; justify-content: center;
    padding: 50px 50px;
    box-shadow: -4px 0 30px rgba(0,0,0,0.05);
    overflow-y: auto;
}
.auth-card { width: 100%; max-width: 380px; }

.auth-card-header { margin-bottom: 28px; }
.auth-card-header h1 { font-size: 24px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.auth-card-header p  { color: var(--text-secondary); font-size: 14px; }

.auth-divider {
    text-align: center; margin: 20px 0;
    position: relative;
}
.auth-divider::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    height: 1px; background: var(--border-color);
}
.auth-divider span {
    background: #fff; padding: 0 12px;
    position: relative; font-size: 12px; color: var(--text-muted);
}

.auth-footer { margin-top: 24px; text-align: center; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--text-secondary); font-weight: 500; }
.auth-footer a:hover { color: var(--primary); }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 7px; }
.form-group label i { margin-right: 4px; color: var(--text-secondary); }

.form-control {
    width: 100%; padding: 11px 14px;
    font-size: 14px; font-family: var(--font);
    color: var(--text-primary);
    background: var(--body-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(255,108,47,0.12); }
.form-control::placeholder { color: var(--text-muted); }
.form-control:read-only { background: #f8f9fb; cursor: default; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2398a6ad' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

.input-password-wrapper { position: relative; }
.input-password-wrapper .form-control { padding-right: 44px; }
.btn-toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 16px; padding: 0; transition: var(--transition);
}
.btn-toggle-password:hover { color: var(--primary); }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; font-size: 14px; font-weight: 600;
    font-family: var(--font); border: none; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,108,47,0.35); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--border-color); color: var(--text-primary); }
.btn-secondary:hover { background: #dde0f0; color: var(--text-primary); }
.btn-full { width: 100%; padding: 13px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-soft-primary { background: var(--primary-light); color: var(--primary); }
.btn-soft-primary:hover { background: var(--primary); color: #fff; }
.btn-soft-success { background: #edfaf7; color: var(--success); }
.btn-soft-success:hover { background: var(--success); color: #fff; }
.btn-soft-danger  { background: #fef0f0; color: var(--danger); }
.btn-soft-danger:hover  { background: var(--danger); color: #fff; }
.btn-soft-warning { background: #fffbeb; color: #92660a; }
.btn-soft-info    { background: #e8fafd; color: var(--info); }

/* ============================================================
   ALERTES
   ============================================================ */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 500; margin-bottom: 20px;
}
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-danger  { background: #fef0f0; color: #c0392b; border-left: 3px solid var(--danger); }
.alert-success { background: #edfaf7; color: #1e8070; border-left: 3px solid var(--success); }
.alert-warning { background: #fffbeb; color: #92660a; border-left: 3px solid var(--warning); }
.alert-info    { background: #e8fafd; color: #0e7a8f; border-left: 3px solid var(--info); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; font-size: 12px; font-weight: 600;
    border-radius: 20px; white-space: nowrap;
}
.badge-soft-primary   { background: var(--primary-light); color: var(--primary); }
.badge-soft-success   { background: #edfaf7; color: var(--success); }
.badge-soft-warning   { background: #fffbeb; color: #92660a; }
.badge-soft-danger    { background: #fef0f0; color: var(--danger); }
.badge-soft-info      { background: #e8fafd; color: #0e7a8f; }
.badge-soft-secondary { background: #f0f3f7; color: var(--secondary); }
.badge-soft-purple    { background: #f0effe; color: var(--purple); }

/* ============================================================
   LAYOUT ESPACE CLIENT (sidebar + topbar + content)
   ============================================================ */
.client-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.client-sidebar {
    width: var(--sidebar-width); background: var(--sidebar-bg);
    position: fixed; top: 0; left: 0; height: 100vh;
    overflow-y: auto; overflow-x: hidden;
    transition: width 0.25s ease; z-index: 1000;
    display: flex; flex-direction: column;
}
.client-sidebar::-webkit-scrollbar { width: 4px; }
.client-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: var(--topbar-height); text-decoration: none;
}
.sidebar-brand-icon { font-size: 28px; flex-shrink: 0; }
.sidebar-brand-text { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -0.3px; white-space: nowrap; }
.sidebar-brand-text span { display: block; font-size: 10px; font-weight: 400; color: rgba(255,255,255,0.45); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 1px; }

.sidebar-nav { padding: 16px 0; flex: 1; }
.sidebar-section { padding: 16px 22px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.3); }
.sidebar-item { list-style: none; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 22px; color: rgba(255,255,255,0.65);
    font-size: 13.5px; font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.sidebar-link i { font-size: 18px; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.06); border-left-color: rgba(255,108,47,0.5); }
.sidebar-link.active { color: #fff; background: rgba(255,108,47,0.15); border-left-color: var(--primary); }
.sidebar-link.active i { color: var(--primary); }

.sidebar-footer { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,0.07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar {
    width: 36px; height: 36px; background: var(--primary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #fff; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.4); }
.sidebar-logout { color: rgba(255,255,255,0.4); font-size: 18px; flex-shrink: 0; transition: var(--transition); }
.sidebar-logout:hover { color: var(--danger); }

/* Topbar */
.client-topbar {
    position: fixed; top: 0; left: var(--sidebar-width); right: 0;
    height: var(--topbar-height); background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; z-index: 999; box-shadow: var(--shadow-sm);
}
.topbar-left  { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--dark); }

.topbar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px; background: var(--body-bg);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; color: var(--text-primary); cursor: pointer;
}
.topbar-user-avatar {
    width: 30px; height: 30px; background: var(--primary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #fff; font-weight: 700; flex-shrink: 0;
}

/* Contenu principal */
.client-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 28px;
    min-height: calc(100vh - var(--topbar-height));
}

/* ============================================================
   CARDS
   ============================================================ */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-color); }
.card-title { font-size: 15px; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary); }
.card-body { padding: 22px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--border-color);
    padding: 22px; display: flex; align-items: center; gap: 18px;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(49,59,94,0.12); }
.stat-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: #edfaf7; color: var(--success); }
.stat-icon.warning { background: #fffbeb; color: #e6aa00; }
.stat-icon.info    { background: #e8fafd; color: var(--info); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--dark); line-height: 1.1; margin-bottom: 4px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 12px 16px; text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); background: var(--body-bg); border-bottom: 1px solid var(--border-color); white-space: nowrap; }
tbody td { padding: 13px 16px; font-size: 13.5px; color: var(--text-primary); border-bottom: 1px solid var(--border-color); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 20px; font-weight: 700; color: var(--dark); }
.page-header p  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Utilitaires */
.mb-3 { margin-bottom: 24px !important; }
.mt-3 { margin-top: 24px !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.gap-2  { gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.divider { border: none; border-top: 1px solid var(--border-color); margin: 24px 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }

/* Responsive */
@media (max-width: 1024px) {
    .client-sidebar { width: 70px; }
    .sidebar-brand-text, .sidebar-link span, .sidebar-section, .sidebar-user-info { display: none; }
    .sidebar-brand { justify-content: center; padding: 20px; }
    .sidebar-link  { padding: 14px; justify-content: center; }
    .client-topbar  { left: 70px; }
    .client-content { margin-left: 70px; }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .auth-left { display: none; }
    .auth-right { width: 100%; }
    .client-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
