/* ============================================================================
   CONMA — main.css
   Variables globales, reset, composants communs
   ============================================================================ */

/* ── Variables CSS ── */
:root {
  /* Bleus Navy — Fond principal */
  --primary:        #0D1B2A;
  --primary-mid:    #162236;
  --primary-soft:   #1E3050;

  /* Or CONMA — Couleur signature */
  --accent:         #C9A84C;
  --accent-light:   #E8C96A;
  --accent-pale:    #F5E9C8;
  --accent-dark:    #A07830;

  /* Statuts sémantiques */
  --valid:          #1A8C4E;
  --valid-bg:       #E8F5EE;
  --expired:        #C0392B;
  --expired-bg:     #FDECEA;
  --suspend:        #E67E22;
  --suspend-bg:     #FEF3E8;
  --pending:        #2980B9;
  --pending-bg:     #EBF5FB;

  /* Neutres */
  --white:          #FFFFFF;
  --off-white:      #F7F6F3;
  --gray-100:       #F0EEE9;
  --gray-300:       #C8C4BB;
  --gray-500:       #8A8478;
  --gray-700:       #4A463E;
  --text:           #1A1714;

  /* Effets */
  --shadow-gold:    0 0 40px rgba(201,168,76,0.15);
  --shadow-card:    0 20px 60px rgba(0,0,0,0.3), 0 0 80px rgba(201,168,76,0.08);
  --shadow-hover:   0 8px 24px rgba(13,27,42,0.4);
  --glow-input:     0 0 0 4px rgba(201,168,76,0.15);
  --border-gold:    1px solid rgba(201,168,76,0.2);
  --border-subtle:  1px solid rgba(255,255,255,0.06);
}

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  color: var(--text);
  background-color: var(--primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Texture noise de fond */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-light);
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ── Typographie ── */
h1, h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  line-height: 1.3;
}

h4, h5, h6 {
  font-family: 'Jost', sans-serif;
  font-weight: 600;
}

code, .mono {
  font-family: 'Source Code Pro', monospace;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes fillBar {
  from { width: 0; }
  to   { width: var(--target-width); }
}

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

/* ── Composants réutilisables ── */

/* Badges de statut */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-valid {
  background: var(--valid-bg);
  color: var(--valid);
}

.badge-expired {
  background: var(--expired-bg);
  color: var(--expired);
}

.badge-suspend {
  background: var(--suspend-bg);
  color: var(--suspend);
}

.badge-revoked {
  background: var(--expired-bg);
  color: #8B0000;
}

.badge-unknown {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--accent);
  border: 1px solid rgba(201,168,76,0.3);
}

.btn-primary:hover {
  background: var(--primary-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: var(--accent-light);
}

.btn-gold {
  background: var(--accent);
  color: var(--primary);
}

.btn-gold:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(201,168,76,0.3);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(201,168,76,0.05);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-danger {
  background: var(--expired);
  color: var(--white);
}

.btn-danger:hover {
  background: #A93226;
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Alertes */
.alert {
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
  animation: fadeInDown 0.3s ease;
}

.alert-success {
  background: var(--valid-bg);
  color: var(--valid);
  border: 1px solid rgba(26,140,78,0.2);
}

.alert-error {
  background: var(--expired-bg);
  color: var(--expired);
  border: 1px solid rgba(192,57,43,0.2);
}

.alert-warning {
  background: var(--suspend-bg);
  color: var(--suspend);
  border: 1px solid rgba(230,126,34,0.2);
}

.alert-info {
  background: var(--pending-bg);
  color: var(--pending);
  border: 1px solid rgba(41,128,185,0.2);
}

/* Forms communs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  background: var(--off-white);
  border: 2px solid var(--gray-100);
  border-radius: 10px;
  color: var(--text);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--glow-input);
  background: var(--white);
}

.form-input::placeholder {
  color: var(--gray-300);
  font-weight: 400;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(201,168,76,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Visually hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
   HEADER / NAV / FOOTER — Composants globaux partagés
   ============================================================================ */

/* ── Header fixe ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 72px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13,27,42,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,168,76,0.2);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo-link svg {
  width: 36px;
  height: 40px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .brand {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 4px;
  color: var(--accent);
  line-height: 1;
}

.logo-text .sub {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 10px;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a {
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-300);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Hamburger mobile */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--gray-300);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid rgba(201,168,76,0.15);
  padding: 60px 24px 24px;
  background: var(--primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto 40px;
}

.footer-col h5 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 16px;
}

.footer-col .motto {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 12px;
  color: var(--gray-500);
  font-style: italic;
}

.footer-col a {
  display: block;
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--gray-300);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-col p {
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--gray-300);
  margin-bottom: 6px;
}

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}

.footer-legal {
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.8;
  margin-bottom: 10px;
}

.footer-copyright {
  font-size: 12px;
  color: var(--gray-500);
}

.footer-counter {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 6px;
}

.footer-counter strong {
  font-family: 'Source Code Pro', monospace;
  color: var(--accent);
  font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .site-header {
    padding: 0 20px;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(13,27,42,0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid rgba(201,168,76,0.2);
  }

  .main-nav.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 375px) {
  html {
    font-size: 14px;
  }
}
