:root {
    --bg: #eaf6ff;
    --panel: rgba(247, 252, 255, 0.92);
    --panel-blue: rgba(232, 244, 255, 0.92);
    --text: #142033;
    --muted: #526b88;
    --primary: #1565c0;
    --primary-dark: #0d47a1;
    --danger: #a92525;
    --border: #b9d7f6;
    --soft: #d9ecff;
    --green: #00b050;
    --shadow: 0 20px 50px rgba(16, 72, 140, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 0% 8%, rgba(134, 195, 255, 0.48) 0, rgba(209, 234, 255, 0.36) 34%, transparent 58%),
        linear-gradient(105deg, #c7e4ff 0%, #dceeff 28%, #ebf7ff 64%, #f7fcff 100%);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(232, 244, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(21, 101, 192, 0.24);
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a,
.small-btn,
.lang-btn {
    border: 1px solid var(--border);
    background: rgba(247, 252, 255, 0.86);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
}

.lang-btn.active,
.small-btn.active {
    background: var(--soft);
    border-color: #9ec5fe;
    color: var(--primary-dark);
    font-weight: 700;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
}

.container::before {
    content: "";
    position: fixed;
    inset: 0 auto 0 0;
    width: min(28vw, 360px);
    pointer-events: none;
    background: linear-gradient(90deg, rgba(80, 165, 245, 0.14), rgba(80, 165, 245, 0));
    z-index: 0;
    opacity: 0.65;
}

.container > * {
    position: relative;
    z-index: 1;
}

.narrow {
    max-width: 760px;
}

.hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    align-items: stretch;
    margin-top: 28px;
}

.hero-card,
.panel,
.info-panel,
.feature {
    background: linear-gradient(145deg, rgba(247, 252, 255, 0.94) 0%, rgba(232, 244, 255, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 48px;
}

.hero h1,
.panel h1,
.dashboard-head h1 {
    font-size: clamp(34px, 6vw, 62px);
    line-height: 0.96;
    margin: 16px 0;
    letter-spacing: -0.06em;
}

.hero p {
    font-size: 19px;
    color: var(--muted);
    max-width: 680px;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 13px;
}

.hero-actions,
.actions,
.card-actions,
.connection-header {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: rgba(247, 252, 255, 0.9);
    color: var(--text);
    border-radius: 14px;
    min-height: 42px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    color: #fff;
    border-color: var(--danger);
    background: var(--danger);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.feature {
    padding: 28px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature strong {
    font-size: 42px;
    color: var(--primary);
}

.feature span {
    color: var(--muted);
    font-weight: 700;
}

.info-panel,
.panel {
    padding: 26px;
    margin: 24px 0;
}

.muted {
    color: var(--muted);
}

.form {
    display: grid;
    gap: 18px;
}

.form label,
fieldset {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(250, 253, 255, 0.92);
    color: var(--text);
    padding: 13px 14px;
    font: inherit;
}

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

.form-row,
.filters-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.filters-form {
    grid-template-columns: auto 160px 160px auto;
    align-items: center;
}

fieldset {
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 18px;
}

legend {
    padding: 0 8px;
}

.checks-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.check-card,
.check-inline {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    font-weight: 600 !important;
}

.check-card input,
.check-inline input {
    width: auto;
}

.alert {
    border: 1px solid #f3d492;
    background: #fff8e5;
    border-radius: 18px;
    padding: 14px 16px;
    margin: 16px 0;
}

.alert-error {
    border-color: #ffc4c4;
    background: #fff0f0;
    color: #8a1f1f;
}

.dashboard-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.profile-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(247, 252, 255, 0.95) 0%, rgba(226, 242, 255, 0.9) 100%);
    display: grid;
    gap: 16px;
}

.profile-top {
    display: flex;
    gap: 14px;
    align-items: center;
}

.avatar {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--primary);
    font-weight: 900;
    font-size: 24px;
}

.profile-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.age-pill {
    background: rgba(247, 252, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 800;
}

.green-dot {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(0, 176, 80, 0.16), 0 0 24px rgba(0, 176, 80, 0.55);
    display: inline-block;
}

.status-text {
    color: var(--green);
    font-weight: 800;
    font-size: 13px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: var(--soft);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 700;
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: var(--muted);
    background: rgba(232, 244, 255, 0.8);
}

.connection-header {
    justify-content: space-between;
    align-items: flex-start;
}

.mini-chat {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(232, 244, 255, 0.86);
    padding: 18px;
    margin-top: 18px;
}

.messages {
    display: grid;
    gap: 10px;
    margin: 18px 0;
    max-height: 280px;
    overflow: auto;
}

.message-bubble {
    max-width: 78%;
    border: 1px solid var(--border);
    background: rgba(247, 252, 255, 0.92);
    border-radius: 18px 18px 18px 6px;
    padding: 12px;
}

.message-bubble.mine {
    justify-self: end;
    background: var(--soft);
    border-radius: 18px 18px 6px 18px;
}

.message-bubble p {
    margin: 6px 0 0;
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.blocked-list {
    display: grid;
    gap: 12px;
}

.blocked-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
}

.call-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(36, 24, 38, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.call-overlay.hidden {
    display: none;
}

.call-modal {
    width: min(520px, 100%);
    background: linear-gradient(145deg, rgba(247, 252, 255, 0.98), rgba(232, 244, 255, 0.96));
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.call-modal .green-dot {
    width: 38px;
    height: 38px;
    margin: 12px auto;
}

.footer {
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 900px) {
    .hero,
    .profiles-grid {
        grid-template-columns: 1fr;
    }
    .checks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .filters-form,
    .form-row,
    .chat-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
    }
    .hero-card {
        padding: 30px;
    }
    .feature-grid,
    .checks-grid {
        grid-template-columns: 1fr;
    }
    .blocked-row,
    .connection-header {
        align-items: stretch;
        flex-direction: column;
    }
}

.selfie-box {
    border: 1px solid rgba(21, 101, 192, 0.22);
    background: rgba(230, 240, 255, 0.75);
}

.selfie-box input[type="file"] {
    padding: 12px;
    background: rgba(247, 252, 255, 0.92);
    border: 1px dashed var(--border);
    border-radius: 14px;
}

.privacy-inline,
.verify-line {
    border-left: 4px solid rgba(55, 148, 89, 0.55);
    background: rgba(55, 148, 89, 0.08);
    border-radius: 12px;
    color: var(--text);
    padding: 10px 12px;
}

.small-note {
    font-size: 13px;
}

/* Pages RGPD / sécurité */
.privacy-banner {
    border-color: #9ec5fe;
    background: linear-gradient(135deg, rgba(245, 251, 255, 0.95), rgba(224, 240, 255, 0.92));
}

.legal-page h1,
.legal-page h2 {
    letter-spacing: -0.03em;
}

.legal-page h2 {
    margin-top: 28px;
}

.legal-page li {
    margin: 8px 0;
}

.legal-note {
    border: 1px solid var(--border);
    background: #f2f8ff;
    border-radius: 18px;
    padding: 16px;
    margin: 16px 0;
}

.verify-line.warning {
    color: #8a5a00;
}

.alert-success {
    border-color: #8bd19a;
    background: #ecfff0;
    color: #145c22;
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(247, 252, 255, 0.92);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.admin-table th {
    background: var(--soft);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.inline-form {
    display: inline-flex;
    margin: 4px 4px 4px 0;
}

.narrow-form {
    max-width: 520px;
}

code {
    background: #eef4ff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px 6px;
}

@media (max-width: 760px) {
    .legal-grid {
        grid-template-columns: 1fr;
    }
}


/* Mission sociale du site */
.mission-banner {
    border-color: #9ec5fe;
    background: linear-gradient(135deg, rgba(245, 251, 255, 0.95), rgba(224, 240, 255, 0.92));
}

.mission-banner h2,
.mission-page h1,
.mission-page h2 {
    letter-spacing: -0.03em;
}

.mission-page .lead {
    font-size: 20px;
    color: var(--muted);
}

.mission-note {
    border-color: #9ec5fe;
    background: #f3f8ff;
}

.mission-inline {
    display: inline-block;
    border: 1px solid #9ec5fe;
    background: #f3f8ff;
    border-radius: 14px;
    padding: 10px 12px;
    font-weight: 700;
}

.country-cards,
.presentation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.country-card,
.legal-note {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(239, 249, 255, 0.94), rgba(221, 239, 255, 0.88));
}

.country-card h3,
.legal-note h3 {
    margin: 8px 0;
}

.country-code {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(21, 101, 192, 0.22);
}

.country-belgium,
.country-france,
.country-germany {
    min-height: 220px;
    display: grid;
    align-content: start;
    gap: 10px;
}

.country-page-hero .hero-card {
    background: linear-gradient(145deg, rgba(235, 247, 255, 0.96), rgba(212, 234, 255, 0.9));
}

.country-zone-box {
    background: rgba(232, 244, 255, 0.62);
}

.hidden-zone {
    display: none !important;
}

.zone-list,
.department-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

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

.zone-chip {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(247, 252, 255, 0.86);
    padding: 10px 12px;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.zone-chip:hover,
.zone-chip:focus-visible {
    background: rgba(232, 244, 255, 0.98);
    box-shadow: 0 12px 26px rgba(16, 72, 140, 0.14);
    transform: translateY(-2px);
    outline: none;
}

.department-chip {
    border-radius: 14px;
    font-size: 13px;
}

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

@media (max-width: 900px) {
    .country-cards,
    .presentation-grid,
    .zone-list,
    .department-grid,
    .overseas-grid {
        grid-template-columns: 1fr;
    }
}


/* Page de sélection des pays */
.country-selector-page .hero-card h1 {
    max-width: 820px;
}

.country-selector-hero .feature strong {
    letter-spacing: 0.02em;
}

.country-cards-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.country-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.country-card-pending {
    opacity: 0.92;
    border-style: dashed;
}

.country-card-pending .country-code,
.country-strip .pending {
    filter: saturate(0.7);
}

.compact-country-panel .country-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.country-strip a {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(145deg, rgba(239, 249, 255, 0.94), rgba(221, 239, 255, 0.88));
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 88px;
}

.country-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
}

.country-strip span {
    color: var(--muted);
    font-weight: 700;
}

.country-language-panel {
    background: linear-gradient(145deg, rgba(229, 244, 255, 0.96), rgba(210, 233, 255, 0.92));
}

@media (max-width: 1100px) {
    .country-cards-wide,
    .compact-country-panel .country-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .country-cards-wide,
    .compact-country-panel .country-strip {
        grid-template-columns: 1fr;
    }
}


/* Amélioration sécurité : les actions sensibles sont envoyées en POST. */
.inline-form {
    display: inline-flex;
    margin: 0;
}
.inline-form button {
    font: inherit;
}
.card-actions .inline-form,
.actions .inline-form {
    display: inline-flex;
}


/* Version sans chat : affichage local et temporaire des coordonnées déjà chargées. */
.contact-reveal-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(244, 252, 248, 0.96);
    box-shadow: 0 12px 26px rgba(9, 121, 72, 0.08);
}
.contact-reveal-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    color: var(--primary-dark);
}
.contact-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.contact-line:first-of-type {
    border-top: 0;
}
.contact-line a {
    font-weight: 800;
    word-break: break-all;
}
.small {
    font-size: 13px;
}


/* Protection anti-robot légère : additions aléatoires + faux champs invisibles. */
.contact-guard-modal[hidden] {
    display: none !important;
}
.contact-guard-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(11, 31, 24, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.contact-guard-box {
    width: min(520px, 100%);
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.24);
    padding: 24px;
}
.contact-guard-box h2 {
    margin-top: 0;
}
.contact-guard-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 10px 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,0.72);
    font-weight: 800;
}
.contact-guard-question input {
    width: 120px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
}
.contact-guard-honeypot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.contact-guard-error {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 226, 226, 0.92);
    color: #8a1f1f;
    font-weight: 800;
}
.contact-limit-note {
    display: inline-block;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 246, 214, 0.92);
    color: #765300;
    font-weight: 800;
}
@media (max-width: 560px) {
    .contact-guard-question {
        align-items: stretch;
        flex-direction: column;
    }
    .contact-guard-question input {
        width: 100%;
    }
}
