/* ── Variables ─────────────────────────────────────────── */
:root {
    --primary:       #0069ff;
    --primary-dark:  #0052cc;
    --primary-light: #e8f0fe;
    --success:       #00c17c;
    --success-bg:    #e6f9f2;
    --danger:        #f23b3b;
    --danger-bg:     #fdeaea;
    --warning:       #f59e0b;
    --warning-bg:    #fff8e6;
    --purple:        #7c3aed;
    --purple-bg:     #f0ebff;
    --blue-bg:       #e8f0fe;
    --text:          #1a1a2e;
    --text-muted:    #6b7280;
    --border:        #e5e7eb;
    --bg:            #f3f4f8;
    --white:         #ffffff;
    --radius:        10px;
    --radius-sm:     6px;
    --shadow:        0 4px 20px rgba(0,0,0,.08);
    --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
}

/* ── Header / Nav ──────────────────────────────────────── */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -.5px;
}

.topbar-logo span { color: var(--text); }

.topbar-nav { display: flex; align-items: center; gap: 16px; }

.btn-logout {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all .2s;
    float: none;
}
.btn-logout:hover { background: var(--bg); color: var(--text); text-decoration: none; }

/* ── Page wrapper ──────────────────────────────────────── */
.page {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 24px;
}

/* Legacy .container support */
.container {
    max-width: 700px;
    margin: 40px auto;
    padding: 40px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ── Typography ────────────────────────────────────────── */
h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

h1 small {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 10px; color: var(--text-muted); }

/* ── Status badges ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge::before { content: '●'; font-size: 8px; }

.badge-waiting      { background: var(--warning-bg); color: #92400e; }
.badge-accepted     { background: var(--success-bg); color: #065f46; }
.badge-refused      { background: var(--danger-bg);  color: #991b1b; }
.badge-pending-j    { background: var(--blue-bg);    color: #1e40af; }
.badge-pending-org  { background: var(--purple-bg);  color: #5b21b6; }

/* ── Cards / Dashboard ─────────────────────────────────── */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    flex: 1;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Demande cards ─────────────────────────────────────── */
.demande-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s;
}

.demande-card:hover { box-shadow: var(--shadow); }

.demande-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.demande-card-header .journalist-info { display: flex; align-items: center; gap: 14px; }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.journalist-name { font-weight: 600; font-size: 15px; }
.journalist-meta { font-size: 12px; color: var(--text-muted); }

.demande-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
}

.demande-field {
    padding: 14px 20px;
    border-right: 1px solid var(--border);
}

.demande-field:last-child { border-right: none; }

.demande-field-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.demande-field-value { font-size: 14px; color: var(--text); }

.demande-card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.creneaux-list { flex: 1; }
.creneaux-list ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.creneaux-list li {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.creneau-tag { font-size: 10px; color: var(--text-muted); }
.creneau-valide { border-color: var(--success); background: var(--success-bg); }

.actions-zone { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }

/* ── Forms (tableau de bord) ───────────────────────────── */
.action-form {
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-form select,
.action-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--white);
    color: var(--text);
    resize: none;
}

.action-form textarea { min-height: 60px; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}

.btn-primary   { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success   { background: var(--success); color: var(--white); }
.btn-success:hover { background: #009e66; }

.btn-danger    { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #d42f2f; }

.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }

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

/* Legacy button */
button, input[type="submit"] {
    background: var(--primary);
    color: var(--white);
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
button:hover, input[type="submit"]:hover { background: var(--primary-dark); }

/* ── Public form ───────────────────────────────────────── */
.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-header .logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="datetime-local"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    margin-bottom: 14px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,105,255,.12);
}

textarea { min-height: 90px; resize: vertical; }

fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 14px;
}

legend {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    padding: 0 6px;
}

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 400;
    cursor: pointer;
    font-size: 14px;
    background: var(--bg);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: all .2s;
    margin: 0;
}

.checkbox-group label:hover { border-color: var(--primary); background: var(--primary-light); }
.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] { width: auto; margin: 0; }

.creneau-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.creneau-input-row input { margin-bottom: 0; flex: 1; }

.btn-add {
    background: transparent;
    color: var(--primary);
    border: 1px dashed var(--primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all .2s;
}
.btn-add:hover { background: var(--primary-light); }

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    margin-top: 8px;
}
.btn-submit:hover { background: var(--primary-dark); }

/* ── Login page ────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card .logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.login-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.login-card label { text-align: left; }

/* ── Merci page ────────────────────────────────────────── */
.merci-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.merci-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 56px 48px;
    text-align: center;
    max-width: 480px;
}

.merci-icon { font-size: 56px; margin-bottom: 20px; }
.merci-card h1 { font-size: 28px; }
.merci-card p { color: var(--text-muted); margin-top: 12px; }

/* ── Alerts ────────────────────────────────────────────── */
.error {
    background: var(--danger-bg);
    color: #991b1b;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin: 8px 0;
    border-left: 3px solid var(--danger);
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin: 8px 0;
    border-left: 3px solid var(--success);
}

/* ── Misc ──────────────────────────────────────────────── */
a { color: var(--primary); text-decoration: none; float: none; }
a:hover { text-decoration: underline; }

.text-muted { color: var(--text-muted); font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .page { padding: 0 12px; }
    .container { padding: 24px 16px; margin: 16px; }
    .demande-card-body { grid-template-columns: 1fr; }
    .demande-field { border-right: none; border-bottom: 1px solid var(--border); }
    .demande-card-footer { flex-direction: column; }
    .stats-bar { flex-wrap: wrap; }
    .topbar { padding: 0 16px; }
}
