:root {
    --bg-1: #0f172a;
    --bg-2: #1e3a8a;
    --bg-3: #0ea5e9;
    --card: rgba(255, 255, 255, 0.94);
    --card-border: rgba(255, 255, 255, 0.55);
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #0f6cbd;
    --primary-dark: #0a4f8a;
    --accent: #14b8a6;
    --warning: #fff3b0;
    --danger: #e11d48;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.30);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 32px;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(14,165,233,0.35), transparent 28%),
        radial-gradient(circle at bottom right, rgba(20,184,166,0.25), transparent 30%),
        linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
    min-height: 100vh;
}

.box {
    max-width: 1180px;
    margin: 0 auto;
    padding: 38px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.box:hover {
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.34);
}

.box::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14,165,233,0.18) 0%, rgba(14,165,233,0) 70%);
    pointer-events: none;
}

.box::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20,184,166,0.15) 0%, rgba(20,184,166,0) 70%);
    pointer-events: none;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

.box > a:first-of-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: #eef6ff;
    border: 1px solid #d6eaff;
    border-radius: 999px;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.2s ease;
}

.box > a:first-of-type:hover {
    background: #e3f0ff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 108, 189, 0.10);
}

h1 {
    margin: 0 0 24px 0;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 800;
    font-style: italic;
    color: #0f6cbd;
    letter-spacing: -0.5px;
}

h2 {
    position: relative;
    margin: 40px 0 18px 0;
    padding: 0 0 12px 0;
    border: none;
    font-size: 21px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0.2px;
    color: #0f6cbd;
}

h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 72px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #0f6cbd 0%, #14b8a6 100%);
}

h3 {
    margin: 28px 0 12px 0;
    font-size: 18px;
    color: #0f6cbd;
    text-transform: none;
    letter-spacing: 0.2px;
}

.intro {
    background: linear-gradient(135deg, #fffef2 0%, #fff9db 100%);
    border: 1px solid #f8e58f;
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 26px;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.intro:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.intro p {
    margin: 10px 0;
    line-height: 1.65;
    font-size: 15px;
}

.important {
    display: inline;
    font-weight: 700;
    color: #4b5563;
}

.email-line {
    display: block;
    margin: 0 0 30px 0;
    padding: 18px 22px;
    text-align: center;
    font-size: 17px;
    color: #7c3f52;
    background: linear-gradient(135deg, #fff1f5 0%, #fff7fa 100%);
    border: 1px solid #ffd4e0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.email-line:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(124, 63, 82, 0.12);
}

.email-line a {
    font-weight: 700;
    text-decoration: underline;
    color: #6b213b;
}

form {
    width: 100%;
    position: relative;
    z-index: 2;
}

.form-grid,
.row-3,
.row-4 {
    display: grid;
    gap: 18px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.required {
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 14px 15px;
    font-size: 14px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid #d6dee8;
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, background-color 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="number"]:hover,
input[type="file"]:hover,
textarea:hover,
select:hover {
    border-color: #93c5fd;
    background: #fcfeff;
    box-shadow: 0 6px 18px rgba(15, 108, 189, 0.08);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
    border-color: #38bdf8;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16), 0 10px 24px rgba(15, 108, 189, 0.10);
    transform: translateY(-1px);
}

textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

::placeholder {
    color: #9aa7b6;
}

.checkbox-list {
    display: grid;
    gap: 14px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    background: #f8fbff;
    border: 1px solid #e1edf7;
    border-radius: 12px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.checkbox-item:hover {
    transform: translateY(-1px);
    background: #f1f8ff;
    border-color: #b9dcfb;
    box-shadow: 0 10px 22px rgba(15, 108, 189, 0.08);
}

.checkbox-item label {
    margin: 0;
    font-weight: 600;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0f6cbd;
    cursor: pointer;
}

.checkbox-item input[type="text"] {
    flex: 1 1 260px;
    min-width: 220px;
}

.note {
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

.note-yellow {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff3a3 0%, #ffe17d 100%);
    color: #8a4b00;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(255, 193, 7, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.note-yellow:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(255, 193, 7, 0.22);
}

table {
    width: 100%;
    margin-top: 16px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #d9e4ee;
    background: #fff;
}

table thead th {
    padding: 14px 10px;
    background: linear-gradient(135deg, #eaf4ff 0%, #dff4ff 100%);
    color: #0f3d67;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #d7e6f2;
}

table td {
    padding: 8px;
    border-bottom: 1px solid #edf2f7;
    border-right: 1px solid #edf2f7;
    background: #fff;
}

table tr:last-child td {
    border-bottom: none;
}

table td:last-child,
table th:last-child {
    border-right: none;
}

table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

table tbody tr:hover td {
    background: #f7fbff;
}

.small-input {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #d6dee8;
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.small-input:hover {
    border-color: #93c5fd;
    background: #fcfeff;
    box-shadow: 0 6px 16px rgba(15, 108, 189, 0.08);
}

.small-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16);
    background: #fff;
}

.constat,
.engagement,
.redevance,
.signature-box {
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid #e5eef5;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    box-shadow: var(--shadow-soft);
    line-height: 1.7;
    color: #374151;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.constat:hover,
.engagement:hover,
.redevance:hover,
.signature-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.engagement ol {
    margin: 12px 0 0 20px;
    padding-left: 14px;
}

.engagement li {
    margin-bottom: 10px;
}

.redevance ul {
    margin: 10px 0 0 18px;
    padding: 0;
}

.signature-box {
    margin-top: 20px;
}

.signature-zone {
    height: 190px;
    margin-top: 18px;
    border: 2px dashed #b8c7d9;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(15,108,189,0.03), rgba(20,184,166,0.03)),
        #fcfdff;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.signature-zone:hover {
    border-color: #93c5fd;
    background:
        linear-gradient(135deg, rgba(15,108,189,0.05), rgba(20,184,166,0.05)),
        #fafdff;
}

.signature-note {
    margin-top: 10px;
    text-align: center;
    color: #b45369;
    font-style: italic;
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 35px;
}

.btn {
    appearance: none;
    border: none;
    border-radius: 14px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.16);
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
}

.btn:active {
    transform: translateY(1px) scale(0.99);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #0f6cbd 0%, #0ea5e9 100%);
}

.btn-primary:hover {
    box-shadow: 0 0px 0px rgba(14, 165, 233, 0.30);
    filter: brightness(0.8);
}

.btn-secondary {
    color: #334155;
    background: linear-gradient(135deg, #eef2f7 0%, #dfe7ef 100%);
}

.btn-secondary:hover {
    box-shadow: 0 0px 0px rgba(148, 163, 184, 0.22);
    filter: brightness(0.8);
}

.overlay-login {
    position: fixed;
    inset: 0;
    background: rgba(8, 15, 33, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.overlay-content-login {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.22);
    padding: 30px;
    text-align: center;
}

.overlay-content-login h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.overlay-content-login .content input[type="text"],
.overlay-content-login .content input[type="password"] {
    width: 100%;
    margin-bottom: 12px;
    padding: 14px 15px;
    border-radius: 12px;
    border: 1px solid #d6dee8;
    font-size: 14px;
}

.overlay-content-login input[type="button"] {
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    margin: 8px 6px 0 6px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.overlay-content-login input[type="button"]:hover {
    transform: translateY(-1px);
}

.overlay-content-login input[value="Annuler"] {
    background: #e5e7eb;
    color: #1f2937;
}

.overlay-content-login input[value="Annuler"]:hover {
    box-shadow: 0 12px 22px rgba(148, 163, 184, 0.18);
    filter: brightness(0.98);
}

.overlay-content-login input[value="Se connecter"] {
    background: linear-gradient(135deg, #0f6cbd 0%, #0ea5e9 100%);
    color: #fff;
}

.overlay-content-login input[value="Se connecter"]:hover {
    box-shadow: 0 16px 30px rgba(14, 165, 233, 0.26);
    filter: brightness(1.03);
}

.btn-suppr-vehicule {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.btn-suppr-vehicule:hover {
    background: #fee2e2;
    transform: scale(1.15);
}

#btnAjouterVehicule {
    border: 2px dashed #93c5fd;
    background: #f0f9ff;
    color: #0f6cbd;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}

#btnAjouterVehicule:hover {
    background: #e0f2fe;
    border-color: #0f6cbd;
    transform: translateY(-1px);
}

@media screen and (max-width: 1100px) {
    .row-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 900px) {
    body {
        padding: 18px;
    }

    .box {
        padding: 24px;
        border-radius: 20px;
    }

    .form-grid,
    .row-3,
    .row-4 {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 19px;
    }

    .checkbox-item {
        align-items: flex-start;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media screen and (max-width: 560px) {
    body {
        padding: 12px;
    }

    .box {
        padding: 18px;
    }

    h1 {
        font-size: 24px;
    }

    .intro,
    .email-line,
    .constat,
    .engagement,
    .redevance,
    .signature-box {
        padding: 16px;
    }
}