/* ==========================================================================
   CÈDRE EXPERTECH - Recrutement
   Design system : Trust & Authority x Nature professionnelle
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --green-900: #002F15;
    --green-800: #00421f;
    --green-700: #00602D;
    --green-600: #0a7a3d;
    --green-500: #2e9b5a;
    --green-100: #e7f3ec;
    --green-50:  #f2faf5;

    --ink-900: #0f1a14;
    --ink-700: #2a3a32;
    --ink-500: #5a6b62;
    --ink-400: #8a9890;
    --ink-200: #d6ddd8;
    --ink-100: #eef2ef;
    --ink-50:  #f7f9f7;

    --amber-500: #d97706;
    --danger-500: #c0392b;
    --success-500: #0a7a3d;
    --white: #ffffff;

    --font-head: 'Montserrat', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

    --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

    --sh-sm: 0 1px 2px rgba(15, 26, 20, 0.06), 0 1px 3px rgba(15, 26, 20, 0.04);
    --sh-md: 0 4px 12px rgba(15, 26, 20, 0.08), 0 2px 4px rgba(15, 26, 20, 0.04);
    --sh-lg: 0 12px 32px rgba(15, 26, 20, 0.12), 0 4px 8px rgba(15, 26, 20, 0.06);
    --sh-focus: 0 0 0 4px rgba(0, 96, 45, 0.25);

    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --dur-fast: 160ms;
    --dur-base: 220ms;
    --dur-slow: 360ms;

    --max-w: 1200px;
    --max-w-narrow: 780px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-900);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--green-700); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--green-800); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--sh-focus);
    border-radius: var(--r-sm);
}

.skip-link {
    position: absolute;
    top: -40px;
    left: var(--sp-4);
    background: var(--green-800);
    color: var(--white);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--r-sm);
    z-index: 1000;
    transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-4); color: var(--white); text-decoration: none; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--sp-5);
}
.container--narrow { max-width: var(--max-w-narrow); }

.section { padding: var(--sp-9) 0; }
.section--light { background: var(--green-50); }
.section--dark {
    background: linear-gradient(160deg, var(--green-900) 0%, var(--green-800) 100%);
    color: var(--white);
}
.section--dark .eyebrow { color: var(--green-500); }
.section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark p { color: rgba(255, 255, 255, 0.82); }
.section--form { background: var(--ink-50); }

/* ---------- Typographie ---------- */
h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--ink-900);
    line-height: 1.15;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.25rem, 4vw + 1rem, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 2.4vw + 1rem, 2.75rem); font-weight: 700; }
h3 { font-size: clamp(1.125rem, 0.6vw + 1rem, 1.375rem); font-weight: 600; }

p { color: var(--ink-700); }
.muted { color: var(--ink-500); }
.small { font-size: 0.875rem; }

.eyebrow {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green-700);
    margin-bottom: var(--sp-3);
}
.hl { color: var(--green-700); }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--ink-100);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}
.brand__logo { height: 48px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: var(--sp-5); }
.site-nav a {
    color: var(--ink-700);
    font-weight: 500;
    font-size: 0.95rem;
    padding: var(--sp-2) 0;
}
.site-nav a:hover { color: var(--green-700); text-decoration: none; }
.nav-cta {
    background: var(--green-700);
    color: var(--white) !important;
    padding: var(--sp-3) var(--sp-5) !important;
    border-radius: var(--r-pill);
    font-weight: 600;
    transition: all var(--dur-base) var(--ease);
}
.nav-cta:hover {
    background: var(--green-800);
    transform: translateY(-1px);
    box-shadow: var(--sh-md);
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 52px;
    padding: var(--sp-3) var(--sp-6);
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 2px solid transparent;
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: transform var(--dur-base) var(--ease),
                background var(--dur-base) var(--ease),
                box-shadow var(--dur-base) var(--ease),
                color var(--dur-base) var(--ease);
    text-decoration: none;
    user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
    background: var(--green-700);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(0, 96, 45, 0.25);
}
.btn--primary:hover {
    background: var(--green-800);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 96, 45, 0.35);
}
.btn--ghost {
    background: transparent;
    color: var(--ink-900);
    border-color: var(--ink-200);
}
.btn--ghost:hover {
    color: var(--green-800);
    border-color: var(--green-700);
    background: var(--green-50);
}
.btn--submit {
    width: 100%;
    min-height: 60px;
    font-size: 1.0625rem;
    margin-top: var(--sp-5);
}
.btn--submit .btn__spinner { display: none; }
.btn--submit.is-loading .btn__label { opacity: 0.6; }
.btn--submit.is-loading .btn__spinner { display: inline-block; animation: spin 0.9s linear infinite; }
.btn--submit:disabled { cursor: not-allowed; opacity: 0.75; }

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

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: clamp(var(--sp-8), 10vw, 140px) 0 var(--sp-9);
    overflow: hidden;
    isolation: isolate;
}
.hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at top left, rgba(46, 155, 90, 0.18), transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(0, 96, 45, 0.14), transparent 55%),
        linear-gradient(180deg, var(--green-50) 0%, var(--white) 100%);
}
.hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 30%, rgba(0, 66, 31, 0.05) 1px, transparent 2px),
        radial-gradient(circle at 75% 70%, rgba(0, 66, 31, 0.04) 1px, transparent 2px);
    background-size: 48px 48px;
    opacity: 0.8;
}
.hero__inner { text-align: center; max-width: 860px; }
.hero h1 { margin-bottom: var(--sp-5); }
.hero__lead {
    font-size: clamp(1.0625rem, 0.6vw + 1rem, 1.25rem);
    color: var(--ink-700);
    max-width: 640px;
    margin: 0 auto var(--sp-6);
    line-height: 1.55;
}
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-7);
}
.hero__badges {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-5) var(--sp-6);
    font-size: 0.9375rem;
    color: var(--ink-700);
}
.hero__badges li {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-weight: 500;
}
.hero__badges svg { color: var(--green-700); flex-shrink: 0; }

/* ---------- Section head ---------- */
.section__head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto var(--sp-7);
}
.section__head--left { text-align: left; margin-left: 0; }
.section__head h2 { margin-bottom: var(--sp-3); }
.section__head p { font-size: 1.0625rem; color: var(--ink-700); }

/* ---------- Vidéos 9:16 (format portrait) ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-6);
    max-width: 820px;
    margin: 0 auto;
}
.video-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-md);
    transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-lg);
}
.video-card__media {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}
.video-card__media--portrait {
    aspect-ratio: 9 / 16;
    max-height: 640px;
}
.video-card__media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}
/* Respect du ratio natif en plein écran */
.video-card__media video:fullscreen,
.video-card__media video::backdrop {
    object-fit: contain;
    width: 100%;
    height: 100%;
    background: #000;
}
.video-card__media video:-webkit-full-screen {
    object-fit: contain;
    width: 100%;
    height: 100%;
}
.video-card__body { padding: var(--sp-5); }
.video-card__body h3 {
    color: var(--green-800);
    margin-bottom: var(--sp-2);
}

/* ---------- Duo ---------- */
.duo {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-7);
    margin-top: var(--sp-6);
}
.duo__col {
    background: var(--white);
    padding: var(--sp-6);
    border-radius: var(--r-lg);
    border: 1px solid var(--ink-100);
}
.duo__title {
    color: var(--green-800);
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--green-100);
}
.check-list {
    list-style: none;
    display: grid;
    gap: var(--sp-3);
}
.check-list li {
    position: relative;
    padding-left: var(--sp-6);
    color: var(--ink-700);
    line-height: 1.55;
}
.check-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green-100) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300602D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>") center/12px no-repeat;
}

/* ---------- Perks ---------- */
.perks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-5);
}
.perk {
    padding: var(--sp-6);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-lg);
    transition: transform var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.perk:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.07);
}
.perk__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--green-500);
    color: var(--white);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
}
.perk h3 {
    color: var(--white);
    margin-bottom: var(--sp-2);
    font-size: 1.0625rem;
}
.perk p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9375rem;
    line-height: 1.55;
}

/* ---------- Formulaire ---------- */
.apply-form {
    background: var(--white);
    padding: clamp(var(--sp-5), 4vw, var(--sp-8));
    border-radius: var(--r-xl);
    box-shadow: var(--sh-md);
    border: 1px solid var(--ink-100);
}

.form-status {
    margin-bottom: var(--sp-5);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1.5px solid transparent;
}
.form-status--info {
    background: var(--green-50);
    color: var(--green-800);
    border-color: var(--green-100);
}
.form-status--success {
    background: #ecfdf5;
    color: var(--success-500);
    border-color: #bbf7d0;
}
.form-status--error {
    background: #fef2f2;
    color: var(--danger-500);
    border-color: #fecaca;
}

.form-section {
    border: none;
    margin-bottom: var(--sp-7);
}
.form-section:last-of-type { margin-bottom: var(--sp-5); }
.form-section legend {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--green-800);
    padding-bottom: var(--sp-3);
    margin-bottom: var(--sp-5);
    width: 100%;
    border-bottom: 2px solid var(--green-100);
}

.form-row { display: grid; gap: var(--sp-4); }
.form-row--2 { grid-template-columns: repeat(2, 1fr); }

.form-group { margin-bottom: var(--sp-5); }
.form-group:last-child { margin-bottom: 0; }

.form-group label,
.form-label {
    display: block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--ink-900);
    margin-bottom: var(--sp-2);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    min-height: 52px;
    padding: var(--sp-3) var(--sp-4);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ink-900);
    background: var(--white);
    border: 1.5px solid var(--ink-200);
    border-radius: var(--r-md);
    transition: border-color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease),
                background var(--dur-fast) var(--ease);
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
    padding-top: var(--sp-3);
    line-height: 1.55;
}
.form-group input:hover, .form-group textarea:hover { border-color: var(--ink-400); }
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--green-700);
    box-shadow: var(--sh-focus);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--ink-400); }

.form-helper {
    display: block;
    margin-top: var(--sp-2);
    font-size: 0.8125rem;
    color: var(--ink-500);
}
.form-error {
    display: block;
    min-height: 20px;
    margin-top: var(--sp-1);
    font-size: 0.8125rem;
    color: var(--danger-500);
    font-weight: 500;
}
.form-group.has-error input,
.form-group.has-error textarea { border-color: var(--danger-500); background: #fef5f4; }
.form-group.has-error input:focus,
.form-group.has-error textarea:focus { box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.2); }

/* Radio chips */
.radio-options { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-1); }
.form-group .radio-chip,
.radio-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: 48px;
    margin: 0;
    padding: var(--sp-2) var(--sp-5);
    background: var(--white);
    border: 1.5px solid var(--ink-200);
    border-radius: var(--r-pill);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1;
    color: var(--ink-700);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
    user-select: none;
}
.radio-chip input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.radio-chip::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--ink-200);
    background: var(--white);
    transition: all var(--dur-fast) var(--ease);
    flex-shrink: 0;
}
.radio-chip:hover { border-color: var(--green-600); color: var(--ink-900); }
.radio-chip:has(input:checked) {
    border-color: var(--green-700);
    background: var(--green-50);
    color: var(--green-800);
    font-weight: 600;
}
.radio-chip:has(input:checked)::before {
    border-color: var(--green-700);
    background: var(--green-700);
    box-shadow: inset 0 0 0 3px var(--white);
}
.radio-chip:has(input:focus-visible) { box-shadow: var(--sh-focus); }

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--ink-50);
    border-radius: var(--r-md);
    border: 1.5px solid var(--ink-100);
}
.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border: 2px solid var(--ink-200);
    border-radius: var(--r-sm);
    background: var(--white);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--dur-fast) var(--ease);
    position: relative;
}
.checkbox-group input[type="checkbox"]:hover { border-color: var(--green-600); }
.checkbox-group input[type="checkbox"]:checked { background: var(--green-700); border-color: var(--green-700); }
.checkbox-group input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 12px;
    border: solid var(--white);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.checkbox-group label {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--ink-700);
    margin-bottom: 0;
    line-height: 1.5;
    cursor: pointer;
}

/* Fichier */
.file-dropzone {
    position: relative;
    border: 2px dashed var(--ink-200);
    border-radius: var(--r-md);
    background: var(--ink-50);
    transition: all var(--dur-fast) var(--ease);
    cursor: pointer;
}
.file-dropzone:hover { border-color: var(--green-700); background: var(--green-50); }
.file-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.file-dropzone__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-7) var(--sp-4);
    text-align: center;
    color: var(--ink-500);
    pointer-events: none;
}
.file-dropzone__content svg { color: var(--green-700); margin-bottom: var(--sp-2); }
.file-dropzone__title {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--ink-900);
    font-size: 0.9375rem;
    word-break: break-word;
}
.file-dropzone__hint { font-size: 0.8125rem; color: var(--ink-500); }
.file-dropzone.has-file { border-color: var(--green-700); background: var(--green-50); }
.file-dropzone.has-file .file-dropzone__title { color: var(--green-800); }

.form-footer { margin-top: var(--sp-5); text-align: center; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--green-900);
    color: rgba(255, 255, 255, 0.75);
    padding: var(--sp-6) 0;
    font-size: 0.875rem;
}
.site-footer p,
.site-footer nav a {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}
.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    flex-wrap: wrap;
}
.site-footer a { color: rgba(255, 255, 255, 0.9); }
.site-footer a:hover { color: var(--white); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .perks { grid-template-columns: repeat(2, 1fr); }
    .site-nav a:not(.nav-cta) { display: none; }
}

@media (max-width: 720px) {
    .section { padding: var(--sp-7) 0; }
    .video-grid { grid-template-columns: 1fr; gap: var(--sp-5); max-width: 380px; }
    .video-card__media--portrait { max-height: 560px; }
    .duo { grid-template-columns: 1fr; gap: var(--sp-5); }
    .form-row--2 { grid-template-columns: 1fr; }
    .hero__actions { flex-direction: column; }
    .hero__actions .btn { width: 100%; }
    .site-footer__inner { justify-content: center; text-align: center; }
    .header-inner { min-height: 64px; }
    .brand__logo { height: 40px; }
}

@media (max-width: 480px) {
    .perks { grid-template-columns: 1fr; }
    .apply-form { padding: var(--sp-5) var(--sp-4); }
    .hero__badges { flex-direction: column; gap: var(--sp-3); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
