/* Styles partagés du gabarit (header, navbar, footer) — extraits des vues EJS
   pour être mis en cache par le navigateur au lieu d'être retéléchargés à chaque page. */

:root {
  --primary: #be123c;
  --secondary: #e11d48;
  --accent: #0f766e;
  --light: #fff7f8;
  --dark: #1f2937;
  --warning: #f59e0b;
  --danger: #dc2626;
  --medical-red: #e11d48;
  --medical-red-dark: #be123c;
  --medical-red-soft: #fff1f2;
  --medical-line: rgba(225, 29, 72, 0.14);
  --medical-shadow: 0 18px 45px rgba(190, 18, 60, 0.1);
}

body {
  font-family: "Poppins", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(225, 29, 72, 0.08), transparent 28rem),
    linear-gradient(135deg, #ffffff 0%, var(--light) 100%);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.gradient-text {
  background: linear-gradient(to right, var(--medical-red), var(--medical-red-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-primary {
  background-color: var(--medical-red);
  border-color: var(--medical-red);
}

.btn-primary:hover {
  background-color: var(--medical-red-dark);
  border-color: var(--medical-red-dark);
}

.btn-secondary {
  background-color: #1f2937;
  border-color: #1f2937;
}

.btn-secondary:hover {
  background-color: #111827;
  border-color: #111827;
}

.card,
.dashboard-container,
.form-container,
.testimonial-card,
.feature-card {
  border: 1px solid var(--medical-line) !important;
  box-shadow: var(--medical-shadow) !important;
}

.card-header {
  background: linear-gradient(135deg, var(--medical-red), var(--medical-red-dark)) !important;
  color: #fff !important;
  border-bottom: 0 !important;
}

.badge.bg-primary,
.bg-primary {
  background-color: var(--medical-red) !important;
}

.text-primary {
  color: var(--medical-red) !important;
}

.emergency-banner {
  background-color: var(--danger);
  color: white;
  padding: 0.75rem;
  font-weight: 600;
}

.emergency-banner a {
  color: white;
  text-decoration: underline;
}

/* ---------- Navbar ---------- */

.all-safe-navigation-region {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0.55rem 0.8rem 0;
}

.emergency-banner {
  background: transparent;
  color: #9f1239;
  padding: 8px 0;
  font-size: 0.85rem;
}

.emergency-banner-shell {
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(190, 18, 60, 0.1);
  padding: 0.52rem 1rem;
}

.emergency-banner .text-white,
.emergency-banner .text-white-50 {
  color: #9f1239 !important;
}

.emergency-banner a {
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.emergency-banner a:hover {
  opacity: 0.8;
}

.navbar {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 14px 0 10px;
  position: relative;
  z-index: 1;
}

.all-safe-navigation-shell {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 18px 50px rgba(190, 18, 60, 0.12);
  padding: 0.55rem 0.7rem 0.55rem 1rem;
}

.navbar-brand {
  font-size: 1.5rem;
  color: #1f2937 !important;
  font-weight: 800;
  gap: 0.35rem;
}

.navbar-brand i {
  color: #e11d48 !important;
}

.nav-link {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(225, 29, 72, 0.1);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.06);
  color: #4b5563 !important;
  font-weight: 700;
  transition: all 0.3s ease;
  margin: 0 4px;
  padding: 0.62rem 0.95rem !important;
}

.nav-link:hover {
  background: #e11d48;
  border-color: #e11d48;
  box-shadow: 0 14px 34px rgba(190, 18, 60, 0.2);
  color: #fff !important;
  transform: translateY(-1px);
}

.nav-link::after {
  display: none !important;
}

.alert-nav-link {
  background: rgba(255, 241, 242, 0.92);
  border-color: rgba(225, 29, 72, 0.2);
  color: #be123c !important;
  font-weight: 800;
  animation: navAlertePulse 1.6s infinite;
}

@keyframes navAlertePulse {
  0%, 100% { text-shadow: none; transform: scale(1); }
  50% { text-shadow: 0 0 10px rgba(225, 29, 72, 0.55); transform: scale(1.04); }
}

.dropdown-menu {
  border: 1px solid rgba(225, 29, 72, 0.12);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(190, 18, 60, 0.12);
  margin-top: 8px;
  padding: 8px 0;
  background: white;
}

.dropdown-item {
  padding: 8px 20px;
  transition: all 0.3s ease;
  color: #4b5563;
}

.dropdown-item:hover {
  background-color: #fff1f2;
  color: #be123c;
  padding-left: 25px;
}

.dropdown-item small {
  font-size: 0.7rem;
  color: #6c757d;
}

.dropdown-item i {
  width: 20px;
  color: #e11d48;
  margin-right: 8px;
}

.dropdown-divider {
  margin: 8px 0;
}

@media (max-width: 768px) {
  .all-safe-navigation-shell {
    align-items: stretch;
    border-radius: 1.5rem;
    padding: 0.75rem;
  }

  .emergency-banner-shell {
    border-radius: 1.2rem;
  }

  .navbar-nav {
    gap: 0.45rem;
    padding-top: 0.8rem;
  }

  .nav-link {
    margin: 0;
    text-align: center;
  }

  .dropdown-menu {
    border: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: none;
    padding-left: 20px;
  }

  .dropdown-item {
    color: #4a5568 !important;
  }

  .dropdown-item small {
    color: #6c757d !important;
  }

  .dropdown-item i {
    color: #e11d48;
  }

  .dropdown-item:hover {
    background: #fff1f2;
    padding-left: 25px;
  }
}

/* ---------- Footer ---------- */

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.1); }
}

.site-footer {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #1f2937;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  margin-top: auto;
}

.site-footer h3,
.site-footer h5 {
  background: none !important;
  color: #be123c !important;
  -webkit-text-fill-color: currentColor !important;
}

.site-footer .text-white,
.site-footer .text-white-50,
.site-footer a.text-white,
.site-footer a.text-white-50 {
  color: #4b5563 !important;
}

.site-footer a:hover {
  color: #be123c !important;
}

.site-footer .bi-arrow-right-short,
.site-footer .bi-info-circle,
.site-footer .bi-telephone-fill,
.site-footer .bi-telephone,
.site-footer .bi-envelope-fill,
.site-footer .bi-shield-lock-fill,
.site-footer .bi-patch-check-fill {
  color: #e11d48 !important;
}

.footer-social-link {
  align-items: center;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(225, 29, 72, 0.12);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(190, 18, 60, 0.08);
  color: #be123c !important;
  display: inline-flex;
  height: 2.75rem;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  width: 2.75rem;
}

.footer-social-link:hover {
  background: #fff1f2;
  box-shadow: 0 16px 36px rgba(190, 18, 60, 0.14);
  color: #9f1239 !important;
  transform: translateY(-3px);
}

.site-footer hr {
  background: linear-gradient(90deg, transparent, rgba(225, 29, 72, 0.18), transparent) !important;
}

.password-toggle-wrap {
  position: relative;
}

.password-toggle-wrap > input[type="password"],
.password-toggle-wrap > input[data-password-visible="true"] {
  padding-right: 3rem !important;
}

.password-toggle-btn {
  align-items: center;
  background: transparent;
  border: 0;
  color: #6c757d;
  display: inline-flex;
  height: 2.25rem;
  justify-content: center;
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  z-index: 3;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
  color: var(--primary);
}

.back-to-top-button {
  align-items: center;
  background: linear-gradient(135deg, #e11d48, #be123c);
  border: 0;
  border-radius: 50%;
  bottom: 1.5rem;
  box-shadow: 0 12px 28px rgba(190, 18, 60, 0.25);
  color: #fff;
  display: inline-flex;
  height: 3rem;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 1.5rem;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: 3rem;
  z-index: 1050;
}

.back-to-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.submit-lock-overlay {
  align-items: center;
  background: rgba(127, 29, 29, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 20000;
}

.submit-lock-overlay[hidden] {
  display: none;
}

.submit-lock-panel {
  background: #fff;
  border-top: 5px solid #e11d48;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  max-width: 430px;
  padding: 2rem;
  text-align: center;
  width: min(100%, 430px);
}

.submit-lock-spinner {
  animation: submitSpin 0.85s linear infinite;
  border: 4px solid rgba(225, 29, 72, 0.18);
  border-radius: 50%;
  border-top-color: #e11d48;
  height: 3rem;
  margin: 0 auto 1rem;
  width: 3rem;
}

.swal2-popup.all-safe-medical-alert {
  border-radius: 1.25rem;
  border-top: 5px solid #e11d48;
  box-shadow: 0 24px 70px rgba(190, 18, 60, 0.18);
}

.swal2-confirm.all-safe-medical-confirm {
  background: linear-gradient(135deg, #e11d48, #be123c) !important;
  border-radius: 999px !important;
  box-shadow: 0 12px 28px rgba(190, 18, 60, 0.2) !important;
  padding-left: 1.4rem !important;
  padding-right: 1.4rem !important;
}

.swal2-cancel.all-safe-medical-cancel {
  border-radius: 999px !important;
  padding-left: 1.4rem !important;
  padding-right: 1.4rem !important;
}

@keyframes submitSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .footer .col-md-4 {
    margin-bottom: 2rem;
  }

  .back-to-top-button {
    bottom: 1rem;
    right: 1rem;
  }
}
