:root {
  --insa-red: #e2001a;
  --insa-maroon: #8e1537;
  --grey-bg: #f4f4f4;
  --grey-border: #dcdcdc;
  --text: #333;
  --text-soft: #555;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}

/* ---------- Barre supérieure ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--grey-border);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}
.social { display: flex; gap: 10px; }
.social-ico {
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--insa-maroon);
  color: #fff;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}
.lang { font-size: 13px; color: var(--text-soft); }

/* ---------- En-tête ---------- */
.site-header {
  border-bottom: 3px solid var(--insa-red);
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 64px; width: auto; display: block; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: bold;
  padding: 10px 14px;
}
.main-nav a.active,
.main-nav a:hover { color: var(--insa-maroon); border-bottom: 3px solid var(--insa-maroon); }

/* ---------- Bandeau de titre ---------- */
.page-banner { background: var(--insa-maroon); }
.banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 20px;
}
.page-banner h1 {
  margin: 0;
  color: #fff;
  font-size: 30px;
  letter-spacing: 1px;
}

/* ---------- Fil d'Ariane ---------- */
.breadcrumb { background: var(--grey-bg); border-bottom: 1px solid var(--grey-border); }
.breadcrumb-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-soft);
}
.breadcrumb-inner span { color: var(--insa-red); margin: 0 4px; }

/* ---------- Contenu ---------- */
.content-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}
.lead {
  color: var(--text);
  font-weight: bold;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
}
.section-title {
  color: var(--insa-red);
  font-size: 22px;
  margin: 0 0 24px;
}
.intro-box {
  background: var(--grey-bg);
  border: 1px solid var(--grey-border);
  padding: 16px 18px;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 34px;
}

/* ---------- Formulaire ---------- */
.field { margin-bottom: 26px; }
.field > label {
  display: block;
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 8px;
}
.req-star { color: var(--insa-red); }
.opt-tag { color: var(--text-soft); font-weight: normal; font-size: 13px; }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--grey-border);
  border-radius: 2px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--insa-red);
  box-shadow: 0 0 0 2px rgba(226, 0, 26, 0.12);
}
textarea { resize: vertical; }
.hint { display: block; color: var(--text-soft); font-size: 13px; margin-top: 6px; }

.phone-group { display: flex; }
.phone-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: var(--grey-bg);
  border: 1px solid var(--grey-border);
  border-right: none;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-soft);
}
.phone-group input { border-radius: 0 2px 2px 0; }

.options { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  font-size: 14px;
  cursor: pointer;
}
.opt input { accent-color: var(--insa-red); width: 16px; height: 16px; }

.submit-row { margin-top: 34px; }
.btn-submit {
  background: var(--insa-red);
  color: #fff;
  border: none;
  padding: 13px 40px;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.btn-submit:hover { background: #b80016; }
.btn-submit:disabled { background: #b0b0b0; cursor: default; }

.form-status {
  margin-top: 14px;
  font-size: 14px;
  font-weight: bold;
}
.form-status.success { color: #1a7f37; }
.form-status.error { color: var(--insa-red); }

/* ---------- Page de confirmation ---------- */
.confirmation {
  text-align: center;
  max-width: 460px;
  margin: 70px auto;
}
.confirmation-check {
  width: 52px;
  height: 52px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 2px solid var(--insa-red);
  color: var(--insa-red);
  font-size: 26px;
  line-height: 50px;
}
.confirmation-title {
  color: var(--text);
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 12px;
}
.confirmation-text {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 16px;
}
.confirmation-sub {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0 0 28px;
}
.confirmation-link {
  color: var(--insa-red);
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
}
.confirmation-link:hover { text-decoration: underline; }

/* ---------- Paiement / Checkout ---------- */
.order-summary {
  border: 1px solid var(--grey-border);
  border-radius: 2px;
  margin-bottom: 34px;
  overflow: hidden;
}
.order-title {
  margin: 0;
  padding: 12px 18px;
  background: var(--grey-bg);
  border-bottom: 1px solid var(--grey-border);
  font-size: 15px;
  color: var(--text);
}
.order-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--grey-border);
}
.order-line:last-child { border-bottom: none; }
.order-total {
  font-weight: bold;
  font-size: 16px;
  color: var(--text);
  background: var(--grey-bg);
}
.order-total span:last-child { color: var(--insa-red); }

.checkout-heading {
  font-size: 16px;
  color: var(--insa-maroon);
  margin: 30px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grey-border);
}
.checkout-heading:first-of-type { margin-top: 0; }

.field-row {
  display: flex;
  gap: 16px;
}
.field-row .field { flex: 1; }

.secure-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 14px 18px;
  background: var(--grey-bg);
  border: 1px solid var(--grey-border);
  border-radius: 4px;
}
.secure-badge-lock {
  flex: none;
  color: #1a7f37;
}
.secure-badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.secure-badge-text strong {
  font-size: 14px;
  color: var(--text);
}
.secure-badge-text span {
  font-size: 12.5px;
  color: var(--text-soft);
}
.secure-badge-brands {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid var(--grey-border);
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: var(--text-soft);
}

@media (max-width: 640px) {
  .field-row { flex-direction: column; gap: 0; }
  .secure-badge { flex-wrap: wrap; }
  .secure-badge-brands { margin-left: 0; width: 100%; }
}

/* ---------- Page de chargement ---------- */
.loader-panel {
  text-align: center;
  max-width: 460px;
  margin: 70px auto;
}
.loader-spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 26px;
  border: 5px solid var(--grey-border);
  border-top-color: var(--insa-red);
  border-radius: 50%;
  animation: loader-spin 0.9s linear infinite;
}
@keyframes loader-spin {
  to { transform: rotate(360deg); }
}
.loader-title {
  color: var(--text);
  font-size: 21px;
  font-weight: bold;
  margin: 0 0 12px;
}
.loader-text {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  .loader-spinner { animation-duration: 2s; }
}

/* ---------- Espace administration (login) ---------- */
.login-panel {
  max-width: 380px;
  margin: 60px auto;
  padding: 32px 30px;
  border: 1px solid var(--grey-border);
  border-radius: 4px;
  background: #fff;
}
.login-title {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--insa-red);
}
.login-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--text-soft);
}
.login-form .btn-submit { width: 100%; }
.login-error {
  background: #fdeaec;
  border: 1px solid #f3c2c8;
  color: var(--insa-red);
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 14px;
  margin: 0 0 18px;
}

/* ---------- Tableau de bord ---------- */
.dash-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}
.dash-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.stat-card {
  flex: 1;
  min-width: 160px;
  border: 1px solid var(--grey-border);
  border-top: 3px solid var(--insa-red);
  border-radius: 4px;
  padding: 18px 20px;
  background: #fff;
}
.stat-num {
  font-size: 30px;
  font-weight: bold;
  color: var(--insa-maroon);
  line-height: 1.1;
}
.stat-num--small { font-size: 20px; letter-spacing: 1px; }
.stat-label {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-soft);
}
.dash-inner .section-title { margin-top: 34px; }
.dash-empty {
  color: var(--text-soft);
  font-size: 14px;
  padding: 14px 0;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--grey-border);
  border-radius: 4px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--grey-border);
  text-align: left;
  vertical-align: top;
}
.data-table th {
  background: var(--grey-bg);
  color: var(--text);
  font-weight: bold;
  position: sticky;
  top: 0;
}
.data-table tbody tr:hover { background: #fafafa; }
.data-table td.nowrap { white-space: nowrap; color: var(--text-soft); }
.data-table code {
  font-family: "Consolas", "Menlo", monospace;
  font-size: 12px;
  color: var(--text);
}

/* ---------- Sessions en direct ---------- */
.live-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  flex-wrap: wrap;
}
.live-title { margin: 0; }
.live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #1a7f37;
  box-shadow: 0 0 0 0 rgba(26, 127, 55, 0.5);
  animation: live-pulse 1.6s infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(26, 127, 55, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(26, 127, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 127, 55, 0); }
}
.live-count {
  min-width: 24px;
  padding: 2px 9px;
  border-radius: 12px;
  background: var(--insa-red);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
}
.live-refresh { font-size: 12px; color: var(--text-soft); margin-left: auto; }

.stage {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}
.stage--view   { background: #eef2f7; color: #3a5573; }
.stage--typing { background: #fff4e0; color: #8a5b00; }
.stage--pay    { background: #e7f6ec; color: #1a7f37; }
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

.live-row { cursor: pointer; }
.manage-link {
  color: var(--insa-red);
  text-decoration: none;
  font-weight: bold;
}
.manage-link:hover { text-decoration: underline; }
.pending-flag {
  margin-left: 8px;
  font-size: 11px;
  font-weight: bold;
  color: var(--insa-maroon);
}

/* ---------- Gestion de session ---------- */
.flash {
  padding: 12px 14px;
  border-radius: 3px;
  font-size: 14px;
  margin: 0 0 22px;
}
.flash--success { background: #e7f6ec; border: 1px solid #b6e0c4; color: #1a7f37; }
.flash--error   { background: #fdeaec; border: 1px solid #f3c2c8; color: var(--insa-red); }

.session-id-line { font-size: 15px; margin: 0 0 20px; }
.session-id-line code {
  font-family: "Consolas", "Menlo", monospace;
  background: var(--grey-bg);
  padding: 2px 7px;
  border-radius: 3px;
}
.badge-online { color: #1a7f37; font-weight: bold; margin-left: 8px; font-size: 13px; }
.badge-offline { color: var(--text-soft); font-weight: bold; margin-left: 8px; font-size: 13px; }

.data-table th { white-space: nowrap; }

.redirect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.redirect-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--grey-border);
  border-left: 3px solid var(--insa-red);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.redirect-btn:hover { background: var(--grey-bg); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.redirect-btn-label { font-size: 15px; font-weight: bold; color: var(--text); }
.redirect-btn-file {
  font-family: "Consolas", "Menlo", monospace;
  font-size: 12px;
  color: var(--text-soft);
}
.redirect-btn--danger { border-left-color: #b80016; }
.redirect-btn--danger .redirect-btn-label { color: #b80016; }

.error-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 2px solid var(--insa-red);
  color: var(--insa-red);
  font-size: 30px;
  font-weight: bold;
  line-height: 48px;
}
.dash-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-soft);
}

/* ---------- Approbation via l'application ---------- */
.approve-panel {
  text-align: center;
  max-width: 480px;
  margin: 64px auto;
}
.approve-phone {
  color: var(--insa-maroon);
  margin-bottom: 18px;
}
.approve-title {
  color: var(--text);
  font-size: 21px;
  font-weight: bold;
  margin: 0 0 14px;
}
.approve-text {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 22px;
}
.approve-waiting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--grey-bg);
  border: 1px solid var(--grey-border);
  border-radius: 24px;
  font-size: 14px;
  font-weight: bold;
  color: var(--insa-maroon);
  margin-bottom: 20px;
}
.spinner-sm {
  width: 16px;
  height: 16px;
  border: 3px solid var(--grey-border);
  border-top-color: var(--insa-red);
  border-radius: 50%;
  animation: loader-spin 0.9s linear infinite;
}
.approve-sub {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  .spinner-sm { animation-duration: 2s; }
}

/* ---------- Pied de page ---------- */
.site-footer {
  background: #2b2b2b;
  color: #cfcfcf;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
  font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .page-banner h1 { font-size: 24px; }
  .banner-inner { padding: 30px 20px; }
}
