:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --error: #ef4444;
    --success: #22c55e;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

/* Typography */
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-main); }
.logo span { color: var(--primary); }

/* Layouts */
.container { max-width: 600px; margin: 20px auto; padding: 0 15px; min-height: auto; }

/* Multi-step Logic */
.step {
    display: none;
    animation: slideIn 0.3s ease-out;
}

.step.active {
    display: block;
}

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

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Step Buttons */
.step-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

.btn-next, .btn-prev, .btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; /* Gap réduit */
    padding: 12px 10px; /* Padding réduit */
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.8rem; /* Police ajustée pour le "One Line" */
    white-space: nowrap;
}

.btn-submit {
    background: var(--primary);
    color: white;
    width: 100%;
    font-size: 0.85rem; /* Un poil plus gros que Précédent */
    padding: 15px;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.btn-next { background: var(--primary); color: white; flex-grow: 1; }
.btn-prev { background: #f1f5f9; color: var(--text-muted); border: 1px solid #e2e8f0; min-width: 120px; }

.btn-next:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-prev:hover { background: #e2e8f0; }

/* Welcome Screen Sexy Design */
.welcome-screen {
    text-align: center;
    padding: 20px 10px; /* Réduit pour éviter le scroll */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    background: #e0e7ff;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 15px;
}

.welcome-title {
    font-size: 2.2rem; /* Réduit pour mobile */
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.quote-container {
    position: relative;
    max-width: 450px;
    margin: 5px auto 15px; /* Marges réduites au minimum */
    padding: 10px 30px;
}

.quote-mark {
    position: absolute;
    font-size: 6rem;
    color: #e2e8f0; /* Un gris un peu plus soutenu pour être visible */
    font-family: serif;
    line-height: 1;
    z-index: -1;
    top: -15px;
    left: -10px;
}

.quote-mark.bottom {
    top: auto;
    bottom: -35px;
    left: auto;
    right: -10px;
}

.intro-text {
    font-size: 0.95rem; /* Un peu plus compact */
    line-height: 1.6;
    color: var(--text-muted);
    font-weight: 500;
}

.sub-intro {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 20px;
}

.btn-start-survey {
    background: var(--primary);
    color: white;
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}

.btn-start-survey:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
    background: var(--primary-dark);
}
.glass {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

/* Survey Form */
.main-header { text-align: center; margin-bottom: 20px; }
.main-header h1 { font-size: 1.8rem; margin: 5px 0; }

.intro-box {
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.form-section {
    padding: 20px;
    margin-bottom: 15px;
}

.form-section h3 { margin-bottom: 15px; color: var(--primary); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 10px; font-size: 0.9rem; line-height: 1.4; }

.options-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.options-grid.vertical {
    grid-template-columns: 1fr;
}

.option-card {
    display: flex;
    align-items: center;
    padding: 8px 6px; /* Padding ultra réduit */
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    min-height: 40px;
    white-space: nowrap;
    overflow: hidden;
}

.option-card input { 
    margin: 0 6px 0 0;
    width: 14px; /* Radio mini */
    height: 14px; 
    flex-shrink: 0; 
    accent-color: var(--primary);
}

.option-card span {
    font-size: 0.75rem; /* Police réduite pour tout faire tenir */
    font-weight: 600;
    color: var(--text-main);
    text-overflow: ellipsis;
    overflow: hidden;
}

.pro-select, input[type="text"], input[type="password"] {
    width: 100%; 
    padding: 14px; 
    border: 1.5px solid #e2e8f0; 
    border-radius: 10px; 
    font-size: 1rem; 
    outline: none; 
    transition: all 0.2s;
    background: #fff;
    color: var(--text-main);
}

.pro-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

.pro-select:focus, input[type="text"]:focus, input[type="password"]:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.range-container { display: flex; align-items: center; gap: 15px; }
.pro-range { flex-grow: 1; accent-color: var(--primary); }
.range-output { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

.btn-submit {
    width: 100%; 
    padding: 18px; 
    background: var(--primary); 
    color: white; 
    border: none; 
    border-radius: 14px;
    font-size: 1.1rem; 
    font-weight: 700; 
    cursor: pointer; 
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
    transition: all 0.2s;
}

.btn-submit:hover { 
    background: var(--primary-dark); 
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(37, 99, 235, 0.3);
}

.btn-submit:active { transform: scale(0.98); }

/* Custom Alerts */
#alert-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: 90%;
    max-width: 400px;
}

.custom-alert {
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: alertIn 0.4s ease-out;
    transition: opacity 0.5s;
    border-left: 4px solid var(--primary);
}

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

/* Modal Masterpiece */
.modal { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.7); 
    backdrop-filter: blur(12px); /* Flou plus prononcé pour le côté premium */
    -webkit-backdrop-filter: blur(12px);
    align-items: center; 
    justify-content: center; 
    z-index: 2000; 
    padding: 20px; 
}

.modal-content { 
    background: rgba(255, 255, 255, 0.98);
    padding: 40px 25px; /* Réduit pour être plus compact */
    text-align: center; 
    max-width: 360px; /* Plus petit et élégant */
    width: 90%;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@keyframes modalSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.icon-success { 
    font-size: 3.5rem; 
    color: var(--success); 
    margin-bottom: 20px;
    background: #f0fdf4;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    display: inline-block;
    animation: successPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content h2 { 
    font-size: 1.6rem; 
    font-weight: 800;
    margin-bottom: 12px; 
    color: var(--text-main); 
}

.modal-content p { 
    font-size: 0.9rem;
    color: var(--text-muted); 
    line-height: 1.5;
}

/* Admin Panel */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--white); border-right: 1px solid #e2e8f0; padding: 30px 20px; display: flex; flex-direction: column; }
.sidebar nav { margin-top: 40px; display: flex; flex-direction: column; gap: 10px; }
.sidebar nav a { padding: 12px 15px; text-decoration: none; color: var(--text-muted); border-radius: 8px; font-weight: 600; }
.sidebar nav a.active { background: #eff6ff; color: var(--primary); }
.sidebar nav a.logout { margin-top: auto; color: var(--error); }

.admin-main { flex-grow: 1; padding: 40px; background: #f8fafc; }
.admin-header { margin-bottom: 40px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card { background: white; padding: 25px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card h3 { font-size: 0.9rem; text-transform: uppercase; color: var(--text-muted); }
.stat-card .val { font-size: 2.5rem; font-weight: 800; color: var(--primary); }

.data-section { margin-bottom: 40px; }
.data-section h2 { margin-bottom: 20px; font-size: 1.25rem; }

.table-container { background: white; border-radius: var(--radius); border: 1px solid #e2e8f0; overflow: hidden; }
.pro-table { width: 100%; border-collapse: collapse; }
.pro-table th { background: #f8fafc; text-align: left; padding: 15px; border-bottom: 1px solid #e2e8f0; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; }
.pro-table td { padding: 15px; border-bottom: 1px solid #f1f5f9; }

.progress-bar { height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; display: inline-block; width: 100px; margin-right: 10px; }
.progress { height: 100%; background: var(--primary); }

/* Login Page */
.login-container { height: 100vh; display: flex; align-items: center; justify-content: center; background: #f1f5f9; }
.login-card { width: 100%; max-width: 400px; padding: 40px; text-align: center; }
.login-card h2 { margin: 20px 0 10px; }
.login-card p { color: var(--text-muted); margin-bottom: 30px; }
.btn-login { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.alert-error { background: #fee2e2; color: #b91c1c; padding: 12px; border-radius: 8px; margin-bottom: 20px; }
.back-link { display: block; margin-top: 20px; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e2e8f0; padding: 15px 20px; }
    .sidebar nav { flex-direction: row; margin-top: 15px; overflow-x: auto; }
    .admin-main { padding: 20px; }
}
