/* ============================================================
   CTA112 — Feuille de style principale
   Inspiration : sapeurs-pompiers (rouge profond, gris acier, bandes
   réfléchissantes), interface opérationnelle, lisible.
   ============================================================ */

:root {
  /* Couleurs */
  --red:        #c8102e;
  --red-dark:   #8f0b1f;
  --red-glow:   #ff3a55;
  --black:      #0d0f12;
  --gray-900:   #1a1d22;
  --gray-800:   #242830;
  --gray-700:   #2f343d;
  --gray-500:   #6b7280;
  --gray-300:   #cdd2d9;
  --gray-100:   #f3f4f6;
  --white:      #ffffff;
  --yellow:     #ffcb05;
  --orange:     #f57c00;
  --green:      #1e9d58;
  --blue:       #2563eb;

  /* Typo */
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Layout */
  --radius:       8px;
  --radius-sm:    4px;
  --shadow-md:    0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:    0 12px 32px rgba(0,0,0,.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--gray-900);
  background: #f6f7f9;
  line-height: 1.55;
}
body.theme-dark {
  background: var(--gray-900);
  color: var(--gray-100);
}

a { color: var(--red); text-decoration: none; transition: color .15s; }
a:hover { color: var(--red-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .02em;
  margin: 0 0 .6em;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ------------------------ Header ------------------------ */
.site-header {
  background: linear-gradient(180deg, var(--black) 0%, var(--gray-900) 100%);
  border-bottom: 3px solid var(--red);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.25rem;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: var(--white);
}
.brand:hover { color: var(--white); }
.brand-mark { display: flex; align-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-line1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: .05em;
}
.brand-accent { color: var(--red-glow); }
.brand-line2 {
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gray-300);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-nav a {
  color: var(--gray-300);
  font-weight: 500;
  font-size: .92rem;
  padding: .35rem .25rem;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--white); border-bottom-color: var(--red); }
.nav-cta {
  background: var(--red);
  color: var(--white) !important;
  padding: .5rem 1rem !important;
  border-radius: var(--radius-sm);
  border: none !important;
}
.nav-cta:hover { background: var(--red-dark); border: none !important; }
.nav-admin {
  background: var(--yellow);
  color: var(--black) !important;
  padding: .5rem .9rem !important;
  border-radius: var(--radius-sm);
  border: none !important;
  font-weight: 600 !important;
}
.nav-logout { color: var(--gray-500) !important; }

/* ------------------------ Main ------------------------ */
.site-main { min-height: calc(100vh - 240px); padding: 0 0 4rem; }

/* ------------------------ Hero (home) ------------------------ */
.hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(13,15,18,.85) 0%, rgba(143,11,31,.75) 100%),
    repeating-linear-gradient(45deg, var(--gray-800) 0 12px, var(--gray-700) 12px 24px);
  color: var(--white);
  padding: 5.5rem 0 5rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,58,85,.25), transparent 50%),
    radial-gradient(circle at 85% 70%, rgba(255,203,5,.15), transparent 45%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 3rem;
  align-items: center;
}
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  background: var(--red);
  color: var(--white);
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.hero h1 .accent { color: var(--yellow); }
.hero p.lead {
  font-size: 1.1rem;
  color: var(--gray-300);
  max-width: 540px;
  margin: 0 0 2rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-bullets {
  display: grid;
  gap: .75rem;
  margin-top: 2rem;
}
.hero-bullets li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 500;
}
.hero-bullets li::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 2px;
  transform: rotate(45deg);
}
.hero-card {
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(6px);
}
.hero-card h3 { color: var(--yellow); font-size: 1rem; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 1rem; }
.fake-call {
  background: var(--black);
  border-left: 4px solid var(--red);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: .9rem;
  margin-bottom: .75rem;
  position: relative;
  animation: blink 2s infinite;
}
.fake-call:last-child { animation: none; }
.fake-call .meta { display:flex; justify-content:space-between; color: var(--gray-500); font-size: .75rem; margin-bottom: .35rem; }
.fake-call .msg { color: var(--gray-100); }
@keyframes blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,58,85,.6); }
  50%      { box-shadow: 0 0 0 8px rgba(255,58,85,0); }
}

/* ------------------------ Buttons ------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: .9rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); color: var(--white); transform: translateY(-1px); }
.btn-secondary { background: transparent; border-color: var(--white); color: var(--white); }
.btn-secondary:hover { background: var(--white); color: var(--black); }
.btn-ghost { background: transparent; border-color: var(--gray-300); color: var(--gray-900); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { filter: brightness(1.1); color: var(--white); }
.btn-danger { background: var(--red-dark); color: var(--white); }
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-sm { padding: .4rem .8rem; font-size: .75rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------ Sections ------------------------ */
.section { padding: 4rem 0; }
.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: .5rem;
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  width: 60px; height: 4px;
  background: var(--red);
  margin: .75rem auto 0;
}
.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 3rem;
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature {
  background: var(--white);
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  border-top: 4px solid var(--red);
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature .ico {
  width: 48px; height: 48px;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.feature h3 { font-size: 1.15rem; }
.feature p { color: var(--gray-500); font-size: .95rem; margin: 0; }

/* ------------------------ Cards génériques ------------------------ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-md);
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2, .card-header h3 { margin: 0; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--gray-300); background: var(--gray-100); }

/* ------------------------ Formulaires ------------------------ */
.form-page {
  min-height: calc(100vh - 240px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    linear-gradient(135deg, rgba(13,15,18,.92), rgba(143,11,31,.85)),
    repeating-linear-gradient(45deg, var(--gray-800) 0 12px, var(--gray-700) 12px 24px);
}
.form-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--red);
}
.form-card h1 {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: .35rem;
}
.form-card .form-sub {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}
.form-control,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="search"],
select, textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
  background: var(--white);
  color: var(--gray-900);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200,16,46,.15);
}
textarea { min-height: 100px; resize: vertical; }
.form-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .9rem;
  color: var(--gray-500);
}
.form-card .btn { width: 100%; }

/* Alerts */
.alert {
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-size: .92rem;
  border-left: 4px solid;
}
.alert-success { background: #e9f7ef; border-color: var(--green); color: #14693d; }
.alert-danger  { background: #fdecee; border-color: var(--red); color: #7a0b1c; }
.alert-info    { background: #eaf3fe; border-color: var(--blue); color: #1849a8; }
.alert-warning { background: #fff7e0; border-color: var(--orange); color: #7a4a00; }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.4;
}
.badge-success { background: #d4f5e1; color: #14693d; }
.badge-danger  { background: #fbd8de; color: #7a0b1c; }
.badge-warning { background: #fff0c2; color: #7a4a00; }
.badge-info    { background: #d4e6fc; color: #1849a8; }
.badge-muted   { background: var(--gray-100); color: var(--gray-500); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}
table.table th, table.table td {
  padding: .7rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-300);
}
table.table thead th {
  background: var(--gray-100);
  font-family: var(--font-display);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-700);
}
table.table tbody tr:hover { background: #faf6f7; }

/* ------------------------ Operator dashboard ------------------------ */
.op-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - 90px);
  background: var(--gray-900);
}
.op-sidebar {
  background: linear-gradient(180deg, var(--black), var(--gray-900));
  color: var(--gray-100);
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--gray-700);
}
.op-sidebar .op-user {
  background: var(--gray-800);
  padding: 1rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--red);
  margin-bottom: 1.5rem;
}
.op-user .name { font-family: var(--font-display); font-size: 1.15rem; }
.op-user .grade { font-size: .8rem; color: var(--yellow); letter-spacing: .1em; text-transform: uppercase; }
.op-user .xp-bar { background: var(--gray-700); height: 6px; border-radius: 3px; margin-top: .65rem; overflow: hidden; }
.op-user .xp-bar > span { display:block; background: var(--red); height:100%; transition: width .3s; }
.op-user .xp-text { font-size: .75rem; color: var(--gray-300); margin-top: .25rem; }

.op-nav { display: flex; flex-direction: column; gap: .15rem; }
.op-nav a {
  color: var(--gray-300);
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}
.op-nav a:hover { background: var(--gray-800); color: var(--white); }
.op-nav a.active { background: var(--red); color: var(--white); }
.op-nav .nav-sep { color: var(--gray-500); font-size: .7rem; text-transform: uppercase; letter-spacing: .15em; padding: 1rem .85rem .35rem; }

.op-content { padding: 1.5rem 2rem; background: #eef0f3; }
.op-content h1 {
  font-size: 1.75rem;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.op-content h1::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 28px;
  background: var(--red);
  border-radius: 2px;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  border-left: 4px solid var(--red);
}
.stat-card .label { font-size: .75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .08em; }
.stat-card .value { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--gray-900); line-height: 1; margin-top: .25rem; }
.stat-card.warning { border-left-color: var(--orange); }
.stat-card.success { border-left-color: var(--green); }
.stat-card.info    { border-left-color: var(--blue); }

/* Calls panel */
.panel-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
}
.calls-panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.calls-panel-header {
  background: var(--gray-900);
  color: var(--white);
  padding: .85rem 1.1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .9rem;
}
.calls-panel-header .live {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--red);
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
}
.calls-panel-header .live::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--white);
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .5; transform: scale(.85); }
}
.calls-list { overflow-y: auto; flex: 1; }
.call-item {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--gray-300);
  cursor: pointer;
  transition: background .15s;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem .75rem;
}
.call-item:hover { background: #faf6f7; }
.call-item.active { background: #fff0f2; border-left: 4px solid var(--red); padding-left: calc(1.1rem - 4px); }
.call-item .call-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.call-item .call-meta { font-size: .8rem; color: var(--gray-500); }
.call-item .call-time { font-family: var(--font-display); color: var(--red); font-size: .85rem; align-self: start; }
.call-item.priority-critique .call-title::before {
  content: "⚠";
  color: var(--red);
}

.call-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--gray-500);
  font-size: .92rem;
}

/* Call detail */
.call-detail {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  padding: 1.25rem;
  height: fit-content;
}
.call-detail h2 { font-size: 1.2rem; }
.call-detail .field { margin: .65rem 0; }
.call-detail .field label { font-size: .75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .08em; }
.call-detail .field .val { font-size: 1rem; font-weight: 500; }
.call-detail .message-box {
  background: var(--gray-100);
  border-left: 4px solid var(--red);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-style: italic;
  color: var(--gray-700);
  margin: 1rem 0;
}
.call-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.call-detail .empty {
  text-align: center;
  color: var(--gray-500);
  padding: 3rem 1rem;
}

/* Intervention engins panel */
.engins-pick {
  display: grid;
  gap: .4rem;
  margin: 1rem 0;
}
.engin-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .65rem;
  padding: .5rem .75rem;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  font-size: .92rem;
}
.engin-row .engin-code { font-family: var(--font-display); background: var(--red); color: var(--white); padding: .15rem .5rem; border-radius: 3px; font-size: .8rem; }

/* ------------------------ Admin layout ------------------------ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 90px);
}
.admin-sidebar {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1.25rem 1rem;
  border-right: 3px solid var(--yellow);
}
.admin-sidebar .admin-tag {
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: .35rem .65rem;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 1rem;
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: .15rem; }
.admin-sidebar nav a {
  color: var(--gray-300);
  padding: .55rem .8rem;
  font-size: .9rem;
  border-radius: var(--radius-sm);
}
.admin-sidebar nav a:hover { background: var(--gray-800); color: var(--white); }
.admin-sidebar nav a.active { background: var(--red); color: var(--white); }
.admin-content { padding: 1.5rem 2rem; background: #eef0f3; }
.admin-content h1 { font-size: 1.6rem; }

/* ------------------------ Footer ------------------------ */
.site-footer {
  background: var(--black);
  color: var(--gray-300);
  border-top: 4px solid var(--red);
  padding-top: 3rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
}
.footer-brand { font-family: var(--font-display); font-size: 1.6rem; color: var(--white); }
.footer-brand span { color: var(--red-glow); }
.footer-tag { color: var(--gray-500); font-size: .9rem; margin-top: .35rem; }
.footer-col h4 {
  color: var(--white);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  color: var(--gray-300);
  padding: .25rem 0;
  font-size: .92rem;
}
.footer-col a:hover { color: var(--red-glow); }
.footer-bottom {
  background: rgba(0,0,0,.5);
  padding: 1rem 0;
  font-size: .8rem;
  color: var(--gray-500);
}
.footer-bottom > .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ------------------------ Responsive ------------------------ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .op-layout, .admin-layout { grid-template-columns: 1fr; }
  .op-sidebar, .admin-sidebar { border-right: none; border-bottom: 3px solid var(--red); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .site-nav { gap: .65rem; font-size: .85rem; }
  .site-nav a:not(.nav-cta):not(.nav-admin) { padding: .25rem .15rem; }
  .brand-line2 { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .op-content, .admin-content { padding: 1rem; }
}

/* ------------------------ Utilitaires ------------------------ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
