/* ==========================================================================
   REVOSTA — Design system
   Fichier principal : variables, reset, typographie, layout, utilitaires.
   Les composants (header, cartes, formulaires, footer...) sont dans components.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Polices
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/Inter-Variable-latin.woff2') format('woff2-variations'), url('/assets/fonts/Inter-Variable-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Variables de design
   -------------------------------------------------------------------------- */
:root {
    /* Couleurs de marque */
    --color-primary: #0B1526;        /* navy profond — fonds sombres, header/footer */
    --color-primary-alt: #13233F;    /* navy secondaire — degrades, hover sur fond sombre */
    --color-ink: #10151F;            /* encre proche du logo, texte fort sur fond clair */

    --color-secondary: #2F6FED;      /* bleu accent principal — CTA, liens, icones */
    --color-secondary-dark: #1E54C4;
    --color-secondary-light: #EAF1FE;

    --color-accent: #17B3C7;         /* cyan technique — degrades, halos, reseau/cloud */
    --color-accent-light: #E3F7FA;

    --color-background: #FFFFFF;
    --color-background-alt: #F5F7FA;
    --color-surface: #FFFFFF;

    --color-text: #1B2333;
    --color-text-muted: #5B6B82;
    --color-text-on-dark: #F5F7FA;
    --color-text-on-dark-muted: #A9B7CC;

    --color-border: #E2E6EC;
    --color-border-on-dark: rgba(255, 255, 255, 0.14);

    --color-success: #16A34A;
    --color-warning: #D97706;
    --color-error: #DC2626;

    /* Typographie */
    --font-heading: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --fs-xs: 0.8125rem;
    --fs-sm: 0.9375rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.375rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.25rem;
    --fs-4xl: 2.875rem;
    --fs-5xl: 3.5rem;

    /* Rayons, ombres, gabarits */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(11, 21, 38, 0.06), 0 1px 1px rgba(11, 21, 38, 0.05);
    --shadow-md: 0 12px 28px -8px rgba(11, 21, 38, 0.16), 0 2px 8px rgba(11, 21, 38, 0.06);
    --shadow-lg: 0 32px 64px -16px rgba(11, 21, 38, 0.28);

    --container-width: 1200px;
    --container-padding: 1.5rem;

    --transition-fast: 150ms ease;
    --transition-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 420ms cubic-bezier(0.4, 0, 0.2, 1);

    --header-height: 84px;
}

/* --------------------------------------------------------------------------
   3. Reset leger
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.65;
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img,
picture,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Taille par defaut de secours pour les icones inline (voir icon() dans app/helpers/icons.php).
   Les composants qui ont besoin d'une autre taille la surchargent via une regle plus specifique. */
svg[aria-hidden="true"] {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
    padding: 0;
}

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

/* --------------------------------------------------------------------------
   4. Accessibilite : focus, lien d'evitement, reduced motion
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    background: var(--color-primary);
    color: var(--color-text-on-dark);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 1rem;
}

.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;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   5. Typographie
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-ink);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 {
    font-size: var(--fs-5xl);
}

h2 {
    font-size: var(--fs-3xl);
}

h3 {
    font-size: var(--fs-xl);
}

h4 {
    font-size: var(--fs-lg);
}

p {
    color: var(--color-text-muted);
}

p + p {
    margin-top: 1rem;
}

strong {
    font-weight: 700;
    color: var(--color-ink);
}

.text-lead {
    font-size: var(--fs-lg);
    color: var(--color-text-muted);
    line-height: 1.6;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-secondary);
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 2px;
    background: var(--color-secondary);
    border-radius: var(--radius-pill);
}

@media (max-width: 768px) {
    h1 { font-size: var(--fs-4xl); }
    h2 { font-size: var(--fs-2xl); }
}

/* --------------------------------------------------------------------------
   6. Layout : container, sections, grilles
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.section {
    padding-block: clamp(3.5rem, 6vw, 6.5rem);
}

.section--tight {
    padding-block: clamp(2.5rem, 4vw, 4rem);
}

.section--alt {
    background-color: var(--color-background-alt);
}

.section--dark {
    background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-alt) 100%);
    color: var(--color-text-on-dark);
    position: relative;
    overflow: hidden;
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
    color: var(--color-text-on-dark);
}

.section--dark p {
    color: var(--color-text-on-dark-muted);
}

.section--dark .eyebrow {
    color: var(--color-accent);
}

.section--dark .eyebrow::before {
    background: var(--color-accent);
}

/* Halo technique tres subtil sur les sections sombres */
.section--dark::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto auto;
    width: 60vw;
    height: 60vw;
    max-width: 900px;
    max-height: 900px;
    background: radial-gradient(circle, rgba(47, 111, 237, 0.28) 0%, rgba(23, 179, 199, 0.08) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.section--dark > * {
    position: relative;
    z-index: 1;
}

.section-head {
    max-width: 720px;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head.is-centered {
    margin-inline: auto;
    text-align: center;
}

.section-head h2 {
    margin-top: 0.75rem;
}

.section-head .text-lead {
    margin-top: 1rem;
}

.grid {
    display: grid;
    gap: 1.75rem;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }
}

.stack {
    display: flex;
    flex-direction: column;
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   7. Utilitaires limites
   -------------------------------------------------------------------------- */
.u-text-center { text-align: center; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-1 { margin-top: 1rem !important; }
.u-mt-2 { margin-top: 2rem !important; }
.u-mt-3 { margin-top: 3rem !important; }
.u-hidden { display: none !important; }

@media (max-width: 900px) {
    .u-hide-mobile { display: none !important; }
}

@media (min-width: 901px) {
    .u-hide-desktop { display: none !important; }
}

/* --------------------------------------------------------------------------
   8. Animations discretes
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}
