/* ============================================================
   style.css — Portail Amicale des Sapeurs-Pompiers
   Header commun + styles globaux
   ============================================================ */

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* Variables */
:root {
  --primary:   #E07B39;
  --primary-d: #C4622A;
  --accent:    #4A8C5C;
  --accent-d:  #3A7049;
  --danger:    #c0392b;
  --bg:        #F7F4F0;
  --card-bg:   #FFFFFF;
  --text:      #2D2D2D;
  --muted:     #7A7A7A;
  --border:    #E2DBD2;
  --radius:    12px;
  --shadow:    0 4px 18px rgba(0,0,0,.09);
}

/* Body */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER COMMUN
   ============================================================ */
.site-header {
  background: var(--primary);
  padding: 0 32px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  position: relative;
}

/* Logo a gauche - deborde legerement */
.header-logo {
  height: 250px;
  width: 250px;
  object-fit: contain;
  border-radius: 14px;
  background: transparent;
  padding: 0;
  box-shadow: none;
  position: relative;
  top: 30px;
  flex-shrink: 0;
  transition: transform .3s;
}
.header-logo:hover { transform: scale(1.05); }

/* Titre centre */
.header-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.header-title .title-main {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.header-title .title-sub {
  color: rgba(255,255,255,.75);
  font-size: .75rem;
  margin-top: 2px;
}

/* Zone droite */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 99px;
  padding: 5px 12px 5px 6px;
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--primary);
  font-weight: 700;
  font-size: .8rem;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.user-info-name { color: #fff; font-size: .85rem; font-weight: 600; line-height: 1.2; }
.user-info-role { color: rgba(255,255,255,.7); font-size: .7rem; }

.btn-logout {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,.28); }

/* Breadcrumb */
.breadcrumb {
  padding: 14px 32px;
  margin-top: 60px;
  position: relative;
  z-index: 1;
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 99px;
  box-shadow: 0 3px 10px rgba(224,123,57,.35);
  transition: background .2s, transform .1s, box-shadow .2s;
}

.breadcrumb a:hover {
  background: var(--primary-d);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(224,123,57,.45);
  text-decoration: none;
}

.breadcrumb a:active {
  transform: translateY(0);
}

.breadcrumb span { margin: 0 6px; }

/* ============================================================
   CONTENU
   ============================================================ */
main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.page-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.page-heading .icon-wrap {
  background: var(--primary); color: #fff;
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0;
}
.page-heading h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.page-heading p  { font-size: .85rem; color: var(--muted); margin-top: 2px; }

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-header h2 { font-size: 1rem; font-weight: 600; color: var(--text); }
.card-body { padding: 24px; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field label {
  font-size: .76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
}
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .92rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .2s, background .2s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
}
.field input.invalid { border-color: var(--danger); background: #fff8f8; }
.field-error { font-size: .75rem; color: var(--danger); min-height: 14px; }

/* Boutons */
.btn-primary {
  background: var(--primary); color: #fff; border: none;
  padding: 11px 24px; border-radius: 8px;
  font-size: .92rem; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .1s;
  box-shadow: 0 3px 10px rgba(224,123,57,.3);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { background: var(--primary-d); transform: translateY(-1px); }



.btn-accent {
  background: var(--accent); color: #fff; border: none;
  padding: 11px 24px; border-radius: 8px;
  font-size: .92rem; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .1s;
  box-shadow: 0 3px 10px rgba(74,140,92,.3);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-accent:hover { background: var(--accent-d); transform: translateY(-1px); }

.btn-danger {
  background: rgba(192,57,43,.1); color: var(--danger); border: none;
  padding: 7px 14px; border-radius: 7px;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: rgba(192,57,43,.2); }
.btn-danger:disabled { opacity: .35; cursor: not-allowed; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg); }
thead th {
  padding: 10px 14px; font-size: .76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); text-align: left; border-bottom: 2px solid var(--border);
}
thead th.center { text-align: center; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(224,123,57,.04); }
tbody td { padding: 12px 14px; font-size: .88rem; vertical-align: middle; }
tbody td.center { text-align: center; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.badge-green  { background: rgba(74,140,92,.12);  color: var(--accent-d); border: 1px solid rgba(74,140,92,.25); }
.badge-orange { background: rgba(224,123,57,.12); color: var(--primary-d); border: 1px solid rgba(224,123,57,.25); }
.badge-red    { background: rgba(192,57,43,.1);   color: var(--danger);   border: 1px solid rgba(192,57,43,.2); }
.badge-primary { background: var(--primary); color: #fff; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--accent); color: #fff;
  padding: 12px 24px; border-radius: 12px;
  font-size: .88rem; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  z-index: 999; white-space: nowrap;
}
.toast.show  { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* Etat vide */
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.empty-state p { font-size: .88rem; }

/* Notice */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(74,140,92,.08); border-left: 4px solid var(--accent);
  border-radius: 6px; padding: 12px 16px;
  font-size: .83rem; color: var(--text); margin-bottom: 20px; line-height: 1.5;
}

/* Footer */
footer {
  text-align: center; padding: 16px;
  font-size: .78rem; color: var(--muted);
  border-top: 1px solid var(--border); margin-top: auto;
}

/* Compatibilite ancien .btn */
.btn {
  display: inline-block; width: 220px; padding: 14px 0; margin: 10px;
  text-decoration: none; color: white; background: var(--primary);
  border-radius: 8px; font-weight: 600; font-size: 1em;
  box-shadow: 0 4px 8px rgba(0,0,0,.1); transition: all .3s ease;
  border: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--primary-d); transform: translateY(-2px); }

.dev-banner {
  text-align: center;
  padding: 16px;
  border-top: 3px solid rgba(224,123,57,.3);
  background: rgba(224,123,57,.06);
}
.dev-banner-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--primary-d); margin-bottom: 10px;
}
.dev-banner img {
  height: 100px; object-fit: contain;
  transition: transform .2s, opacity .2s;
}
.dev-banner img:hover { transform: scale(1.05); opacity: .85; }

/* Responsive */
@media (max-width: 600px) {
  .site-header {
    height: auto;
    padding: 12px 16px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .header-logo {
    height: 70px;
    width: 70px;
    top: 0;
  }

  .header-title .title-main { font-size: 1rem; }
  .header-title .title-sub { font-size: .7rem; }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .breadcrumb { margin-top: 12px; }
  main { padding: 16px 12px 40px; }
  .btn { width: 180px; font-size: .95em; }
}@media (max-width: 600px) {
  .site-header {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-logo {
    height: 60px;
    width: 60px;
    top: 0;
    flex-shrink: 0;
  }
  .header-title {
    position: static;
    transform: none;
    flex: 1;
    text-align: left;
  }
  .header-title .title-main { font-size: .95rem; }
  .header-title .title-sub  { font-size: .68rem; }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .breadcrumb { margin-top: 12px; }
  main { padding: 16px 12px 40px; }
  .btn { width: 180px; font-size: .95em; }

}@media (max-width: 600px) {
  .site-header { padding: 0 16px; }
  .header-logo { height: 70px; width: 70px; top: 8px; }
  .header-title .title-main { font-size: 1rem; }
  .header-title .title-sub  { display: none; }
  .user-info-role { display: none; }
  main { padding: 16px 12px 40px; }
  .btn { width: 180px; font-size: .95em; }
}
