/* ==========================================================================
   THEME-AZEO2.CSS - THEME AZEO 2 (ex AVE), MODES CLAIR ET SOMBRE
   A charger apres theme.css et components.css.
   Actif quand <html> porte data-theme="azeo2" (setThemeName('azeo2')).
   1. Jetons de couleur, formes, polices
   2. Polices locales (Montserrat, Poppins)
   3. Typographie
   4. Composants ajustes
   5. Blocs azeo 2 (classes ave-*)
   Les regles des sections 3 a 5 sont prefixees par :where(), qui n'ajoute
   aucun poids : elles l'emportent sur components.css par leur ordre seul.
   ========================================================================== */

/* 1. JETONS =============================================================== */

/* Jetons communs aux deux modes : couleurs de marque, formes, polices */
html[data-theme="azeo2"] {
  --brand-cyan: #3ebbee;        /* Boutons, titres de section, filets */
  --brand-cyan-hover: #24a6dc;
  --brand-navy: #1b3968;        /* Bandeaux, navigation */
  --brand-navy-deep: #001955;   /* Titres de cartes */
  --brand-slate: #62748a;       /* Gris-bleu des textes secondaires */
  --brand-footer: #222222;      /* Pied de page */

  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-full: 9999px;
  --font-sans: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
  --font-heading: 'Montserrat', Helvetica, Arial, Lucida, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --btn-primary-bg: var(--brand-cyan);
  --btn-primary-bg-hover: var(--brand-cyan-hover);
  --btn-primary-text: #ffffff;
}

/* Mode clair */
html[data-theme="azeo2"], html[data-theme="azeo2"][data-mode="light"] {
  --bg-primary: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-card: #edf1f5;
  --bg-card-hover: #e1e7ee;
  --bg-input: #ffffff;
  --bg-sidebar: #ffffff;

  --accent-primary: #1479ab;
  --accent-hover: #0f5f88;
  --accent-muted: rgba(62, 187, 238, 0.14);
  --accent-border: rgba(62, 187, 238, 0.45);

  --nav-accent: #1b3968;
  --nav-accent-hover: #001955;
  --nav-accent-muted: rgba(62, 187, 238, 0.14);
  --nav-accent-border: rgba(27, 57, 104, 0.3);
  --nav-accent-glow: rgba(27, 57, 104, 0.25);
  --nav-marker: var(--brand-cyan);

  --heading-color: #001955;
  --section-title-color: var(--brand-cyan);
  --text-primary: #333333;
  --text-secondary: #555555;
  --text-muted: #62748a;
  --text-on-accent: #ffffff;

  --border-color: #dbe2ea;
  --border-color-strong: #bcc8d6;

  --shadow-sm: 0 1px 2px rgba(0, 25, 85, 0.06);
  --shadow-md: 0 4px 10px rgba(0, 25, 85, 0.09);
  --shadow-lg: 0 10px 24px rgba(0, 25, 85, 0.14);
  --header-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);

  --row-hover: rgba(62, 187, 238, 0.06);

  --titan-blue: #1479ab;
  --titan-blue-bg: rgba(62, 187, 238, 0.14);
  --titan-green: #1a7f37;
  --titan-green-bg: rgba(26, 127, 55, 0.1);
  --titan-pink: #bf3989;
  --titan-pink-bg: rgba(191, 57, 137, 0.1);
  --titan-amber: #9a6700;
  --titan-amber-bg: rgba(154, 103, 0, 0.12);
  --titan-red: #cf222e;
  --titan-red-bg: rgba(207, 34, 46, 0.1);
  --titan-wait: #62748a;
  --titan-wait-bg: rgba(98, 116, 138, 0.12);
  --titan-on-solid: #ffffff;
  --titan-on-amber: #ffffff;
  --titan-inset: rgba(0, 25, 85, 0.04);

  --color-success: #15803d;
  --color-success-bg: rgba(21, 128, 61, 0.12);
  --color-success-border: rgba(21, 128, 61, 0.3);
  --color-warning: #a16207;
  --color-warning-bg: rgba(161, 98, 7, 0.14);
  --color-warning-border: rgba(161, 98, 7, 0.3);
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.1);
  --color-danger-border: rgba(220, 38, 38, 0.3);
  --accent-subtle-red: #dc2626;
  --accent-glow: rgba(62, 187, 238, 0.3);
  --focus-ring: var(--accent-primary);
}

/* Mode sombre : derive du bleu marine */
html[data-theme="azeo2"][data-mode="dark"] {
  --bg-primary: #0a1530;
  --bg-surface: #101e40;
  --bg-card: #17284f;
  --bg-card-hover: #1e3363;
  --bg-input: #17284f;
  --bg-sidebar: #071026;

  --accent-primary: #3ebbee;
  --accent-hover: #74cff3;
  --accent-muted: rgba(62, 187, 238, 0.14);
  --accent-border: rgba(62, 187, 238, 0.35);

  --nav-accent: #3ebbee;
  --nav-accent-hover: #74cff3;
  --nav-accent-muted: rgba(62, 187, 238, 0.14);
  --nav-accent-border: rgba(62, 187, 238, 0.35);
  --nav-accent-glow: rgba(62, 187, 238, 0.3);
  --nav-marker: var(--brand-cyan);

  --heading-color: #ffffff;
  --section-title-color: #3ebbee;
  --text-primary: #eaf1f8;
  --text-secondary: #c5d1e0;
  --text-muted: #93a6bf;
  --text-on-accent: #001955;

  --border-color: #253a6b;
  --border-color-strong: #3a5390;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --header-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);

  --row-hover: rgba(62, 187, 238, 0.05);

  --btn-primary-text: #001955;

  --titan-blue: #3ebbee;
  --titan-blue-bg: rgba(62, 187, 238, 0.15);
  --titan-green: #3fb950;
  --titan-green-bg: rgba(63, 185, 80, 0.15);
  --titan-pink: #f778ba;
  --titan-pink-bg: rgba(247, 120, 186, 0.15);
  --titan-amber: #d29922;
  --titan-amber-bg: rgba(210, 153, 34, 0.15);
  --titan-red: #f85149;
  --titan-red-bg: rgba(248, 81, 73, 0.15);
  --titan-wait: #93a6bf;
  --titan-wait-bg: rgba(147, 166, 191, 0.15);
  --titan-on-solid: #ffffff;
  --titan-on-amber: #000000;
  --titan-inset: rgba(0, 0, 0, 0.18);

  --color-success: #3fb950;
  --color-success-bg: rgba(63, 185, 80, 0.15);
  --color-success-border: rgba(63, 185, 80, 0.3);
  --color-warning: #d29922;
  --color-warning-bg: rgba(210, 153, 34, 0.15);
  --color-warning-border: rgba(210, 153, 34, 0.3);
  --color-danger: #f85149;
  --color-danger-bg: rgba(248, 81, 73, 0.15);
  --color-danger-border: rgba(248, 81, 73, 0.3);
  --accent-subtle-red: #f85149;
  --accent-glow: rgba(62, 187, 238, 0.3);
  --focus-ring: var(--accent-primary);
}

/* 2. POLICES LOCALES ====================================================== */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/montserrat-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/poppins-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/poppins-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/poppins-600-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/poppins-700-latin.woff2') format('woff2');
}

/* 3. TYPOGRAPHIE ========================================================== */

:where(html[data-theme="azeo2"]), :where(html[data-theme="azeo2"]) body { font-weight: 500; }
:where(html[data-theme="azeo2"]) button, :where(html[data-theme="azeo2"]) input, :where(html[data-theme="azeo2"]) select, :where(html[data-theme="azeo2"]) textarea { font-family: inherit; }
:where(html[data-theme="azeo2"]) p { line-height: 1.7; }

:where(html[data-theme="azeo2"]) h1, :where(html[data-theme="azeo2"]) h2, :where(html[data-theme="azeo2"]) h3, :where(html[data-theme="azeo2"]) h4,
:where(html[data-theme="azeo2"]) .page-title, :where(html[data-theme="azeo2"]) .section-title, :where(html[data-theme="azeo2"]) .card-title, :where(html[data-theme="azeo2"]) .modal-title, :where(html[data-theme="azeo2"]) .alert-title,
:where(html[data-theme="azeo2"]) .sidebar-brand-name, :where(html[data-theme="azeo2"]) .public-brand, :where(html[data-theme="azeo2"]) .stat-value {
  font-family: var(--font-heading);
}

:where(html[data-theme="azeo2"]) h1, :where(html[data-theme="azeo2"]) h2, :where(html[data-theme="azeo2"]) h3, :where(html[data-theme="azeo2"]) h4 { color: var(--heading-color); }
:where(html[data-theme="azeo2"]) h1 { font-weight: 600; }
:where(html[data-theme="azeo2"]) h2, :where(html[data-theme="azeo2"]) h3 { font-weight: 500; }

:where(html[data-theme="azeo2"]) .page-title { font-weight: 600; color: var(--heading-color); }
:where(html[data-theme="azeo2"]) .page-subtitle { line-height: 1.7; }

/* Titre de section du site : majuscules cyan, espacement 1px */
:where(html[data-theme="azeo2"]) .section-title {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--section-title-color);
}

:where(html[data-theme="azeo2"]) .card-title { font-weight: 500; color: var(--heading-color); }
:where(html[data-theme="azeo2"]) .modal-title { font-weight: 600; color: var(--heading-color); }
:where(html[data-theme="azeo2"]) .stat-value { font-weight: 600; color: var(--heading-color); }

/* 4. COMPOSANTS AJUSTES ============================================= */

/* Boutons : majuscules, espacement 1px, rayon 3px, cyan plein */
:where(html[data-theme="azeo2"]) .btn {
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
:where(html[data-theme="azeo2"]) .btn-sm { padding: 0.3rem 0.875rem; font-size: var(--text-2xs); }
:where(html[data-theme="azeo2"]) .btn-lg { padding: 0.75rem 2rem; font-size: var(--text-base); }
:where(html[data-theme="azeo2"]) .btn-icon, :where(html[data-theme="azeo2"]) .btn-icon.btn-sm { padding: 0; }
:where(html[data-theme="azeo2"]) .btn-primary, :where(html[data-theme="azeo2"]) .btn-primary:hover { color: var(--btn-primary-text); }
:where(html[data-theme="azeo2"]) .btn-primary { background-color: var(--btn-primary-bg); }
:where(html[data-theme="azeo2"]) .btn-primary:hover { background-color: var(--btn-primary-bg-hover); }
:where(html[data-theme="azeo2"]) .btn-primary.is-loading, :where(html[data-theme="azeo2"]) .btn-primary.is-loading:hover { color: transparent; }
:where(html[data-theme="azeo2"]) .btn-primary.is-loading::after { border-color: var(--btn-primary-text); border-top-color: transparent; }
:where(html[data-theme="azeo2"]) .btn-outline { color: var(--accent-primary); border-color: var(--accent-primary); }
:where(html[data-theme="azeo2"]) .btn-outline:hover { background-color: var(--accent-muted); color: var(--accent-primary); }

/* En-tete : fond de carte et filet d'ombre du site */
:where(html[data-theme="azeo2"]) .top-header { border-bottom: 0; box-shadow: var(--header-shadow); position: relative; z-index: 1; }

/* Menu lateral : liens en majuscules */
:where(html[data-theme="azeo2"]) .sidebar-brand-link { min-width: 0; }
:where(html[data-theme="azeo2"]) .sidebar-brand-text { min-width: 0; }
:where(html[data-theme="azeo2"]) .sidebar-brand-name { font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--heading-color); }
:where(html[data-theme="azeo2"]) .sidebar-brand-subtitle { font-size: 0.625rem; letter-spacing: 0.06em; white-space: nowrap; }
:where(html[data-theme="azeo2"]) .sidebar-link { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
:where(html[data-theme="azeo2"]) .sidebar-link.active { border-left-color: var(--nav-marker); }
:where(html[data-theme="azeo2"]) .sidebar-submenu-link { font-size: var(--text-xs); font-weight: 500; }

/* Onglets : rectangles a rayon 3px, majuscules */
:where(html[data-theme="azeo2"]) .tab-btn { border-radius: var(--radius-md); font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; }
:where(html[data-theme="azeo2"]) .tab-btn.active { box-shadow: none; }

/* Tableaux : en-tetes en petites majuscules bleu marine */
:where(html[data-theme="azeo2"]) .data-table th { font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; color: var(--heading-color); }

/* Cartes, badges, champs : angles vifs du site */
:where(html[data-theme="azeo2"]) .badge { border-radius: var(--radius-md); letter-spacing: 0.03em; }
:where(html[data-theme="azeo2"]) .form-label { font-weight: 600; color: var(--text-primary); }
:where(html[data-theme="azeo2"]) .form-input:focus, :where(html[data-theme="azeo2"]) .form-select:focus { border-color: var(--brand-cyan); box-shadow: 0 0 0 3px var(--accent-muted); }
:where(html[data-theme="azeo2"]) .card-featured, :where(html[data-theme="azeo2"]) .card.is-featured { border-color: var(--brand-cyan); }

/* 5. BLOCS AZEO 2 (classes ave-*) ======================================================== */

/* Sur-titre : petites majuscules espacees, au-dessus d'un titre */
:where(html[data-theme="azeo2"]) .ave-eyebrow { font-family: var(--font-sans); font-size: var(--text-lg); font-weight: 500; line-height: 1.3; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }

/* Bandeau d'accueil : fond bleu marine, texte blanc, bouton cyan */
:where(html[data-theme="azeo2"]) .ave-hero { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); padding: var(--space-12) var(--space-8); border-radius: var(--radius-lg); background: linear-gradient(120deg, #001955 0%, #1b3968 55%, #2a6f9f 100%); color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-hero .ave-eyebrow { color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-hero-title { max-width: 34rem; font-family: var(--font-heading); font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 600; line-height: 1.1; color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-hero-text { max-width: 30rem; font-size: var(--text-base); line-height: 1.8; color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-hero .btn-primary, :where(html[data-theme="azeo2"]) .ave-hero .btn-primary:hover { color: #ffffff; }

/* Titres du site, a l'echelle d'une page vitrine */
:where(html[data-theme="azeo2"]) .ave-heading { font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 500; line-height: 1.1; letter-spacing: 1px; text-transform: uppercase; color: var(--brand-cyan); }
:where(html[data-theme="azeo2"]) .ave-heading-sm { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
:where(html[data-theme="azeo2"]) .ave-subheading { font-family: var(--font-heading); font-size: var(--text-xl); font-weight: 600; line-height: 1.3; color: var(--text-primary); }
:where(html[data-theme="azeo2"]) .ave-text { font-size: var(--text-base); line-height: 1.9; color: var(--text-secondary); }

/* Carte de domaine : pictogramme, titre bleu marine, texte */
:where(html[data-theme="azeo2"]) .ave-domain-card { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-8) var(--space-6); text-align: center; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
:where(html[data-theme="azeo2"]) a.ave-domain-card:hover { border-color: var(--brand-cyan); box-shadow: var(--shadow-md); }
:where(html[data-theme="azeo2"]) .ave-domain-icon { display: inline-flex; align-items: center; justify-content: center; width: 4rem; height: 4rem; border-radius: var(--radius-full); background: var(--accent-muted); color: var(--brand-cyan); }
:where(html[data-theme="azeo2"]) .ave-domain-icon svg { width: 2rem; height: 2rem; }
:where(html[data-theme="azeo2"]) .ave-domain-title { font-family: var(--font-heading); font-size: var(--text-xl); font-weight: 500; line-height: 1.15; color: var(--heading-color); }
:where(html[data-theme="azeo2"]) .ave-domain-text { font-size: var(--text-sm); line-height: 1.7; color: var(--text-secondary); }

/* Bandeau plein : bleu marine ou cyan, texte blanc */
:where(html[data-theme="azeo2"]) .ave-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6); padding: var(--space-6) var(--space-8); border-radius: var(--radius-lg); background: var(--brand-navy); color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-band-cyan { background: var(--brand-cyan); }
:where(html[data-theme="azeo2"]) .ave-band-title { font-family: var(--font-heading); font-size: var(--text-xl); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-band-text { font-size: var(--text-sm); line-height: 1.7; color: rgba(255, 255, 255, 0.85); }
:where(html[data-theme="azeo2"]) .ave-band .btn-outline, :where(html[data-theme="azeo2"]) .ave-band .btn-outline:hover { color: #ffffff; border-color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-band .btn-outline:hover { background-color: rgba(255, 255, 255, 0.12); }

/* Pied de page du site : fond #222, adresses en colonnes */
:where(html[data-theme="azeo2"]) .ave-footer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); padding: var(--space-8); border-radius: var(--radius-lg); background: var(--brand-footer); color: #b3b3b3; font-size: var(--text-sm); line-height: 1.7; }
:where(html[data-theme="azeo2"]) .ave-footer-title { margin-bottom: var(--space-2); font-family: var(--font-heading); font-size: var(--text-md); font-weight: 600; color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-footer a { color: var(--brand-cyan); }
:where(html[data-theme="azeo2"]) .ave-footer a:hover { color: #ffffff; }
:where(html[data-theme="azeo2"]) .ave-footer-bottom { grid-column: 1 / -1; padding-top: var(--space-4); border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: var(--text-xs); color: #8c8c8c; }

/* Specimens de typographie du catalogue */
:where(html[data-theme="azeo2"]) .ave-specimen { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) 0; border-bottom: 1px solid var(--border-color); }
:where(html[data-theme="azeo2"]) .ave-specimen:last-child { border-bottom: 0; }
:where(html[data-theme="azeo2"]) .ave-specimen-label { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; color: var(--text-muted); }

@media (max-width: 768px) {
  :where(html[data-theme="azeo2"]) .ave-hero { padding: var(--space-8) var(--space-5); }
  :where(html[data-theme="azeo2"]) .ave-footer { grid-template-columns: minmax(0, 1fr); }
}
