/* =============================================
   ANPEC — Design System v2
   ============================================= */
:root {
    --blue:      #1a65ad;
    --blue-d:    #0d4e8a;
    --blue-l:    #e8f2fb;
    --accent:    #e8973a;
    --bg:        #edf3f9;
    --surface:   #ffffff;
    --border:    #cddcea;
    --text:      #0f2236;
    --muted:     #607d96;
    --r:         20px;
}

/* ── Page ─────────────────────────────────── */
.anpec-body {
    font-family: 'Manrope', system-ui, sans-serif;
    color: var(--text);
    min-height: 100vh;
    background: var(--bg);
    /* Grille pointillée subtile */
    background-image:
        radial-gradient(circle, rgba(26,101,173,.09) 1px, transparent 1px),
        linear-gradient(160deg, #d6e9f6 0%, #eaf3fb 45%, #ddeaf5 100%);
    background-size: 28px 28px, 100% 100%;
}

.anpec-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

/* ── Card ─────────────────────────────────── */
.anpec-card {
    width: 100%;
    max-width: 640px;
    background: var(--surface);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0,0,0,.04),
        0 4px 12px rgba(0,0,0,.07),
        0 24px 56px rgba(13,78,138,.12);
    position: relative;
}

/* Barre d'accent colorée en haut */
.anpec-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-d) 0%, var(--blue) 55%, #5ab0f0 100%);
}

/* ── Card header ─────────────────────────── */
.anpec-card__header {
    padding: 1.75rem 2.25rem 1.5rem;
    border-bottom: 1px solid #ecf2f8;
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
}

.anpec-logo-wrap {
    flex-shrink: 0;
    margin-top: 2px;
}

.anpec-logo-wrap img {
    height: 56px;
    width: auto;
    display: block;
}

.anpec-header-text {
    flex: 1;
    min-width: 0;
}

.anpec-card__eyebrow {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--blue);
    margin: 0 0 .35rem;
}

.anpec-card__title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 .3rem;
    line-height: 1.2;
}

.anpec-card__sub {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

/* ── Flash messages ──────────────────────── */
.anpec-flash {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 2.25rem;
    font-size: .88rem;
    font-weight: 600;
}

.anpec-flash--success {
    background: #edf9f2;
    color: #155e38;
    border-bottom: 1px solid #b7e8cc;
}

.anpec-flash--error {
    background: #fef2f2;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
}

.anpec-flash__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-size: .75rem;
    font-weight: 900;
    margin-top: 1px;
}

.anpec-flash--success .anpec-flash__icon { background: #155e38; color: #fff; }
.anpec-flash--error .anpec-flash__icon { background: #991b1b; color: #fff; }

/* ── Card body ───────────────────────────── */
.anpec-card__body {
    padding: 2rem 2.25rem 2.25rem;
}

/* ── Section label ───────────────────────── */
.anpec-section-label {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 1.1rem;
}

.anpec-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e3ecf4;
}

/* ── Form grid ───────────────────────────── */
.anpec-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.2rem;
}

.anpec-col-full { grid-column: 1 / -1; }

/* ── Input overrides ─────────────────────── */
.anpec-card__body .form-label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .3rem;
}

.anpec-card__body .form-control {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: .65rem 1rem;
    font-size: .95rem;
    font-weight: 500;
    color: var(--text);
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
    font-family: inherit;
}

.anpec-card__body .form-control::placeholder {
    color: #b8ccde;
    font-weight: 400;
}

.anpec-card__body .form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,101,173,.12);
    outline: none;
}

.anpec-card__body .form-control.is-invalid {
    border-color: #ef4444;
}

.anpec-card__body .invalid-feedback {
    font-size: .78rem;
    margin-top: .25rem;
}

/* ── Séparateur ──────────────────────────── */
.anpec-divider {
    border: none;
    border-top: 1px solid #ecf2f8;
    margin: 1.75rem 0 1.5rem;
}

/* ── Hébergement — cartes de choix ──────── */
.anpec-choices {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: .75rem !important;
    margin-top: .75rem;
}

.anpec-choices .form-check {
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

/* Cacher le radio natif mais le garder fonctionnel */
.anpec-choices .form-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.anpec-choices .form-check-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 1.1rem .75rem;
    border: 2px solid #dce8f2;
    border-radius: 14px;
    background: #f6f9fd;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    transition: border-color .18s, background .18s, color .18s, box-shadow .18s;
    text-align: center;
    min-height: 90px;
    user-select: none;
    line-height: 1.3;
}

/* Icônes via pseudo-élément */
.anpec-choices .form-check:nth-child(1) .form-check-label::before {
    content: '🏨';
    font-size: 1.7rem;
    line-height: 1;
}

.anpec-choices .form-check:nth-child(2) .form-check-label::before {
    content: '🏠';
    font-size: 1.7rem;
    line-height: 1;
}

.anpec-choices .form-check-label:hover {
    border-color: var(--blue);
    background: var(--blue-l);
    color: var(--blue-d);
}

.anpec-choices .form-check-input:checked + .form-check-label {
    border-color: var(--blue);
    background: var(--blue-l);
    color: var(--blue-d);
    box-shadow: inset 0 0 0 1px var(--blue);
}

/* ── Bouton ──────────────────────────────── */
.anpec-btn {
    display: block;
    width: 100%;
    padding: .9rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: #fff !important;
    background: linear-gradient(135deg, var(--blue-d) 0%, var(--blue) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26,101,173,.3);
    transition: transform .15s, box-shadow .15s, opacity .15s;
    margin-top: 1.75rem;
}

.anpec-btn:hover {
    opacity: .93;
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(26,101,173,.4);
}

.anpec-btn:active {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26,101,173,.25);
}

/* ── Card footer ─────────────────────────── */
.anpec-card__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1rem 2.25rem;
    background: #f6f9fd;
    border-top: 1px solid #ecf2f8;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 500;
}

/* ── Tablette (≤ 768px) ──────────────────── */
@media (max-width: 768px) {
    .anpec-page { padding: 2rem 1rem; }

    .anpec-card__header { padding: 1.5rem 1.75rem 1.25rem; }

    .anpec-card__body { padding: 1.75rem; }

    .anpec-flash { padding: .85rem 1.75rem; }
    .anpec-card__footer { padding: .85rem 1.75rem; }
}

/* ── Mobile (≤ 520px) ────────────────────── */
@media (max-width: 520px) {
    .anpec-page { padding: 0; align-items: flex-start; }

    .anpec-card {
        border-radius: 0;
        box-shadow: none;
        min-height: 100dvh;
    }

    .anpec-card__header {
        flex-direction: column;
        gap: .9rem;
        padding: 1.25rem 1.25rem 1rem;
    }

    .anpec-logo-wrap img { height: 44px; }

    .anpec-card__title { font-size: 1.2rem; }

    .anpec-card__body { padding: 1.25rem; }

    .anpec-form-grid { grid-template-columns: 1fr; }
    .anpec-col-full { grid-column: auto; }

    /* Cibles tactiles confortables */
    .anpec-card__body .form-control { padding: .75rem 1rem; font-size: 1rem; }
    .anpec-btn { padding: 1rem 1.5rem; font-size: 1rem; margin-top: 1.25rem; }

    .anpec-flash { padding: .85rem 1.25rem; }
    .anpec-card__footer { padding: .85rem 1.25rem; flex-direction: column; text-align: center; gap: .35rem; }
}
