/* =====================================================================
   PORTAIL SUPPORT - FEUILLE DE STYLE
   Aucune dépendance externe : polices système uniquement.
   ===================================================================== */


/* =====================================================================
   1. CONFIGURATION (modifier uniquement cette section)
   ===================================================================== */
:root {
  /* --- Couleurs générales --- */
  --color-bg:        #eef2f6;   /* fond de la page */
  --color-surface:   #ffffff;   /* fond des cartes */
  --color-text:      #12263f;   /* titres */
  --color-muted:     #55667d;   /* descriptions */
  --color-border:    #d7dfe8;   /* contours */

  /* --- Couleur propre à chaque support --- */
  --color-electronique: #1d5fa8;   /* Support Tunisie Électronique */
  --color-securite:     #0a7a00ee;   /* Support Sécurité */

  /* --- Taille des images (le logo garde ses proportions) --- */
  --logo-height:        150px;   /* PC */
  --logo-height-tablet: 130px;   /* tablette (< 900px) */
  --logo-height-mobile: 110px;   /* mobile (< 600px) */

  /* --- Mise en page --- */
  --page-max-width: 960px;
  --card-radius:    12px;
  --gap:            24px;
}


/* =====================================================================
   2. BASE
   ===================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}


/* =====================================================================
   3. PAGE
   ===================================================================== */
.page {
  width: 100%;
  max-width: var(--page-max-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) max(20px, env(safe-area-inset-right)) clamp(24px, 4vw, 40px) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page__header {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 48px);
}

.page__title {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.page__subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
}

.page__footer {
  margin-top: clamp(28px, 5vw, 48px);
  text-align: center;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.page__footer p { margin: 0; }


/* =====================================================================
   4. CARTES
   ===================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.card {
  --accent: var(--color-electronique);

  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--accent);
  border-radius: var(--card-radius);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(18, 38, 63, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card--electronique { --accent: var(--color-electronique); }
.card--securite     { --accent: var(--color-securite); }

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(18, 38, 63, 0.12);
}

.card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Zone image : hauteur fixe, le logo n'est jamais déformé ni rogné */
.card__media {
  height: calc(var(--logo-height) + 48px);
  padding: 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
}

.card__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
}

.card__text {
  margin: 0 0 24px;
  color: var(--color-muted);
}

.card__cta {
  margin-top: auto;
  padding: 10px 20px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: filter 0.18s ease;
}

.card:hover .card__cta { filter: brightness(0.9); }


/* =====================================================================
   5. RESPONSIVE
   ===================================================================== */

/* Tablette */
@media (max-width: 900px) {
  :root { --gap: 20px; }
  .card__media { height: calc(var(--logo-height-tablet) + 40px); padding: 20px; }
  .card__body  { padding: 20px; }
}

/* Mobile : une seule colonne */
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .card__media { height: calc(var(--logo-height-mobile) + 32px); padding: 16px; }
  .card__cta   { width: 100%; text-align: center; }
}

/* Écrans tactiles : pas d'effet de survol */
@media (hover: none) {
  .card:hover { transform: none; box-shadow: 0 1px 2px rgba(18, 38, 63, 0.06); }
  .card:hover .card__cta { filter: none; }
}

/* Accessibilité : mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .card,
  .card__cta { transition: none; }
  .card:hover { transform: none; }
}
