:root {
    /* Couleurs principales extraites du logo Anima */
    --ink: #342722;
    --muted: #75655e;
    --line: #ead9cc;
    --soft: #fff7ef;

    --blue: #71c4d3;
    --blue-light: #dff4f7;
    --blue-dark: #3f96a8;

    --orange: #f3a657;
    --orange-light: #fff0dd;
    --orange-dark: #d97828;

    --brown: #4a342b;
    --brown-light: #725247;

    --cream: #fffaf4;
    --white: #ffffff;

    --danger: #b54040;
    --success: #4c8d6f;

    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* =========================
   BASE
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(
            circle at top left,
            rgba(113, 196, 211, 0.25),
            transparent 34%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(243, 166, 87, 0.18),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            #fffaf4 0%,
            #fdf4eb 100%
        );
    min-height: 100vh;
}

.page-shell {
    min-height: 100vh;
    padding: 28px 14px;
}

/* =========================
   CARTE PRINCIPALE
========================= */

.card {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    overflow: hidden;

    background: rgba(255, 255, 255, 0.97);

    border: 1px solid rgba(74, 52, 43, 0.08);
    border-radius: 28px;

    box-shadow:
        0 20px 55px rgba(74, 52, 43, 0.14),
        0 4px 12px rgba(74, 52, 43, 0.05);
}

.card::before {
    content: "";
    position: absolute;
    top: -90px;
    right: -90px;

    width: 220px;
    height: 220px;

    background: rgba(113, 196, 211, 0.12);
    border-radius: 50%;

    pointer-events: none;
}

.card::after {
    content: "";
    position: absolute;
    bottom: -110px;
    left: -100px;

    width: 250px;
    height: 250px;

    background: rgba(243, 166, 87, 0.1);
    border-radius: 50%;

    pointer-events: none;
}

/* =========================
   EN-TÊTE ET LOGO
========================= */

.brand {
    position: relative;
    z-index: 1;

    display: flex;
    gap: 22px;
    align-items: center;

    margin-bottom: 26px;
}

.logo {
    width: 150px;
    max-width: 32%;
    height: auto;

    object-fit: contain;
    flex-shrink: 0;

    filter: drop-shadow(0 5px 8px rgba(74, 52, 43, 0.12));
}

.eyebrow {
    margin: 0 0 4px;

    color: var(--orange-dark);

    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.15em;
}

h1 {
    margin: 3px 0 6px;

    color: var(--brown);

    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.08;
}

h2 {
    position: relative;

    margin-top: 0;
    margin-bottom: 24px;
    padding-bottom: 12px;

    color: var(--brown);

    font-size: clamp(23px, 4vw, 31px);
    line-height: 1.2;
}

h2::after {
    content: "";

    position: absolute;
    bottom: 0;
    left: 0;

    width: 72px;
    height: 5px;

    background: linear-gradient(
        90deg,
        var(--orange),
        var(--blue)
    );

    border-radius: 999px;
}

p {
    color: var(--muted);
    line-height: 1.6;
}

/* =========================
   BARRE DE PROGRESSION
========================= */

.progress-wrap {
    position: relative;
    z-index: 1;

    margin: 20px 0 34px;
}

.progress-bar {
    height: 12px;

    overflow: hidden;

    background: var(--blue-light);
    border: 1px solid rgba(63, 150, 168, 0.12);
    border-radius: 999px;
}

.progress-bar span {
    display: block;

    width: 20%;
    height: 100%;

    background: linear-gradient(
        90deg,
        var(--orange),
        var(--blue)
    );

    border-radius: 999px;

    box-shadow: 0 2px 8px rgba(63, 150, 168, 0.25);

    transition: width 0.3s ease;
}

#progressText {
    margin: 9px 0 0;

    color: var(--brown-light);

    font-size: 14px;
    font-weight: 800;
    text-align: right;
}

/* =========================
   ÉTAPES
========================= */

.step {
    display: none;
    position: relative;
    z-index: 1;
}

.step.active {
    display: block;
    animation: fade 0.25s ease;
}

@keyframes fade {
    from {
        opacity: 0.3;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   GRILLES
========================= */

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* =========================
   CHAMPS
========================= */

label {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-bottom: 17px;

    color: var(--brown);

    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;

    padding: 14px 15px;

    color: var(--ink);

    background: var(--white);

    border: 1px solid var(--line);
    border-radius: 15px;

    font: inherit;

    box-shadow: inset 0 1px 2px rgba(74, 52, 43, 0.03);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(113, 196, 211, 0.75);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;

    border-color: var(--blue);

    box-shadow:
        0 0 0 4px rgba(113, 196, 211, 0.2),
        inset 0 1px 2px rgba(74, 52, 43, 0.03);
}

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

input::placeholder,
textarea::placeholder {
    color: #a7978e;
}

select {
    cursor: pointer;
}

/* =========================
   CASES À COCHER
========================= */

.check-line,
.check-card {
    flex-direction: row;
    align-items: center;
    gap: 12px;

    font-weight: 700;
}

.check-line input,
.check-card input {
    width: 19px;
    height: 19px;
    flex-shrink: 0;

    margin: 0;

    accent-color: var(--orange-dark);

    cursor: pointer;
}

.check-card {
    padding: 16px;

    background:
        linear-gradient(
            135deg,
            var(--orange-light),
            var(--soft)
        );

    border: 1px solid rgba(243, 166, 87, 0.3);
    border-radius: 16px;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.check-card:hover {
    transform: translateY(-1px);

    border-color: var(--orange);

    box-shadow: 0 5px 14px rgba(217, 120, 40, 0.1);
}

/* =========================
   DOCUMENTS
========================= */

.upload-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 15px;
}

.upload-grid label {
    min-height: 138px;

    justify-content: space-between;

    padding: 18px;

    background:
        linear-gradient(
            145deg,
            var(--blue-light),
            #ffffff
        );

    border: 2px dashed rgba(63, 150, 168, 0.6);
    border-radius: 18px;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.upload-grid label:hover {
    transform: translateY(-2px);

    border-color: var(--blue-dark);

    box-shadow: 0 8px 18px rgba(63, 150, 168, 0.12);
}

.upload-grid input[type="file"] {
    padding: 10px;

    background: rgba(255, 255, 255, 0.8);
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 9px 13px;

    color: var(--white);

    background: var(--blue-dark);

    border: 0;
    border-radius: 10px;

    font-weight: 800;

    cursor: pointer;
}

/* =========================
   ENCART D'INFORMATION
========================= */

.hint {
    margin-bottom: 20px;
    padding: 14px 16px;

    color: var(--brown);

    background:
        linear-gradient(
            90deg,
            var(--orange-light),
            #fffaf4
        );

    border-left: 5px solid var(--orange);
    border-radius: 12px;

    font-weight: 600;
}

/* =========================
   SIGNATURE
========================= */

.signature-box {
    margin-top: 24px;
    padding: 18px;

    background:
        linear-gradient(
            145deg,
            var(--blue-light),
            rgba(255, 255, 255, 0.9)
        );

    border: 1px solid rgba(63, 150, 168, 0.25);
    border-radius: 20px;

    box-shadow: 0 8px 20px rgba(63, 150, 168, 0.08);
}

.signature-box p {
    margin-top: 0;

    color: var(--brown);
}

canvas {
    width: 100%;
    height: 180px;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #fffcf8
        );

    border: 2px dashed rgba(74, 52, 43, 0.35);
    border-radius: 14px;

    touch-action: none;
}

/* =========================
   BOUTONS
========================= */

.actions {
    position: relative;
    z-index: 2;

    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin-top: 28px;
}

.btn {
    min-height: 50px;

    padding: 14px 22px;

    border: 0;
    border-radius: 15px;

    font-size: 16px;
    font-weight: 900;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn.primary {
    color: var(--white);

    background:
        linear-gradient(
            135deg,
            var(--orange),
            var(--orange-dark)
        );

    box-shadow: 0 7px 18px rgba(217, 120, 40, 0.25);
}

.btn.primary:hover {
    box-shadow: 0 10px 22px rgba(217, 120, 40, 0.32);
}

.btn.ghost {
    color: var(--brown);

    background:
        linear-gradient(
            135deg,
            var(--blue-light),
            #edf9fb
        );

    border: 1px solid rgba(63, 150, 168, 0.2);
}

.btn.ghost:hover {
    background: var(--blue-light);

    box-shadow: 0 7px 16px rgba(63, 150, 168, 0.15);
}

/* =========================
   MESSAGES
========================= */

.hidden {
    display: none;
}

.form-alert {
    min-height: 24px;
    margin-top: 12px;

    color: var(--danger);

    font-weight: 800;
}

/* =========================
   RESPONSIVE TABLETTE
========================= */

@media (max-width: 780px) {
    .logo {
        width: 125px;
    }

    .card {
        padding: 24px 20px;
    }
}

/* =========================
   RESPONSIVE MOBILE
========================= */

@media (max-width: 680px) {
    .page-shell {
        padding: 12px 8px;
    }

    .card {
        padding: 20px 15px;

        border-radius: 20px;
    }

    .brand {
        flex-direction: column;
        align-items: center;

        gap: 12px;

        text-align: center;
    }

    .logo {
        width: 180px;
        max-width: 75%;
    }

    .eyebrow {
        text-align: center;
    }

    h1 {
        font-size: 31px;
    }

    h2 {
        font-size: 24px;
    }

    h2::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .grid.two,
    .upload-grid {
        grid-template-columns: 1fr;
    }

    .upload-grid label {
        min-height: auto;
    }

    .actions {
        position: sticky;
        bottom: 0;

        margin: 24px -5px -8px;
        padding: 12px 5px 8px;

        background: rgba(255, 255, 255, 0.96);

        border-top: 1px solid rgba(74, 52, 43, 0.08);

        backdrop-filter: blur(8px);
    }

    .btn {
        flex: 1;
        padding: 13px 12px;
    }

    canvas {
        height: 160px;
    }
}

/* =========================
   PETITS ÉCRANS
========================= */

@media (max-width: 390px) {
    .logo {
        width: 155px;
    }

    .card {
        padding: 18px 13px;
    }

    .actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }
}