/* ÉCLAIR Proctor — Styles */
:root {
    --primary: #1a56db;
    --primary-light: #e8eefb;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --radius: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    padding: 24px 0;
    margin-bottom: 24px;
}
.header h1 { font-size: 1.6rem; margin-bottom: 4px; }
.header p { opacity: 0.85; font-size: 0.95rem; }
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.header-stats { display: flex; gap: 20px; }
.stat-box { text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; opacity: 0.8; }

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card h2 { font-size: 1.3rem; margin-bottom: 16px; color: var(--dark); }
.card h3 { font-size: 1.05rem; margin-bottom: 10px; color: var(--gray); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1e40af; }
.btn-secondary { background: var(--dark); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-large { padding: 14px 32px; font-size: 1.05rem; }
.cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray); font-size: 0.9rem; }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Video */
.video-container { text-align: center; margin: 16px 0; }
.video-container video, .video-panel video {
    width: 100%;
    max-width: 640px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: #000;
}

/* Proctoring Layout */
.proctoring-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.video-panel { position: relative; }
.status-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-ok { background: var(--success-light); color: var(--success); }
.status-warning { background: var(--warning-light); color: var(--warning); }
.status-critical { background: var(--danger-light); color: var(--danger); }

/* Detection Panel */
.detection-panel { display: flex; flex-direction: column; gap: 8px; }
.detection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--light);
    border-radius: 8px;
}
.detection-item .label { font-weight: 500; color: var(--gray); font-size: 0.9rem; }
.detection-item .value { font-weight: 600; font-size: 0.9rem; padding: 2px 10px; border-radius: 12px; }
.value.ok { color: var(--success); background: var(--success-light); }
.value.warning { color: var(--warning); background: var(--warning-light); }
.value.critical { color: var(--danger); background: var(--danger-light); }

/* Score */
.score-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.score-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin: 8px 0;
}
.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
    border-radius: 6px;
    transition: width 0.5s ease;
}
.score-value { font-size: 1.4rem; font-weight: 700; color: var(--dark); }

/* Stats */
.stats { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.stats .label { color: var(--gray); font-size: 0.85rem; }

/* Alerts */
.alerts-section { margin-top: 16px; }
.alerts-log {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
}
.alert-item {
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}
.alert-item.info { background: #eff6ff; color: #1d4ed8; }
.alert-item.warning { background: var(--warning-light); color: #92400e; }
.alert-item.critical { background: var(--danger-light); color: var(--danger); font-weight: 600; }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 24px 0; }
.feature { text-align: center; padding: 20px 12px; background: var(--light); border-radius: var(--radius); }
.feature-icon { font-size: 2rem; margin-bottom: 8px; }
.feature h3 { font-size: 0.95rem; margin-bottom: 6px; }
.feature p { font-size: 0.82rem; color: var(--gray); }

/* Tech Stack */
.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-tag {
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Sessions Grid (Dashboard) */
.sessions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.session-card {
    padding: 16px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: all 0.2s;
}
.session-card.score-low { border-color: var(--success); }
.session-card.score-medium { border-color: var(--warning); }
.session-card.score-high { border-color: var(--danger); }
.session-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.session-info { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--gray); }
.session-bar { margin-top: 10px; }
.score-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
}
.score-badge.score-low, .score-low .score-badge { background: var(--success-light); color: var(--success); }
.score-badge.score-medium, .score-medium .score-badge { background: var(--warning-light); color: #92400e; }
.score-badge.score-high, .score-high .score-badge { background: var(--danger-light); color: var(--danger); }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.data-table th { font-weight: 600; color: var(--gray); }
.status-tag { padding: 2px 10px; border-radius: 10px; font-size: 0.8rem; font-weight: 500; }
.status-tag.clean, .status-tag.completed { background: var(--success-light); color: var(--success); }
.status-tag.suspicious { background: var(--warning-light); color: #92400e; }
.status-tag.flagged { background: var(--danger-light); color: var(--danger); }

/* Status message */
.status-msg { padding: 10px 16px; border-radius: 8px; margin-top: 12px; }
.status-msg.success { background: var(--success-light); color: var(--success); }
.status-msg.error { background: var(--danger-light); color: var(--danger); }

.empty-state { color: var(--gray); font-style: italic; text-align: center; padding: 20px; }

/* Footer */
.footer { text-align: center; padding: 24px; color: var(--gray); font-size: 0.85rem; margin-top: 40px; }

/* Utility */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    .proctoring-layout { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .header-flex { flex-direction: column; gap: 12px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}
