/* ============================================================
   Avis-Authentifier - Styles Principaux
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --primary-light: #A78BFA;
    --accent: #FF6B35;
    --accent-light: #FF8A5C;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    --bg: #FFFFFF;
    --bg-light: #F8FAFC;
    --bg-dark: #0F172A;
    --text: #1E293B;
    --text-light: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);

    --transition: all 0.3s ease;
    --max-width: 1280px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---- Boutons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    border: none; transition: var(--transition); white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: white; box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4); }

.btn-secondary {
    background: white; color: var(--primary); border: 2px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary); color: white; }

.btn-outline {
    background: transparent; color: var(--text); border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-info { background: var(--info); color: white; }

/* ---- Header ---- */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
}

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.4rem; font-weight: 800;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo i { font-size: 1.6rem; -webkit-text-fill-color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
    font-weight: 500; color: var(--text-light); font-size: 0.95rem;
    position: relative;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 2px; background: var(--primary);
    transition: var(--transition);
}
.nav-links a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn { display: none; font-size: 1.5rem; cursor: pointer; }

/* ---- Hero Section ---- */
.hero {
    padding: 140px 0 80px;
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
    text-align: center;
    position: relative; overflow: hidden;
}

.hero::before {
    content: ''; position: absolute; top: -50%; left: -20%;
    width: 60%; height: 100%;
    background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: ''; position: absolute; bottom: -30%; right: -20%;
    width: 60%; height: 100%;
    background: radial-gradient(circle, rgba(255,107,53,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero h1 {
    font-size: 3.2rem; font-weight: 800; line-height: 1.15;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.hero p {
    font-size: 1.2rem; color: var(--text-light); margin-bottom: 40px;
    max-width: 600px; margin-left: auto; margin-right: auto;
}

/* ---- Barre de recherche ---- */
.search-bar {
    display: flex; align-items: center; gap: 0;
    background: white; border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl); border: 1px solid var(--border);
    padding: 6px; max-width: 700px; margin: 0 auto 50px;
}

.search-bar input {
    flex: 1; border: none; padding: 16px 20px; font-size: 1rem;
    outline: none; background: transparent;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar button {
    padding: 16px 32px; border-radius: var(--radius-lg);
    border: none; background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: white; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: var(--transition);
}
.search-bar button:hover { transform: scale(1.02); }

/* ---- Stats ---- */
.stats-row {
    display: flex; justify-content: center; gap: 60px; margin-top: 40px;
}

.stat-item { text-align: center; }
.stat-number {
    font-size: 2.5rem; font-weight: 800;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 0.9rem; color: var(--text-light); font-weight: 500; }

/* ---- Sections ---- */
.section { padding: 80px 0; }
.section-light { background: var(--bg-light); }
.section-header {
    text-align: center; margin-bottom: 50px;
}
.section-header h2 {
    font-size: 2.2rem; font-weight: 700; margin-bottom: 12px;
    color: var(--text);
}
.section-header p {
    font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto;
}

/* ---- Cards Entreprises ---- */
.entreprises-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.entreprise-card {
    background: white; border-radius: var(--radius-lg);
    border: 1px solid var(--border-light); overflow: hidden;
    transition: var(--transition); cursor: pointer;
}
.entreprise-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.entreprise-card-header {
    padding: 24px; display: flex; align-items: flex-start; gap: 16px;
    border-bottom: 1px solid var(--border-light);
}

.entreprise-logo {
    width: 60px; height: 60px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.5rem; font-weight: 700; flex-shrink: 0;
}

.entreprise-card-info { flex: 1; min-width: 0; }
.entreprise-card-info h3 {
    font-size: 1.1rem; font-weight: 700; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.entreprise-card-info .category-tag {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    background: var(--bg-light); color: var(--primary);
    font-size: 0.75rem; font-weight: 600;
}

.entreprise-card-body { padding: 16px 24px; }
.entreprise-card-body p {
    color: var(--text-light); font-size: 0.9rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

.entreprise-card-footer {
    padding: 16px 24px; display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid var(--border-light); background: var(--bg-light);
}

/* ---- Cards Avis ---- */
.avis-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.avis-card {
    background: white; border-radius: var(--radius-lg);
    border: 1px solid var(--border-light); padding: 24px;
    transition: var(--transition);
}
.avis-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.avis-card-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}

.avis-author {
    display: flex; align-items: center; gap: 12px;
}

.avis-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 1rem;
}

.avis-author-info h4 { font-size: 0.95rem; font-weight: 600; }
.avis-author-info span { font-size: 0.8rem; color: var(--text-muted); }

.avis-note {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    padding: 4px 12px; border-radius: 20px;
    font-weight: 700; font-size: 0.9rem; color: #92400E;
}

.avis-card-body h4 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.avis-card-body p { color: var(--text-light); font-size: 0.9rem; line-height: 1.6; }

.avis-card-footer {
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
}

.avis-entreprise-link {
    font-size: 0.85rem; font-weight: 600; color: var(--primary);
}
.avis-entreprise-link:hover { text-decoration: underline; }

.avis-date { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Étoiles ---- */
.stars { display: flex; gap: 2px; }
.stars i { color: #CBD5E1; font-size: 0.85rem; }
.stars i.filled { color: #FBBF24; }
.stars-lg i { font-size: 1.2rem; }
.stars-md i { font-size: 1rem; }

/* ---- Catégories ---- */
.categories-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.categorie-card {
    background: white; border-radius: var(--radius-lg);
    border: 1px solid var(--border-light); padding: 28px 20px;
    text-align: center; transition: var(--transition); cursor: pointer;
}
.categorie-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.categorie-icon {
    width: 60px; height: 60px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(124,58,237,0.05));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; color: var(--primary); font-size: 1.5rem;
}

.categorie-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.categorie-card span { font-size: 0.85rem; color: var(--text-muted); }

/* ---- Étapes Comment ça marche ---- */
.steps-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
}

.step-card { text-align: center; position: relative; }
.step-card:not(:last-child)::after {
    content: ''; position: absolute; top: 30px; right: -20px;
    width: 40px; height: 2px; background: var(--border);
}

.step-number {
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800; margin: 0 auto 20px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.step-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.step-card p { color: var(--text-light); font-size: 0.95rem; }

/* ---- CTA Section ---- */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl); padding: 60px;
    text-align: center; color: white;
}
.cta-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.cta-section p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 30px; }
.cta-section .btn {
    background: white; color: var(--primary); font-weight: 700;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.cta-section .btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }

/* ---- Footer ---- */
.site-footer {
    background: var(--bg-dark); color: #94A3B8; padding: 60px 0 30px;
}

.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}

.footer-brand .logo { margin-bottom: 16px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; }

.footer-col h4 { color: white; font-size: 1rem; font-weight: 600; margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.9rem; transition: var(--transition); }
.footer-col a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px;
    text-align: center; font-size: 0.85rem;
}

/* ---- Page Header ---- */
.page-header {
    background: linear-gradient(135deg, var(--bg-light) 0%, white 100%);
    padding: 120px 0 50px; text-align: center; border-bottom: 1px solid var(--border-light);
}
.page-header h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 12px; }
.page-header p { font-size: 1.1rem; color: var(--text-light); }

/* ---- Breadcrumb ---- */
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ---- Formulaires ---- */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%; padding: 12px 16px; border-radius: var(--radius-md);
    border: 1.5px solid var(--border); font-size: 0.95rem;
    background: white; transition: var(--transition); font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-card {
    background: white; border-radius: var(--radius-lg); border: 1px solid var(--border-light);
    padding: 40px; max-width: 600px; margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.form-card h2 { text-align: center; margin-bottom: 8px; }
.form-card .subtitle { text-align: center; color: var(--text-light); margin-bottom: 30px; font-size: 0.95rem; }

/* ---- Alertes ---- */
.alert {
    padding: 16px 20px; border-radius: var(--radius-md); margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px; font-size: 0.9rem;
}
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ---- Pagination ---- */
.pagination-nav { margin-top: 40px; display: flex; justify-content: center; }
.pagination { display: flex; gap: 8px; align-items: center; }
.page-link {
    padding: 10px 16px; border-radius: var(--radius-md);
    border: 1px solid var(--border); font-weight: 500; font-size: 0.9rem;
    transition: var(--transition);
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-dots { color: var(--text-muted); }

/* ---- Profil Entreprise ---- */
.entreprise-hero {
    background: white; border-bottom: 1px solid var(--border-light);
    padding: 40px 0;
}

.entreprise-profile {
    display: flex; align-items: flex-start; gap: 30px;
}

.entreprise-profile-logo {
    width: 100px; height: 100px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2.5rem; font-weight: 700; flex-shrink: 0;
}

.entreprise-profile-info h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.entreprise-profile-info .meta {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    color: var(--text-light); font-size: 0.9rem; margin-bottom: 12px;
}
.entreprise-profile-info .meta i { color: var(--primary); }

.entreprise-note-big {
    display: flex; align-items: center; gap: 12px;
}
.entreprise-note-big .note-value {
    font-size: 2.5rem; font-weight: 800; color: var(--primary);
}
.entreprise-note-big .note-details { font-size: 0.85rem; color: var(--text-muted); }

/* ---- Onglets ---- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); margin-bottom: 30px; }
.tab {
    padding: 14px 24px; font-weight: 600; color: var(--text-light);
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: var(--transition); cursor: pointer;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--primary); }

/* ---- Dashboard Pro ---- */
.dashboard-grid {
    display: grid; grid-template-columns: 280px 1fr; gap: 30px;
}

.sidebar {
    background: white; border-radius: var(--radius-lg);
    border: 1px solid var(--border-light); padding: 24px;
    height: fit-content; position: sticky; top: 90px;
}

.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 4px; }
.sidebar-menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-md);
    font-weight: 500; color: var(--text-light); font-size: 0.95rem;
    transition: var(--transition);
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(124,58,237,0.05));
    color: var(--primary);
}

.dashboard-content { min-height: 500px; }

.stats-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px; margin-bottom: 30px;
}

.stat-card {
    background: white; border-radius: var(--radius-lg);
    border: 1px solid var(--border-light); padding: 24px;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card-icon {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 16px;
}
.stat-card-icon.purple { background: rgba(124,58,237,0.1); color: var(--primary); }
.stat-card-icon.green { background: rgba(34,197,94,0.1); color: var(--success); }
.stat-card-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-card-icon.blue { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-card h3 { font-size: 1.8rem; font-weight: 800; margin-bottom: 4px; }
.stat-card p { font-size: 0.85rem; color: var(--text-muted); }

/* ---- Tableaux ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 14px 16px; text-align: left; font-size: 0.9rem;
    border-bottom: 1px solid var(--border-light);
}
.data-table th {
    font-weight: 600; color: var(--text-light); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px;
    background: var(--bg-light);
}
.data-table tr:hover td { background: var(--bg-light); }

.badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

/* ---- Rating Input ---- */
.rating-input { display: flex; gap: 8px; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input input { display: none; }
.rating-input label {
    font-size: 2rem; color: #CBD5E1; cursor: pointer; transition: var(--transition);
}
.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label { color: #FBBF24; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .stats-row { gap: 30px; flex-wrap: wrap; }
    .steps-grid { grid-template-columns: 1fr; }
    .step-card::after { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .header-actions .btn { display: none; }
    .search-bar { flex-direction: column; border-radius: var(--radius-lg); }
    .search-bar button { width: 100%; border-radius: var(--radius-md); }
    .form-row { grid-template-columns: 1fr; }
    .entreprise-profile { flex-direction: column; align-items: center; text-align: center; }
    .entreprise-profile-info .meta { justify-content: center; }
    .page-header h1 { font-size: 1.8rem; }
}
