:root {
    --blue-france: #000091;
    --blue-france-hover: #1212ff;
    --red-marianne: #e1000f;
    --grey-50: #f6f6f6;
    --grey-100: #eeeeee;
    --grey-200: #e5e5e5;
    --grey-500: #6a6a6a;
    --grey-900: #161616;
    --green-success: #18753c;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    --radius: 6px;
    --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--grey-50);
    color: var(--grey-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--grey-200);
}
.site-header__inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.site-header__logo { height: 44px; width: auto; }
.site-header__flag {
    height: 32px;
    width: auto;
    border: 1px solid var(--grey-200);
    border-radius: 2px;
    box-shadow: var(--shadow);
}
.site-header__name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue-france);
}
.site-header__service {
    margin: 0;
    font-size: 0.85rem;
    color: var(--grey-500);
}

/* ── Layout ── */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.main-content {
    flex: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2rem;
    width: 100%;
}

/* ── Hero ── */
.hero-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.hero-card__icon img,
.hero-card__flag {
    width: 48px;
    height: auto;
    border: 1px solid var(--grey-200);
    border-radius: 2px;
    box-shadow: var(--shadow);
}
.hero-card__tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--blue-france);
    background: #eeeefb;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    margin-bottom: 0.4rem;
}
.hero-card h1 {
    margin: 0 0 0.4rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue-france);
}
.hero-card__desc {
    margin: 0;
    color: var(--grey-500);
    font-size: 0.95rem;
}

/* ── Trust strip ── */
.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--grey-500);
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: 20px;
    padding: 0.35rem 0.75rem;
}
.trust-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--blue-france);
    opacity: 0.85;
}
.trust-icon--lock {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.trust-icon--school {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm5 8.18L12 15 7 11.18V9.3l5 2.7 5-2.7v1.88z'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm5 8.18L12 15 7 11.18V9.3l5 2.7 5-2.7v1.88z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.trust-icon--check {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Form card ── */
.form-card {
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.form-card__header {
    background: var(--blue-france);
    color: #fff;
    padding: 1.1rem 1.5rem;
}
.form-card__header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 700;
}
.form-card__header p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.85;
}
.form { padding: 1.5rem; }
.form-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grey-500);
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--grey-100);
}
.form-section-label:not(:first-child) { margin-top: 1.25rem; }

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 500px) {
    .input-group { grid-template-columns: 1fr; }
    .hero-card { flex-direction: column; }
}

.input { margin-bottom: 1rem; position: relative; }
.input label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--grey-900);
}
.label-with-address {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.establishment-address {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--grey-500);
    text-align: right;
    max-width: 55%;
}
.field-hint {
    font-size: 0.75rem;
    color: var(--grey-500);
    margin: 0.35rem 0 0;
}

.input input,
.input select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: var(--font);
    font-size: 1rem;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    background: #fff;
    color: var(--grey-900);
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}
.input select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236a6a6a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2rem;
    cursor: pointer;
}
.input input:focus,
.input select:focus {
    outline: none;
    border-color: var(--blue-france);
    box-shadow: 0 0 0 2px rgba(0,0,145,.15);
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    margin-top: 0.5rem;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--blue-france);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--blue-france-hover); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary__icon { font-size: 1.1rem; }

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.75rem;
    color: var(--grey-500);
    border-top: 1px solid var(--grey-200);
    background: #fff;
}
.site-footer p { margin: 0; }

/* ── Autocomplete ── */
.autocomplete-items {
    border: 1px solid var(--grey-200);
    z-index: 200;
    position: absolute;
    max-height: 280px;
    overflow-y: auto;
    top: calc(100% + 2px);
    left: 0;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius) var(--radius);
    background: #fff;
}
.autocomplete-items div {
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--grey-100);
    line-height: 1.35;
    font-size: 0.9rem;
}
.autocomplete-items div:hover,
.autocomplete-active {
    background: #eeeefb !important;
}

/* ── Modal ── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    padding: 1rem;
}
.modal-content {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    margin: 2rem auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.35s ease;
    overflow: hidden;
}
@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}
.close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--grey-500);
    cursor: pointer;
    z-index: 10;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.close:hover { background: var(--grey-100); color: var(--grey-900); }

.modal-phase { padding: 2rem 1.75rem 1.75rem; }

.modal-header-simple {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--grey-100);
}
.modal-header-simple .modal-official-sub {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grey-500);
}
.modal-header-simple h2 {
    margin: 0.15rem 0 0;
    font-size: 1.25rem;
    color: var(--blue-france);
}

.modal-official-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--grey-100);
}
.modal-official-header img { height: 48px; }
.modal-official-sub {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grey-500);
}
.modal-official-header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.25rem;
    color: var(--blue-france);
}

/* Loader */
.loader-ring {
    width: 56px;
    height: 56px;
    border: 4px solid var(--grey-100);
    border-top-color: var(--blue-france);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1.25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-track {
    height: 4px;
    background: var(--grey-100);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--blue-france), #4a4aff);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.search-steps {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}
.search-step {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.45rem 0;
    font-size: 0.85rem;
    color: var(--grey-500);
    transition: color 0.3s;
}
.step-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--grey-200);
    margin-top: 0.3rem;
    transition: background 0.3s;
}
.search-step--active { color: var(--grey-900); font-weight: 600; }
.search-step--active .step-dot {
    background: var(--blue-france);
    animation: pulse 1s infinite;
}
.search-step--done { color: var(--green-success); }
.search-step--done .step-dot { background: var(--green-success); }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,145,.4); }
    50% { box-shadow: 0 0 0 4px rgba(0,0,145,0); }
}
.search-status {
    font-size: 0.82rem;
    color: var(--grey-500);
    text-align: center;
    margin: 0;
    min-height: 1.2em;
}

/* Found phase */
.found-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #e8f5ed;
    color: var(--green-success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.found-title {
    text-align: center;
    font-size: 1.35rem;
    color: var(--green-success);
    margin: 0 0 0.5rem;
}
.found-desc {
    text-align: center;
    color: var(--grey-500);
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
}
.found-summary {
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    padding: 0.25rem 0;
    margin-bottom: 1rem;
}
.found-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--grey-100);
    font-size: 0.88rem;
    gap: 1rem;
}
.found-row:last-child { border-bottom: none; }
.found-label { color: var(--grey-500); font-weight: 600; flex-shrink: 0; }
.found-value { text-align: right; font-weight: 600; }
.found-status { color: var(--green-success); }
.found-note {
    font-size: 0.8rem;
    color: var(--grey-500);
    text-align: center;
    margin: 0 0 1.25rem;
}

/* Verification + table */
.verify-box {
    background: #eeeefb;
    border: 1px solid #c5c5f0;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    text-align: center;
}
.verify-box p {
    margin: 0 0 0.85rem;
    font-size: 0.88rem;
    color: var(--grey-900);
}
.btn-verify {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--blue-france);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.btn-verify:hover { background: var(--blue-france-hover); }

.results-table-wrap h3 {
    font-size: 0.95rem;
    color: var(--grey-900);
    margin: 0 0 0.75rem;
    font-weight: 700;
}

table { width: 100%; border-collapse: collapse; }
table * {
    -webkit-user-select: none;
    user-select: none;
}
th, td {
    border: 1px solid var(--grey-200);
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
}
th {
    background: var(--grey-50);
    font-weight: 700;
    color: var(--grey-900);
    text-align: left;
}
.highlight {
    background: var(--blue-france) !important;
    color: #fff !important;
    font-weight: 700;
}
.blurred {
    filter: blur(6px);
    -webkit-filter: blur(6px);
}
td:first-child { text-transform: uppercase; }
td:last-child { text-transform: capitalize; }

/* Notifications */
#notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    z-index: 500;
}
.notification {
    background: #fff;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--blue-france);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Override legacy main.css conflicts */
.banner, .text, .formm { all: unset; }