/*
 * legal-acceptance.css — Vue étudiante "Conditions et sécurité" (D6.1-F).
 *
 * Le panneau est ajouté en enfant direct de <body> (au même titre que les
 * notifications, cf. notify.css) : il ne doit JAMAIS masquer la cloche de
 * notifications (z-index 10000/10001) ni piéger son focus derrière lui.
 * z-index volontairement inférieur (9000).
 */

.legal-gate {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px 48px;
  background: rgba(15, 23, 42, 0.55);
}

.legal-gate[hidden] {
  display: none;
}

.legal-gate__panel {
  width: 100%;
  max-width: 720px;
  margin-top: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
  padding: 24px;
  box-sizing: border-box;
}

.legal-gate__title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  outline: none;
}

.legal-gate__title:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}

.legal-gate__intro {
  margin: 0 0 16px;
  color: #334155;
  line-height: 1.5;
}

.legal-gate__status {
  min-height: 1.2em;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.legal-gate__status[data-tone="error"] {
  color: #b91c1c;
}

.legal-gate__status[data-tone="warning"] {
  color: #b45309;
}

.legal-gate__status[data-tone="success"] {
  color: #15803d;
}

.legal-gate__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.legal-gate__tab {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 0.95rem;
  color: #475569;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  min-height: 44px;
}

.legal-gate__tab[aria-selected="true"] {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  font-weight: 600;
}

.legal-gate__tab:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.legal-gate__meta {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 8px;
}

.legal-gate__fallback-notice {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.legal-gate__fallback-notice[hidden] {
  display: none;
}

.legal-gate__content {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #1e293b;
  line-height: 1.6;
}

.legal-gate__confirmations {
  border: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-gate__confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: #1e293b;
  line-height: 1.4;
}

.legal-gate__confirm-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 2px;
}

.legal-gate__confirm-label input[type="checkbox"]:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.legal-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.legal-gate__btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  cursor: pointer;
}

.legal-gate__btn:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.legal-gate__btn--retry {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

.legal-gate__btn--logout {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #b91c1c;
}

.legal-gate__btn--submit {
  background: #1d4ed8;
  color: #ffffff;
}

.legal-gate__btn--submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .legal-gate {
    padding: 12px;
  }

  .legal-gate__panel {
    padding: 16px;
    margin-top: 8px;
  }

  .legal-gate__actions {
    flex-direction: column-reverse;
  }

  .legal-gate__btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-gate,
  .legal-gate__panel,
  .legal-gate__tab {
    transition: none !important;
  }
}
