/* =========================================================================
   Leerdammer — "Le plus dingue des sandwichs gagne"
   Intégration pixel-perfect de la maquette Figma. 100% local (aucun CDN).
   ========================================================================= */

/* --- Police Gopher (déposer les WOFF2 dans public/fonts/gopher/, cf. README) --- */
@font-face { font-family: "Gopher"; src: url("../fonts/gopher/Gopher-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Gopher"; src: url("../fonts/gopher/Gopher-Bold.woff2") format("woff2");   font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Gopher"; src: url("../fonts/gopher/Gopher-Heavy.woff2") format("woff2");  font-weight: 900; font-style: normal; font-display: swap; }

:root {
    --yellow: #FFCF00;
    --green: #83BB26;
    --ink: #000000;
    --input-border: #5C5B5B;
    --radius: 8px;
    --font: "Gopher", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --font-heavy: "Gopher", "Arial Black", "Segoe UI", system-ui, sans-serif;
    --shadow: 0 18px 40px rgba(0, 0, 0, .16);
    --maxw: 1728px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--yellow);
    line-height: 1.3;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); }
.d-none { display: none !important; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: #000; color: #fff; padding: .6rem 1rem; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid #000; outline-offset: 2px; }

/* ------------------------------- Header (langue) ----------------------- */
.site-header { position: absolute; top: 0; right: 0; z-index: 40; padding: clamp(1rem, 2.2vw, 2.4rem) clamp(1.2rem, 3vw, 3.5rem); }
.lang-switcher { position: relative; }
.lang-switcher > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
    font-family: var(--font); font-weight: 700; font-size: clamp(1.1rem, 1.6vw, 1.7rem); color: #000;
}
.lang-switcher > summary::-webkit-details-marker { display: none; }
.lang-caret { width: clamp(10px, 1vw, 15px); }
.lang-menu { position: absolute; right: 0; margin-top: .4rem; background: #fff; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; min-width: 64px; }
.lang-menu a { display: block; padding: .5rem .9rem; text-decoration: none; font-weight: 700; color: #000; }
.lang-menu a.active { background: var(--yellow); }
.lang-menu a:hover { background: #f2f2f2; }

/* ------------------------------- Flash --------------------------------- */
.flash-wrap { max-width: 900px; margin: 1rem auto 0; padding: 0 20px; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius); border: 2px solid transparent; font-weight: 700; background: #fff; box-shadow: var(--shadow); }
.alert-success { border-color: var(--green); color: #1f7a1f; }
.alert-danger { border-color: #e0a0a0; color: #b3261e; }
.alert-warning { border-color: #f0d68a; color: #8a6d1a; }
.alert-close { background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; }

/* =============================== HERO ================================== */
.hero {
    position: relative;
    background: var(--yellow) url("../images/figma/bg-cheese.jpg") center top / cover no-repeat;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.hero-inner { position: relative; z-index: 2; width: 100%; display: flex; flex-direction: column; align-items: center; }
.hero-logo { width: 100%; display: flex; justify-content: center; }
.ld-logo--hero { width: clamp(190px, 34vw, 430px);margin-top: -1rem;  }

/* Scène = visuel sandwichs + titre (SVG) superposé */
.hero-stage { display: flex; flex-direction: column-reverse; align-items: center; gap: clamp(.6rem, 2vw, 1.2rem); width: 100%; margin-top: -2rem;padding-bottom: 1.5rem; }
.hero-visual { display: block; width: 100%; }
.hero-visual img { width: 100%; height: auto; display: block; margin: 0 auto; }
.hero-headline { display: flex; align-items: center; justify-content: center; width: 100%; }
.hero-headline-img { width: clamp(240px, 64vw, 480px); max-width: 92vw; height: auto; }

/* Flèche (à cheval sur le hero et la section suivante) */
.hero-arrow { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 23%); z-index: 5; margin: 0; line-height: 0; }
.hero-arrow img { width: clamp(90px, 12vw, 190px); }

/* Fond dédié mobile */
@media (max-width: 767px) {
    .hero { background-image: url("../images/figma/hero_mobile_background.webp"); }
    .hero-visual img { width: 94vw; }
}

/* Desktop : titre superposé au visuel des sandwichs, flèche dessous */
@media (min-width: 992px) {
    .hero { padding-bottom: 0; }
    .hero-inner { max-width: 1500px; margin: 0 auto; }
    .hero-stage { position: relative; display: block; margin-top: clamp(-2.5rem, -2vw, -3rem);padding-bottom: 3rem; }
    .hero-visual img { width: 100%; }
    .hero-headline { position: absolute; inset: 0;top: -75%; }
    .hero-headline-img { width: clamp(360px, 40vw, 680px); }
    .ld-logo--hero{ width: clamp(360px, 40vw, 680px);margin-top: clamp(-5.5rem, -5vw, -5.5rem);}
}

/* =============================== DOTATION ============================== */
.prize { background: var(--yellow); padding: clamp(2rem, 4vw, 4rem) 20px clamp(2.5rem, 4vw, 4rem); text-align: center; }
.prize-inner { max-width: var(--maxw); margin: 0 auto; }
.prize-title { font-family: var(--font-heavy); font-weight: 900; text-transform: uppercase; color: #000; font-size: clamp(1.6rem, 4.6vw, 4.7rem); line-height: .95; margin: 0 auto .8rem; max-width: 20ch; overflow-wrap: break-word; }
.prize-subtitle { font-family: var(--font); font-weight: 500; color: #000; font-size: clamp(1rem, 1.7vw, 1.7rem); line-height: 1.26; max-width: 62vw; margin: 0 auto; margin-top: 2rem; }

.packshots { display: flex; justify-content: center; align-items: center; flex-wrap: nowrap; gap: clamp(.2rem, 1vw, 1rem); margin: 0 auto; }
.packshot { width: 100%; }

.prize-text { font-family: var(--font); font-weight: 500; color: #000; font-size: clamp(1rem, 1.65vw, 1.65rem); line-height: 1.26; width: 100%; margin: 0 auto;padding-top: 2rem; }
.prize-text strong { font-family: var(--font-heavy); font-weight: 900; }

/* ============================= FORMULAIRE ============================= */
.participation { background: var(--green); padding: clamp(2.5rem, 5vw, 5rem) 20px clamp(3rem, 5vw, 5rem); }
.participation-inner { max-width: 1112px; margin: 0 auto; }
.participation-title { font-family: var(--font-heavy); font-weight: 900; text-transform: uppercase; color: #000; text-align: center; line-height: .95; font-size: clamp(1.3rem, 3.5vw, 4.6rem); margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); overflow-wrap: break-word; }
.participation-title span { display: block; }

.participation-form { width: 100%;max-width: 89vw; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 1.6vw, 1.4rem) clamp(1rem, 2vw, 1.6rem); }
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--font); font-weight: 500; color: #000; font-size: clamp(1.05rem, 1.7vw, 1.8rem); margin-bottom: .35rem; }
/* Astérisque « champ obligatoire » (le libellé du règlement contient déjà son propre *) */
.form-grid > .field:not(.upload-row) > label.required::after { content: " *"; }

.form-control {
    width: 100%; font-family: var(--font); font-size: clamp(1rem, 1.3vw, 1.3rem); color: #000;
    background: #fff; border: 1.5px solid var(--input-border); border-radius: var(--radius);
    padding: clamp(.7rem, 1vw, 1.05rem) clamp(.8rem, 1vw, 1.1rem);
}
.form-control:focus { outline: none; border-color: #000; box-shadow: 0 0 0 3px rgba(0, 0, 0, .12); }

/* Ligne upload + case à cocher */
.upload-row { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.upload { position: relative; flex: 0 1 1px; min-width: 0; }

@media (min-width: 700px) {
    .upload { flex: 0 1 543px; min-width: 0; }
    .participation-form { width: 100%;max-width: 57vw; margin: 0 auto; }

}

/* Input transparent superposé au bouton : cliquable ET focusable (validation native). */
.file-native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.upload-btn {
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    background: #fff; border-radius: var(--radius); padding: clamp(.75rem, 1vw, 1.1rem) clamp(1.2rem, 2vw, 2rem);
    width: 100%; min-width: 0; min-height: 62px;
}
.upload-text { font-family: var(--font); font-weight: 700; font-size: clamp(1rem, 1.4vw, 1.56rem); color: #000; text-decoration: underline; text-align: center; }
.file-native:focus + .upload-btn { outline: 3px solid #000; outline-offset: 2px; }

.rules-check { display: flex; align-items: center; gap: .6rem; }
.rules-check .form-check { display: contents; }
.rules-check input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; flex: 0 0 auto; margin: 0; cursor: pointer;
    width: clamp(26px, 2vw, 35px); height: clamp(26px, 2vw, 35px);
    background: #fff; border: 1.5px solid var(--input-border); border-radius: 7px;
}
.rules-check input[type="checkbox"]:checked { background: #000; border-color: #000; position: relative; }
.rules-check input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 32%; top: 12%; width: 28%; height: 55%; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.rules-text { font-family: var(--font); font-weight: 500; font-size: clamp(.95rem, 1.35vw, 1.35rem); color: #000; line-height: 1.25; }
.rules-label { margin: 0; cursor: pointer; }
.rules-label::after { content: none; }
.rules-link { color: #000; text-decoration: underline; }

/* Bouton d'envoi */
.btn-cta {
    display: flex; align-items: center; justify-content: center; gap: .6rem;
    width: 100%; margin-top: clamp(1.2rem, 2.5vw, 2.5rem); cursor: pointer; border: none;
    background: #000; color: #fff; border-radius: var(--radius);
    font-family: var(--font-heavy); font-weight: 900; text-transform: uppercase;
    font-size: clamp(1rem, 1vw, 1rem); padding: clamp(.85rem, 1.4vw, 1.4rem);
    transition: transform .12s ease, background .2s ease;
}
.btn-cta:hover { background: #1a1a1a; }
.btn-cta:active { transform: translateY(1px); }
.btn-cta[disabled] { opacity: .7; cursor: not-allowed; }
.participation-obligation { text-align: center; margin: .9rem 0 0; font-size: .85rem; }
.participation-obligation a { color: #000; }

/* Erreurs */
.participation-form .invalid-feedback,
.participation-form .form-error-message,
.participation-form ul { display: block; color: #4a0a0a; font-weight: 700; font-size: .9rem; margin: .3rem 0 0; padding: 0; list-style: none; }
.rules-errors { margin-top: -.4rem; }
.is-invalid { border-color: #7a0b0b !important; }

/* Spinner */
.spinner-border { display: inline-block; width: 1.1rem; height: 1.1rem; border: .18em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ld-spin .7s linear infinite; }
.spinner-border-sm { width: .95rem; height: .95rem; }
@keyframes ld-spin { to { transform: rotate(360deg); } }

/* ============================ REMERCIEMENT ============================ */
.thankyou { background: var(--yellow); padding: clamp(2.5rem, 5vw, 5rem) 20px clamp(3rem, 5vw, 5rem); text-align: center; }
.thankyou-inner { max-width: 1300px; margin: 0 auto; }
.thankyou-title { font-family: var(--font-heavy); font-weight: 900; text-transform: uppercase; color: #000; line-height: .95; font-size: clamp(2rem, 4.6vw, 4.7rem); margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); }
.thankyou-title span { display: block; }
.thankyou-text { font-family: var(--font); font-weight: 500; color: #000; font-size: clamp(1.05rem, 1.9vw, 2rem); line-height: 1.4; margin: 0; }

/* ================================ LOGIN =============================== */
.page-login { background: var(--yellow) url("../images/figma/bg-cheese.jpg") center / cover fixed; }
.login-wrap { min-height: 90vh; display: flex; align-items: center; justify-content: center; padding: 5rem 1rem 2rem; }
.login-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 2.5rem; width: 100%; max-width: 420px; }
.login-card h1 { font-family: var(--font-heavy); font-weight: 900; text-transform: uppercase; font-size: 1.4rem; text-align: center; margin: 1rem 0 1.5rem; }
.login-card .ld-logo--hero { width: 180px; margin: 0 auto; }
.login-card .form-label { display: block; font-weight: 700; margin-bottom: .35rem; }
.login-card .mb-3 { margin-bottom: 1rem; }
.login-card .btn-brand { width: 100%; }
.btn-brand { display: inline-flex; align-items: center; justify-content: center; background: #000; color: #fff; border: none; border-radius: var(--radius); font-family: var(--font-heavy); font-weight: 900; text-transform: uppercase; padding: .9rem 1.6rem; font-size: 1.05rem; cursor: pointer; text-decoration: none; }
.btn-lg { padding: 1rem 2rem; }
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }

/* =============================== FOOTER =============================== */
.site-footer { background: var(--yellow) url("../images/figma/bg-cheese.jpg") center bottom / cover no-repeat; text-align: center; padding: 0 20px clamp(1.5rem, 2.5vw, 2.5rem); }
.footer-logo { display: inline-block; }
.ld-logo--footer { width: clamp(180px, 22vw, 320px); margin: 0 auto; }
.footer-links { list-style: none; padding: 0; margin: .5rem 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem clamp(1rem, 3vw, 3rem); justify-content: center;margin-top: -2rem;
    padding-bottom: 4rem; }
.footer-links a { color: #000; text-decoration: none; font-family: var(--font); font-weight: 400; font-size: clamp(.85rem, 1.3vw, 1.25rem); }
.footer-links a:hover { text-decoration: underline; }
.footer-legal { font-size: .78rem; color: #4a3f16; margin: 0; }

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

/* ========================= PAGE CHOIX DE LANGUE ======================= */
.page-language .site-header,
.page-language .site-footer { display: none; }

.lang-page {
    min-height: 100vh;
    background: var(--yellow) url("../images/figma/bg-cheese.jpg") center / cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: clamp(2rem, 6vw, 4rem) 20px;
}
.lang-page__inner { width: 100%; max-width: 900px; }
.lang-logo { margin: 0 auto clamp(1.5rem, 4vw, 2.5rem); width: clamp(200px, 42vw, 380px); }
.lang-logo .ld-logo { width: 100%; margin: 0 auto; }
.lang-title {
    font-family: var(--font-heavy); font-weight: 900; text-transform: uppercase; color: #000;
    line-height: 1.08; margin: 0 0 clamp(1.8rem, 4vw, 2.8rem);
}
.lang-title span { display: block; font-size: clamp(1.3rem, 3.4vw, 2.6rem); }
.lang-choices { display: flex; flex-wrap: wrap; gap: clamp(.8rem, 2vw, 1.5rem); justify-content: center; }
.lang-choice {
    display: inline-flex; align-items: center; justify-content: center; min-width: 220px;
    background: #000; color: #fff; text-decoration: none;
    font-family: var(--font-heavy); font-weight: 900; text-transform: uppercase;
    font-size: clamp(1.1rem, 2vw, 1.5rem); padding: clamp(.9rem, 1.6vw, 1.3rem) 2rem;
    border-radius: var(--radius); box-shadow: var(--shadow);
    transition: transform .12s ease, background .2s ease;
}
.lang-choice:hover { background: #1a1a1a; }
.lang-choice:active { transform: translateY(1px); }

/* ------------------------------ Responsive ---------------------------- */
@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
    .upload-row { flex-direction: column; align-items: stretch; }
    .upload-btn { min-width: 100%; }
    .lang-choice { min-width: 100%; }
}
