/* Reset léger */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1f2933 0, #050816 55%, #02010a 100%);
    color: #e5e7eb;
    min-height: 100vh;
}

/* Layout global */
body > header,
body > footer,
.main-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.main-wrapper {
    padding-top: 32px;
    padding-bottom: 40px;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

header h1 {
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #facc15;
}

nav {
    display: flex;
    gap: 14px;
}

nav a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.18s ease-out;
}

nav a:hover {
    border-color: rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.85);
}

/* Titres */
h1, h2, h3 {
    color: #f9fafb;
    margin-bottom: 12px;
}

.page-title {
    font-size: 1.6rem;
    margin-bottom: 18px;
}

/* Cartes / blocs */
.card {
    background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), rgba(15, 23, 42, 0.96));
    border-radius: 14px;
    padding: 20px 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
}

/* Formulaires */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

label {
    font-size: 0.9rem;
    color: #cbd5f5;
}

input[type="text"],
input[type="password"],
textarea {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 10px;
    padding: 9px 11px;
    color: #e5e7eb;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out, background 0.16s ease-out;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: #facc15;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.6);
    background: rgba(15, 23, 42, 0.98);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

/* Boutons */
button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #facc15, #eab308);
    color: #111827;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(250, 204, 21, 0.35);
    filter: brightness(1.03);
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Liens d'action */
a.action-link {
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.95rem;
}

a.action-link:hover {
    text-decoration: underline;
}

/* Messages */
.alert-success {
    margin-bottom: 12px;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(22, 163, 74, 0.7);
    color: #bbf7d0;
    font-size: 0.9rem;
}

.alert-error {
    margin-bottom: 12px;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.7);
    color: #fecaca;
    font-size: 0.9rem;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9rem;
}

table th,
table td {
    padding: 9px 8px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.9);
}

table th {
    text-align: left;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.9);
}

table tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.7);
}

/* Footer */
footer {
    padding: 18px 0 26px;
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    margin-top: 24px;
}

/* ============================
   📱 OPTIMISATION MOBILE
   ============================ */
@media (max-width: 768px) {

    body > header,
    body > footer,
    .main-wrapper {
        padding: 0 12px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    nav a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 1.3rem;
        text-align: center;
    }

    .card {
        padding: 16px;
    }

    form {
        gap: 8px;
    }

    input[type="text"],
    input[type="password"],
    textarea {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    button,
    .btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 1rem;
    }

    table th,
    table td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }

    footer {
        font-size: 0.75rem;
        padding: 14px 0 20px;
    }
}

/* ============================
   📱 OPTIMISATION ULTRA PETIT ÉCRAN (< 480px)
   ============================ */
@media (max-width: 480px) {

    header h1 {
        font-size: 1.1rem;
    }

    nav a {
        font-size: 0.85rem;
        padding: 5px 10px;
    }

    .card {
        padding: 14px;
    }

    input,
    textarea {
        font-size: 0.85rem;
    }

    button,
    .btn {
        font-size: 0.9rem;
    }
}
