/* ============================================================
   FORM — Formulaire de contact EiMDC
   /FORM/css/form.css
   ============================================================ */

:root {
    --fc-primary:    #007ABC;
    --fc-primary-h:  #903;
    --fc-text:       #222;
    --fc-muted:      #666;
    --fc-border:     #ddd;
    --fc-bg:         #f8f5f2;
    --fc-card:       #fff;
    --fc-radius:     12px;
    --fc-radius-sm:  6px;
    --fc-shadow:     0 0 8px inset rgba(0,0,0,0.5);
    --fc-trans:      .2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Proza Libre", 'Helvetica Neue', sans-serif;
    background: var(--fc-bg);
    color: var(--fc-text);
    line-height: 1.65;
    font-size: 16px;
}

/* ── Language bar ─────────────────────────────────────────────────────────── */
.lang-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 2px solid var(--fc-primary);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.school-name {
    font-family: 'Cormorant', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--fc-primary-h);
    letter-spacing: .01em;
    line-height: 0.95;
    text-shadow: 1px 1px 1px #fff;
}

/* ── Burger menu ──────────────────────────────────────────────────────────── */
.lang-menu { position: relative; flex-shrink: 0; }
.burger-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 1px solid var(--fc-border);
    border-radius: 99px;
    padding: 5px 14px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--fc-trans);
}
.burger-btn:hover { border-color: var(--fc-primary); }
.lang-current {
    font-size: .85rem;
    font-weight: 700;
    color: var(--fc-primary);
}
.burger-icon {
    font-size: 1rem;
    color: var(--fc-muted);
    line-height: 1;
}
.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid var(--fc-border);
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.14);
    min-width: 200px;
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}
.lang-dropdown.open { display: flex; }
.lang-btn {
    display: block;
    background: none;
    border: none;
    border-bottom: 1px solid var(--fc-border);
    padding: 10px 18px;
    text-align: left;
    cursor: pointer;
    font-family: "Proza Libre", sans-serif;
    font-size: .92rem;
    color: var(--fc-text);
    transition: background var(--fc-trans);
    width: 100%;
}
.lang-btn:last-child { border-bottom: none; }
.lang-btn:hover { background: #f5f5f5; }
.lang-btn.active { color: var(--fc-primary); font-weight: 700; background: #f0f7ff; }

/* ── Contact card image ───────────────────────────────────────────────────── */
.contact-card-img {
    position: fixed;
    top: calc(var(--langbar-h, 18px) + 20px);
    left: 20px;
    width: 210px;
    z-index: 99;
    pointer-events: none;
    opacity: .92;
    filter: drop-shadow(2px 5px 14px rgba(0,0,0,.22));
}
@media (max-width: 780px) {
    .contact-card-img { display: none; }
}

/* ── Page header ──────────────────────────────────────────────────────────── */
.form-header {
    text-align: center;
    padding: 36px 20px 16px;
}
.form-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin: 0 0 -5px;
    color: var(--fc-primary);
    letter-spacing: -.01em;
}
.form-header .required-note {
    font-size: .84rem;
    color: var(--fc-muted);
    font-style: italic;
    margin: 0;
}

/* ── Layout wrapper ───────────────────────────────────────────────────────── */
.form-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* ── Z-index: form content above the fixed card image ────────────────────── */
.form-header,
.form-wrap,
.form-section,
.rgpd-block,
.form-global-error,
.submit-wrap,
.success-panel {
    position: relative;
    z-index: 1;
}

/* ── Section card ─────────────────────────────────────────────────────────── */
.form-section {
    background: var(--fc-card);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    padding: 24px;
    margin-bottom: 16px;
}
.form-section h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--fc-primary);
    padding-bottom: 10px;
    border-bottom: 1px solid #f0e0e0;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.form-section h2 .req { color: var(--fc-primary-h); font-size: .9em; }
.intro-text {
    font-size: .88rem;
    color: var(--fc-muted);
    margin: -6px 0 14px;
    font-style: italic;
}

/* ── Radio & Checkbox groups ──────────────────────────────────────────────── */
.radio-group,
.check-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.radio-label,
.check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: .94rem;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: var(--fc-radius-sm);
    border: 1px solid var(--fc-border);
    transition: var(--fc-trans);
    user-select: none;
}
.radio-label:hover,
.check-label:hover {
    border-color: var(--fc-primary);
    background:#effbde;
}
.radio-label.selected,
.check-label.checked {
    border-color: var(--fc-primary);
    background: #fef5f5;
}
.radio-label input,
.check-label input {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--fc-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── Field grid ───────────────────────────────────────────────────────────── */
.field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.field-group .field.full {
    grid-column: 1 / -1;
}
@media (max-width: 500px) {
    .field-group { grid-template-columns: 1fr; }
    .field-group .field.full { grid-column: auto; }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.field label {
    font-size: .84rem;
    font-weight: 600;
    color: var(--fc-text);
}
.field label .req {
    color: var(--fc-primary-h);
    margin-left: 1px;
    font-size: 1.2rem;
    line-height: 0;
}
.field input,
.field select,
.field textarea {
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-sm);
    padding: 9px 12px;
    font-family: inherit;
    font-size: .94rem;
    color: var(--fc-text);
    background: #fff;
    transition: var(--fc-trans);
    width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--fc-primary);
    box-shadow: 0 0 0 3px rgba(153,0,51,.10);
}
.field textarea {
    resize: vertical;
    min-height: 110px;
}
.field-error {
    font-size: .78rem;
    color: var(--fc-primary);
    display: none;
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
    border-color: var(--fc-primary);
}
.field.has-error .field-error {
    display: block;
}

/* ── Section-level error (radio groups) ───────────────────────────────────── */
.section-error {
    font-size: .8rem;
    color: var(--fc-primary);
    margin-top: 8px;
    display: none;
}
.section-error.visible { display: block; }

/* ── RGPD block ───────────────────────────────────────────────────────────── */
.rgpd-block {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.5;
    background: #e3f9da;
    border: 2px solid #6fab3e;
    border-radius: var(--fc-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 1px 1px 7px #0000005e;
}
.rgpd-block p { margin: 0 0 10px; }
.rgpd-block p:last-child { margin: 0; }
.rgpd-block a { color: var(--fc-primary-h); }
.rgpd-block ul {
    margin: 8px 0 0;
    padding-left: 0;
    list-style: none;
}
.rgpd-block ul li { padding: 2px 0; }
.rgpd-block ul li::before { content: "— "; color: var(--fc-primary); }

/* ── Global form error ────────────────────────────────────────────────────── */
.form-global-error {
    background: #ffe8e8;
    border: 1px solid #f0c0c0;
    border-radius: var(--fc-radius-sm);
    padding: 12px 16px;
    color: #900;
    font-size: .9rem;
    margin-bottom: 16px;
    display: none;
}
.form-global-error.visible { display: block; }

/* ── Submit button ────────────────────────────────────────────────────────── */
.submit-wrap { text-align: center; margin-bottom: 16px; }
.btn-submit {
    background: #418633;
    color: #fff;
    border: none;
    border-radius: 99px;
    padding: 14px 52px;
    font-size: 1.05rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: var(--fc-trans);
    letter-spacing: .02em;
    border: 2px solid #fff;
    text-transform: uppercase;
    letter-spacing: 5px;
}
.btn-submit:hover:not(:disabled) {
    background: var(--fc-primary-h);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(153,0,51,.28);
}
.btn-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* ── Success panel ────────────────────────────────────────────────────────── */
.success-panel {
    background: var(--fc-card);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    padding: 44px 28px;
    text-align: center;
    margin-bottom: 16px;
}
.success-icon {
    font-size: 3.2rem;
    margin-bottom: 16px;
    line-height: 1;
}
.success-panel h2 {
    color: var(--fc-primary);
    font-size: 1.6rem;
    margin: 0 0 14px;
}
.success-panel p {
    color: var(--fc-muted);
    margin: 0 0 10px;
    font-size: .95rem;
}
.resources-list {
    text-align: left;
    margin: 20px auto 0;
    max-width: 420px;
    list-style: none;
    padding: 0;
}
.resources-list li { padding: 3px 0; font-size: .9rem; }
.resources-list li::before { content: "— "; color: var(--fc-primary); }
.resources-list a { color: var(--fc-primary); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.form-footer {
    text-align: center;
    padding: 20px;
    font-size: .76rem;
    color: var(--fc-primary-h);
    border-top: 1px solid var(--fc-border);
}
