/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── VARIABLES ── */
:root {
  --navy: #1B2A4A; --navy-mid: #142038; --gold: #3ABFBF;
  --gold-light: #E8F8F8; --gold-border: #A0DFDF;
  --white: #FFFFFF; --surface: #F5F5F3; --border: #E2E2DF; --border-strong: #C8C8C4;
  --text-primary: #1B2A4A; --text-secondary: #5A5A6E; --text-tertiary: #9090A0;
  --blue-info: #1B2A4A; --blue-info-bg: #E8F8F8; --blue-info-border: #A0DFDF;
  --green-ok: #2D7D46; --green-ok-bg: #EAF5EE;
  --red-err: #C0392B; --red-err-bg: #FDECEC;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
}

/* ── BASE ── */
body { font-family: 'Inter', sans-serif; background: var(--surface); color: var(--text-primary); min-height: 100vh; display: flex; flex-direction: column; }

/* ── HEADER ── */
.header-accent { height: 4px; background: var(--gold); }
header { background: var(--white); padding: 0.85rem 2rem; display: flex; align-items: center; gap: 1.5rem; border-bottom: 1px solid var(--border); }
.header-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-logo img { height: 48px; width: auto; object-fit: contain; }
.logo-fallback { height: 32px; display: flex; align-items: center; gap: 9px; }
.logo-mark { width: 32px; height: 32px; border-radius: 6px; background: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--white); flex-shrink: 0; }
.logo-text { font-size: 15px; font-weight: 600; color: var(--navy); letter-spacing: 0.03em; }
.header-divider { width: 1px; height: 34px; background: var(--border); flex-shrink: 0; }
.header-titles { flex: 1; }
.header-title { font-size: 16px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.header-subtitle { font-size: 12.5px; color: var(--text-secondary); margin-top: 1px; }

/* ── LAYOUT ── */
main { flex: 1; display: flex; justify-content: center; padding: 2.5rem 1.5rem 4rem; }
.layout { width: 100%; max-width: 980px; display: grid; grid-template-columns: 320px 1fr; gap: 1.75rem; align-items: start; }

/* ── PANNEAU CONTEXTUEL ── */
.context-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; position: sticky; top: 2.5rem; }
.context-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--blue-info); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.context-title { font-size: 17px; font-weight: 700; color: var(--text-primary); line-height: 1.35; margin-bottom: 0.85rem; }
.context-body { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 1.1rem; }
.context-body strong { color: var(--text-primary); font-weight: 600; }
.context-deadline { display: flex; align-items: center; gap: 9px; background: var(--gold-light); border: 1px solid var(--gold-border); border-radius: var(--radius-md); padding: 0.7rem 0.85rem; margin-bottom: 1.1rem; }
.context-deadline svg { flex-shrink: 0; }
.context-deadline-text { font-size: 12.5px; color: #6B4A00; line-height: 1.4; }
.context-deadline-text strong { display: block; font-size: 13.5px; color: #5A3D00; }
.context-divider { border: none; border-top: 1px solid var(--border); margin: 1.1rem 0; }
.context-list { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.context-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.context-list li svg { flex-shrink: 0; margin-top: 2px; }
.context-list li strong { color: var(--text-primary); font-weight: 600; }

/* ── FORMULAIRE ── */
.form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem 2rem 2.25rem; }

/* ── PILLS & BADGES ── */
.siret-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--green-ok-bg); border: 1px solid #A8DDB8; border-radius: 20px; padding: 5px 13px; font-size: 12.5px; font-weight: 500; color: var(--green-ok); }
.siren-missing { display: inline-flex; align-items: center; gap: 7px; background: var(--red-err-bg); border: 1px solid #E8A09A; border-radius: 20px; padding: 5px 13px; font-size: 12.5px; font-weight: 500; color: var(--red-err); }
.badge { display: inline-block; font-size: 10px; font-weight: 500; border-radius: 4px; padding: 1px 6px; }
.badge-req { background: var(--green-ok-bg); color: var(--green-ok); }
.badge-opt { background: var(--gold-light); color: #6B4A00; border: 1px solid var(--gold-border); }

/* ── BLOC CORRECTION ── */
.correction-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-secondary); background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; margin-top: 6px; text-decoration: underline; text-underline-offset: 3px; }
.correction-toggle:hover { color: var(--text-primary); }
.correction-section { display: none; margin-top: 1rem; background: var(--gold-light); border: 1px solid var(--gold-border); border-radius: var(--radius-md); padding: 1rem 1.25rem 1.25rem; }
.correction-section.open { display: block; }
.correction-header { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 0.9rem; }
.correction-header svg { flex-shrink: 0; margin-top: 2px; }
.correction-header-text strong { display: block; font-size: 13px; font-weight: 600; color: #1B5A5A; margin-bottom: 2px; }
.correction-header-text p { font-size: 12px; color: #2A7070; line-height: 1.5; }
.correction-field label { display: block; font-size: 12px; font-weight: 500; color: #1B5A5A; margin-bottom: 5px; }
.correction-field input { width: 100%; padding: 8px 12px; border: 1px solid var(--gold-border); border-radius: var(--radius-sm); font-family: 'Courier New', monospace; font-size: 13.5px; color: var(--text-primary); background: var(--white); outline: none; box-sizing: border-box; }
.correction-comment label { display: block; font-size: 12px; font-weight: 500; color: #1B5A5A; margin-bottom: 5px; margin-top: 10px; }
.correction-comment textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--gold-border); border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; color: var(--text-primary); background: var(--white); resize: vertical; min-height: 60px; outline: none; box-sizing: border-box; }
.correction-err { font-size: 12px; color: var(--red-err); margin-top: 4px; display: none; }

/* ── TITRES ── */
.card-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 0.4rem; }
.card-subtitle { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1.5rem; }

/* ── CHAMPS ── */
.field-block { margin-bottom: 1.25rem; }
.field-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field-label label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.optional { font-size: 12px; color: var(--text-tertiary); }
input[type="text"], input[type="email"] { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; color: var(--text-primary); background: var(--white); outline: none; box-sizing: border-box; }
input[type="text"].mono { font-family: 'Courier New', monospace; }
.field-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 5px; line-height: 1.5; }
.primary-row { display: grid; grid-template-columns: 200px 1fr; gap: 12px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── BLOC INFO STRUCTURE ── */
.structure-hint { background: var(--blue-info-bg); border: 1px solid var(--blue-info-border); border-radius: var(--radius-md); padding: 0.75rem 1rem; margin-bottom: 1.5rem; display: flex; gap: 10px; align-items: flex-start; }
.structure-hint svg { flex-shrink: 0; margin-top: 2px; }
.structure-hint-text { font-size: 12.5px; color: #1A4A80; line-height: 1.55; }
.structure-hint-text strong { color: var(--blue-info); }
.structure-hint-text code { background: #CCE3F7; border-radius: 4px; padding: 1px 5px; font-family: 'Courier New', monospace; font-size: 11.5px; }
.structure-link { font-size: 12px; color: var(--blue-info); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; margin-top: 4px; display: inline-block; }
.structure-detail { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--blue-info-border); }
.structure-detail.open { display: block; }
.info-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.info-table th { text-align: left; color: var(--blue-info); font-weight: 600; padding: 3px 8px 5px; border-bottom: 1px solid var(--blue-info-border); }
.info-table td { padding: 4px 8px; color: #1A4A80; vertical-align: top; }
.info-table td code { font-family: 'Courier New', monospace; font-size: 11px; }
.info-table tr:not(:last-child) td { border-bottom: 1px solid #D8EAFB; }

/* ── ADRESSES SUPPLÉMENTAIRES ── */
.extra-section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 7px; }
.extra-hint { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; margin-bottom: 1rem; }
.extra-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.extra-row { display: grid; grid-template-columns: 170px 1fr 32px; gap: 8px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.85rem 0.85rem 0.5rem; }
.extra-row .col-label { font-size: 11px; font-weight: 500; color: var(--text-tertiary); margin-bottom: 4px; display: block; }
.extra-row input { font-family: 'Courier New', monospace; font-size: 13.5px; }
.btn-remove { width: 32px; height: 36px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); align-self: flex-end; }
.btn-remove:hover { background: var(--red-err-bg); border-color: #E8A09A; color: var(--red-err); }
.btn-add { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--blue-info); background: none; border: 1px dashed var(--blue-info-border); border-radius: var(--radius-sm); padding: 8px 16px; cursor: pointer; font-family: inherit; }
.btn-add:hover { background: var(--blue-info-bg); }

/* ── BOUTON SUBMIT ── */
.submit-block { margin-top: 1.75rem; }
.btn-submit { width: 100%; padding: 12px; background: var(--navy); color: var(--white); border: none; border-radius: var(--radius-md); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; position: relative; overflow: hidden; }
.btn-submit::after { content: ''; display: block; height: 3px; background: var(--gold); position: absolute; bottom: 0; left: 0; right: 0; }
.btn-submit:hover { background: var(--navy-mid); }

/* ── MESSAGES ── */
.server-error { background: var(--red-err-bg); border: 1px solid #E8A09A; border-radius: var(--radius-md); padding: 0.75rem 1rem; font-size: 13px; color: var(--red-err); margin-bottom: 1.25rem; }

/* ── SUCCÈS ── */
.success-screen { text-align: center; padding: 2.5rem 1rem; }
.success-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--green-ok-bg); border: 2px solid #A8DDB8; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem; }
.success-title { font-size: 19px; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.success-body { font-size: 14px; color: var(--text-secondary); line-height: 1.65; max-width: 400px; margin: 0 auto; }
.success-correction-note { margin: 1rem auto 0; max-width: 400px; background: var(--gold-light); border: 1px solid var(--gold-border); border-radius: var(--radius-md); padding: 0.75rem 1rem; font-size: 13px; color: #1B5A5A; line-height: 1.5; }

/* ── RECAPTCHA ── */
.grecaptcha-badge { visibility: hidden; }
.recaptcha-notice { font-size: 11px; color: var(--text-tertiary); margin-top: 1rem; line-height: 1.5; text-align: center; }
.recaptcha-notice a { color: var(--text-tertiary); }

/* ── BANDEAU CONTACT ── */
.contact-banner { background: var(--blue-info-bg); border-top: 1px solid var(--blue-info-border); padding: 0.85rem 2rem; text-align: center; font-size: 13px; color: var(--blue-info); }
.contact-banner a { color: var(--navy); font-weight: 600; text-decoration: none; }
.contact-banner a:hover { text-decoration: underline; }

/* ── FOOTER ── */
footer { background: var(--white); border-top: 1px solid var(--border); padding: 0.85rem 2rem; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); }
footer strong { color: var(--text-secondary); font-weight: 500; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .context-panel { position: static; }
}
@media (max-width: 640px) {
  header { padding: 0.75rem 1rem; }
  .header-divider { display: none; }
  .form-card, .context-panel { padding: 1.5rem 1.25rem; }
  main { padding: 1.5rem 0.75rem 3rem; }
  .primary-row { grid-template-columns: 1fr; }
  .extra-row { grid-template-columns: 1fr; }
}
