/* LAWAPAN École Pro v5.2.0 (web) — reçu de versement vérifiable et connexion par établissement. */

/* Connexion : code établissement */
.school-code-field input { text-transform: lowercase; letter-spacing: .02em; }
.school-code-field small { display: block; margin-top: 4px; font-weight: 400; }
.login-school-logo { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 0 8px; }

/* Reçu de versement : document papier (couleurs fixes, identiques à l'impression) */
.vr-wrap { display: flex; justify-content: center; overflow-x: auto; }
.versement-receipt {
  --vr-ink: #1b1d22; --vr-muted: #4b4f58; --vr-line: #c9ccd3; --vr-dark: #24272e;
  position: relative; width: 100%; max-width: 148mm; background: #fff; color: var(--vr-ink);
  font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 12.5px; line-height: 1.35;
  padding: 16px 20px 14px; border: 1px solid var(--vr-line); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.versement-receipt * { color: inherit; }
.vr-rule { height: 4px; background: var(--vr-dark); margin: 0 0 10px; }
.vr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.vr-school h2 { font-size: 17px; font-weight: 800; letter-spacing: .01em; margin: 0 0 2px; text-transform: uppercase; }
.vr-school p { margin: 0; color: var(--vr-muted); font-size: 12.5px; }
.vr-logo img { width: 58px; height: 58px; object-fit: contain; }
.vr-title { text-align: center; margin: 12px 0 4px; }
.vr-title span { display: inline-block; background: var(--vr-dark); color: #fff !important; font-weight: 700; letter-spacing: .16em; padding: 6px 18px; border-radius: 3px; font-size: 15px; }
.vr-number { text-align: center; margin: 2px 0 10px; font-size: 12.5px; }
.vr-number b { letter-spacing: .02em; }
.vr-table { width: 100%; border-collapse: collapse; }
.vr-table th, .vr-table td { text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--vr-line); vertical-align: top; }
.vr-table th { width: 34%; font-weight: 400; color: var(--vr-muted); }
.vr-table td b { font-weight: 700; }
.vr-table td small { display: block; font-size: 11px; color: var(--vr-muted); margin-top: 2px; }
.vr-reason { font-weight: 400; }
.vr-amount { border: 2px solid var(--vr-dark); border-radius: 5px; margin: 10px 0 6px; padding: 7px 14px; text-align: center; }
.vr-amount span { display: block; letter-spacing: .12em; font-size: 11.5px; color: var(--vr-muted); }
.vr-amount strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.vr-words { border: 1px solid var(--vr-line); border-radius: 5px; padding: 6px 12px; margin-bottom: 6px; }
.vr-words p { margin: 1px 0; }
.vr-nb { font-size: 11px; margin: 4px 0 6px 4px; color: var(--vr-muted); }
.vr-totals { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; margin: 6px 4px; }
.vr-totals dt { color: var(--vr-muted); }
.vr-totals dd { margin: 0; text-align: right; font-weight: 700; }
.vr-section { font-size: 13px; letter-spacing: .1em; font-weight: 600; margin: 10px 0 4px; }
.vr-situation { width: 100%; border-collapse: collapse; }
.vr-situation th { font-size: 11.5px; letter-spacing: .06em; text-align: left; border-bottom: 1px solid var(--vr-line); padding: 4px; }
.vr-situation th:not(:first-child), .vr-situation td:not(:first-child) { text-align: right; }
.vr-situation td { padding: 4px; border-bottom: 1px solid var(--vr-line); }
.vr-sign { text-align: right; font-weight: 700; font-style: italic; margin: 8px 0 10px; }
.vr-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-top: 1px solid var(--vr-line); padding-top: 8px; }
.vr-foot p { margin: 0; font-size: 11px; font-style: italic; color: var(--vr-muted); }
.vr-qr { width: 30mm; height: 30mm; flex: 0 0 auto; }
.vr-watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 64px; font-weight: 900; letter-spacing: .1em; color: rgba(180, 35, 24, .16) !important; transform: rotate(-24deg); }
.vr-verify-link { font-size: 12px; word-break: break-all; margin: 10px 0 0; }

@media (max-width: 520px) {
  .versement-receipt { padding: 12px; font-size: 12px; }
  .vr-amount strong { font-size: 19px; }
  .vr-qr { width: 26mm; height: 26mm; }
}

/* Impression : copie du reçu seule dans la page (#vrPrintArea), hors écran le temps de la mesurer. */
#vrPrintArea { position: fixed; left: -10000px; top: 0; width: 136mm; background: #fff; }
#vrPrintArea.vr-print-a4 { width: 140mm; }
#vrPrintArea .versement-receipt { position: relative !important; inset: auto !important; transform: none !important; width: 100% !important; max-width: none !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0; box-shadow: none !important; visibility: visible !important; }
#vrPrintArea .versement-receipt * { visibility: visible !important; }
/* Format A5 : dimensions compactes pour tenir sur une feuille de 148 × 210 mm. */
#vrPrintArea.vr-print-a5 .versement-receipt { font-size: 10.5px; line-height: 1.3; }
#vrPrintArea.vr-print-a5 .vr-rule { height: 3px; margin-bottom: 6px; }
#vrPrintArea.vr-print-a5 .vr-school h2 { font-size: 14px; }
#vrPrintArea.vr-print-a5 .vr-school p { font-size: 10.5px; }
#vrPrintArea.vr-print-a5 .vr-logo img { width: 44px; height: 44px; }
#vrPrintArea.vr-print-a5 .vr-title { margin: 6px 0 2px; }
#vrPrintArea.vr-print-a5 .vr-title span { font-size: 12.5px; padding: 4px 14px; }
#vrPrintArea.vr-print-a5 .vr-number { font-size: 10.5px; margin: 2px 0 5px; }
#vrPrintArea.vr-print-a5 .vr-table th, #vrPrintArea.vr-print-a5 .vr-table td { padding: 2.5px 3px; }
#vrPrintArea.vr-print-a5 .vr-table td small { font-size: 9.5px; }
#vrPrintArea.vr-print-a5 .vr-amount { margin: 6px 0 4px; padding: 4px 10px; }
#vrPrintArea.vr-print-a5 .vr-amount span { font-size: 9.5px; }
#vrPrintArea.vr-print-a5 .vr-amount strong { font-size: 17px; }
#vrPrintArea.vr-print-a5 .vr-words { padding: 4px 10px; margin-bottom: 4px; }
#vrPrintArea.vr-print-a5 .vr-nb { font-size: 9.5px; margin: 2px 0 4px 2px; }
#vrPrintArea.vr-print-a5 .vr-totals { margin: 4px 2px; }
#vrPrintArea.vr-print-a5 .vr-section { font-size: 11px; margin: 6px 0 2px; }
#vrPrintArea.vr-print-a5 .vr-situation th { font-size: 9.5px; padding: 2.5px 3px; }
#vrPrintArea.vr-print-a5 .vr-situation td { padding: 2.5px 3px; }
#vrPrintArea.vr-print-a5 .vr-sign { margin: 5px 0 6px; }
#vrPrintArea.vr-print-a5 .vr-foot { padding-top: 5px; }
#vrPrintArea.vr-print-a5 .vr-foot p { font-size: 9.5px; }
#vrPrintArea.vr-print-a5 .vr-qr { width: 24mm; height: 24mm; }
#vrPrintArea.vr-print-a5 .vr-watermark { font-size: 48px; }

@media print {
  html, body.vr-printing { height: auto !important; min-height: 0 !important; overflow: visible !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  /* Tout le reste est retiré de la mise en page (et pas seulement masqué) : plus de feuille blanche au début. */
  body.vr-printing > *:not(#vrPrintArea) { display: none !important; }
  body.vr-printing #vrPrintArea { display: block !important; position: static !important; left: auto; margin: 0 auto !important; visibility: visible !important; }
  body.vr-printing #vrPrintArea .versement-receipt { break-inside: avoid; page-break-inside: avoid; }
  body.vr-printing .vr-title span, body.vr-printing .vr-rule { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Impression « 2 par feuille » : A4 paysage = deux reçus A5 côte à côte (exemplaire administration / exemplaire élève). */
#vrPrintArea.vr-print-x2 { width: 284mm; }
#vrPrintArea .vr-x2-row { display: flex; width: 100%; }
#vrPrintArea .vr-x2-cell { flex: 0 0 50%; box-sizing: border-box; padding: 0 3mm; }
#vrPrintArea .vr-x2-cell + .vr-x2-cell { border-left: 1px dashed #777; }
#vrPrintArea .vr-copy-tag { text-align: center; font: 700 9.5px/1 Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #333; border: 1px solid #999; border-radius: 3px; padding: 3px 6px; margin: 0 0 3mm; }
@media print {
  body.vr-printing #vrPrintArea .vr-x2-row { break-inside: avoid; page-break-inside: avoid; }
}

/* Paramètres des reçus : caisses par utilisateur */
.vr-desks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; font-weight: 500; }
.vr-desk { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line, #dfe5e2); border-radius: 10px; padding: 6px 10px; }
.vr-desk small { display: block; color: var(--muted); font-weight: 500; }
.vr-desk input { width: 72px; text-align: center; }

/* SMS aux parents */
.sms-banner { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.sms-banner.warn { background: #fff4d6; color: #5c4200; }
.sms-banner.info { background: #e8f0fe; color: #1a3a78; }
.sms-pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #eef1f5; color: #3b4452; white-space: nowrap; }
.sms-pill.ok { background: #e3f4ea; color: #155c36; }
.sms-pill.info { background: #e8f0fe; color: #1a3a78; }
.sms-pill.warn { background: #fff4d6; color: #6b4d00; }
.sms-pill.bad { background: #fde7e6; color: #9b1c14; }
.sms-text { min-width: 240px; max-width: 460px; white-space: normal; }
.sms-error { color: #b42318; }
.sms-placeholders { display: flex; flex-wrap: wrap; gap: 6px; }
.sms-placeholders .chip { border: 1px solid var(--line, #dfe5e2); background: transparent; border-radius: 99px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: inherit; }
.sms-placeholders .chip:hover { background: rgba(0,0,0,.05); }
.field.check { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; font-weight: 600; }
.field.check input { width: auto; }
.sms-test { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line, #dfe5e2); }
.panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.button.small { padding: 5px 10px; font-size: 12px; }
@media (prefers-color-scheme: dark) {
  .sms-banner.warn, .sms-pill.warn { background: #3a2f10; color: #f3d27a; }
  .sms-banner.info, .sms-pill.info { background: #1d2842; color: #a9c1ff; }
  .sms-pill.ok { background: #12301f; color: #7fdca5; }
  .sms-pill.bad { background: #3a1614; color: #ff9c94; }
  .sms-pill { background: #262d38; color: #d5dbe4; }
}
#smsForm [hidden], #smsConfigForm [hidden], .sms-prov[hidden] { display: none !important; }
.sms-prov { display: contents; }
.sms-test { margin-top: 0; }
.sms-text { overflow-wrap: anywhere; word-break: break-word; }
