/* ---------- VARIABLES ---------- */
:root {
    --bg-gradient: linear-gradient(135deg, #ffecd2, #fcb69f);
    --card-bg: #ffffff;
    --accent: #ff8a5c;
    --accent-dark: #e66c3b;
    --accent-soft: #ffe1cf;
    --text-main: #3b2217;
    --text-muted: #7a5946;
    --shadow: 0 14px 30px rgba(0,0,0,0.12);
    --radius: 18px;
    --border-soft: #f0d4c4;
    --transition: 0.2s ease;
}

/* ---------- RESET SIMPLE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
}

/* ---------- FOND ---------- */
.bg {
    min-height: 100vh;
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* ---------- CARTE GÉNÉRALE ---------- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    width: 100%;
    overflow: hidden;
    animation: popIn 0.35s ease-out;
}

/* Header */
.card-header {
    padding: 1.5rem 1.75rem 1rem;
    background: radial-gradient(circle at top left, #ffe5d0, #ffffff);
    border-bottom: 1px solid #f3dfd1;
    text-align: center;
}

.card-header h1 {
    margin: 0;
    font-size: 1.9rem;
}

.card-header p {
    margin-top: 0.4rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Body */
.card-body {
    padding: 1.75rem;
}

/* ---------- ÉTAPES ---------- */
.steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.step {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: #f7e1d4;
    color: var(--text-muted);
}

.step.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.step.done {
    background: #c3e6b3;
    color: #315225;
}

/* ---------- FORMULAIRE "TABLEAU" ---------- */

.table-card {
    width: 100%;
    margin: 0 auto;
    background: #ffffffd5;
    backdrop-filter: blur(8px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Lignes */
.table-row {
    display: grid;
    grid-template-columns: 38% 62%;
    padding: 12px 18px;
    border-bottom: 1px solid #f0d9c9;
    align-items: center;
    column-gap: 10px;
}

.table-row:last-of-type {
    border-bottom: none;
}

.table-label {
    font-weight: 700;
    color: #5a311e;
    font-size: 0.95rem;
}

/* Cellule droite */
.table-value input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2c9ba;
    border-radius: 8px;
    background: #fffaf7;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition);
}

.table-value input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255,138,92,0.25);
    background: #ffffff;
    transform: translateY(-1px);
}

/* Ligne total */
.highlight {
    background: #fff1e0;
}

.total-display {
    font-size: 1.1rem;
    color: var(--accent-dark);
    font-weight: 800;
    display: flex;
    flex-direction: column;
}

.total-note {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Footer du tableau */
.table-footer {
    padding: 14px 16px 12px;
    text-align: center;
    background: #f7e3d4;
    border-top: 1px solid #e9ccb9;
}

.footer-row {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* ---------- BOUTONS ---------- */

.btn {
    display: inline-block;
    text-align: center;
    padding: 0.8rem 1.1rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
    text-decoration: none;
}

.btn-main {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 20px rgba(255,138,92,0.4);
    width: 100%;
}

.btn-main:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 25px rgba(255,138,92,0.35);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
}

.btn-ghost:hover {
    background: #fff3eb;
}

/* ---------- TEXTES D'INFO ---------- */

.note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.note-small {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------- ANIMATION ---------- */

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 520px) {
    .card-body {
        padding: 1.3rem;
    }

    .table-row {
        grid-template-columns: 1fr;
        row-gap: 5px;
    }

    .table-label {
        margin-bottom: 3px;
    }

    .footer-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-ghost,
    .btn-main {
        width: 100%;
    }
}

/* ---------- ADMIN ---------- */

.card-admin {
    max-width: 1000px;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.admin-login-form label {
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-login-form input[type="password"] {
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: #fffaf7;
}

.admin-login-form input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255,138,92,0.25);
    outline: none;
}

.admin-error {
    background: #ffd1d1;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    color: #7a1f1f;
    margin-bottom: 1rem;
}

/* Stats */
.admin-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.stat-box {
    flex: 1 1 140px;
    background: #fff6ee;
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    border: 1px solid #f1d5c3;
}

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

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Tableau admin */
.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table thead {
    background: #ffe6d4;
}

.admin-table th,
.admin-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f0d9c9;
    text-align: left;
    white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
    background: #fff9f4;
}

/* Boutons admin */
.admin-logout-form {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-start;
    gap: 0.7rem;
}

/* ----- Couleurs des lignes selon statut paiement ----- */

.admin-table tr.paid {
    background: #e7f8e7 !important;   /* Vert très doux */
    border-left: 4px solid #4caf50;   /* Vert */
}

.admin-table tr.pending {
    background: #fff3e0 !important;   /* Orange très doux */
    border-left: 4px solid #ff9800;   /* Orange */
}

.admin-table tr.paid:hover {
    background: #dff3df !important;
}

.admin-table tr.pending:hover {
    background: #ffe9cc !important;
}

/* Bouton "Marquer payé" dans l'admin */
.btn-small {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 999px;
    border: none;
    background: #ff9800;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-small:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Badge "Payé" */
.paid-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 999px;
    background: #4caf50;
    color: #fff;
}

/* Lignes colorées selon le statut */
.admin-table tr.paid {
    background: #e7f8e7 !important;
    border-left: 4px solid #4caf50;
}

.admin-table tr.pending {
    background: #fff3e0 !important;
    border-left: 4px solid #ff9800;
}

.admin-table tr.paid:hover {
    background: #dff3df !important;
}

.admin-table tr.pending:hover {
    background: #ffe9cc !important;
}

