/**
 * Mon Chai - Landing Page Styles
 * ============================================================
 * REPRODUCTION EXACTE de la page Canva (Page 1)
 * https://monchailanding.my.canva.site/le-futur-de-votre-gestion-viticole-arrive
 *
 * SPEC CANVA EXTRAITES :
 *   Font          : Poppins (Regular + Bold)
 *   Card bg       : #feefde
 *   Text          : #471217
 *   Overlay       : #471217 @ 93%
 *   Trait/divider  : SVG recoloré #dfb780
 *   CTA           : #471217 bg, #ffffff text
 *   Input         : #ffffff bg, #471217 1px border
 *   Card radius   : ~22-26px (18/64 units scaled)
 *   Card shadow   : blur 20, dist 10, -45°, black 51%
 *
 *   Title  : 45.74px Poppins, tracking -0.056em, leading 1.09
 *   Lead   : 21.33px Poppins, tracking -0.038em, leading 1.16
 *   Email  : 21.33px Poppins, color #471217
 *   CTA    : 19.39px Poppins, text-shadow
 *   Consent: 14.67px Poppins, tracking -0.091em, leading 1.36
 *   Footer : 14.66px Poppins Bold, underline
 *
 *   Card proportions (at 1366×768) :
 *     Card width   : 531px (38.9% vw)
 *     Logo         : 44.5% of card width
 *     Divider      : 33.7% of card width
 *     Title/Lead   : 85% of card width
 *     Email input  : 85.3% of card width
 *     CTA button   : 68.8% of card width (narrower than input)
 *     Consent      : 79.2% of card width
 * ============================================================
 */

/* ================================================================
   CSS Variables — exact Canva values
   ================================================================ */
:root {
  --color-bg: #471217;
  --color-card: #feefde;
  --color-text: #471217;
  --color-divider: #dfb780;
  --color-white: #ffffff;
  --radius-card: 24px;
  --radius-input: 24px;
  --radius-cta: 20px;
  --font: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #2a0a0e;
  font-family: var(--font);
}

body {
  min-width: 100vw;
  min-height: 100dvh;
  color: var(--color-text);
}

/* ================================================================
   Landing Container
   ================================================================ */
.landing {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  isolation: isolate;
}

/* ================================================================
   Background — vineyard photo + dark bordeaux overlay (93%)
   ================================================================ */
.bg-wrapper {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 15, 0.18);
}

.landing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(15, 8, 5, 0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

.landing::before {
  display: none;
}

/* ================================================================
   Card — #feefde, rounded, drop-shadow
   Canva: 531×700 at 1366×768 = 38.9% vw
   Shadow: blur 20, dist 10, -45°, black 51%
   ================================================================ */
.card {
  position: relative;
  width: min(94%, 540px);
  max-height: calc(100dvh - 24px);
  padding: 10px 40px 16px;
  border-radius: var(--radius-card);
  border: none;
  background: var(--color-card);
  box-shadow: 6px 8px 24px rgba(0, 0, 0, 0.42);
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.card::-webkit-scrollbar {
  display: none;
}

/* ================================================================
   Logo — 44.5% of card width
   ================================================================ */
.logo-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.logo {
  display: block;
  width: 44.5%;
  max-width: 240px;
  height: auto;
  object-fit: contain;
}

/* ================================================================
   Divider — trait SVG doré (#dfb780)
   Canva: 33.7% of card, height ~32px, tight spacing
   ================================================================ */
.divider {
  width: 33.7%;
  max-width: 180px;
  height: 32px;
  margin: 14px 0 2px;
  justify-self: center;
  overflow: visible;
}

.divider img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ================================================================
   Hero Title
   Canva: 45.74px Poppins, tracking -0.056em, leading 1.09
   ================================================================ */
.hero {
  margin: 0 auto 16px;
  width: 85.3%;
  text-align: center;
  font-family: var(--font);
  font-size: clamp(1.8rem, 3.35vw, 2.86rem);
  line-height: 1.09;
  letter-spacing: -0.056em;
  font-weight: 400;
  color: var(--color-text);
  justify-self: center;
}

.hero-line {
  display: block;
  white-space: nowrap;
}

/* ================================================================
   Lead Text
   Canva: 21.33px Poppins, tracking -0.038em, leading 1.16
   "un mois offert" = underline
   ================================================================ */
.lead {
  margin: 0 auto 22px;
  width: 85.3%;
  text-align: center;
  color: var(--color-text);
  font-family: var(--font);
  font-size: clamp(0.92rem, 1.56vw, 1.33rem);
  line-height: 1.16;
  letter-spacing: -0.038em;
  font-weight: 400;
  justify-self: center;
}

.lead strong {
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ================================================================
   Form — 85.3% of card width
   ================================================================ */
.form {
  width: 85.3%;
  display: grid;
  gap: 14px;
  margin: 0;
  justify-self: center;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* ================================================================
   Email Input
   Canva: white bg, 1px #471217 border, pill radius ~24px
   Shadow: blur 12, dist 10, -45°, black 69% (attenuated)
   Placeholder: 21.33px Poppins, #471217
   ================================================================ */
.email-input {
  width: 100%;
  height: 47px;
  padding: 0 22px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-text);
  outline: none;
  background: var(--color-white);
  color: var(--color-text);
  font-family: var(--font);
  font-size: clamp(0.92rem, 1.56vw, 1.33rem);
  font-weight: 400;
  box-shadow: 4px 5px 14px rgba(0, 0, 0, 0.22);
}

.email-input::placeholder {
  color: var(--color-text);
  opacity: 1;
}

.email-input:focus {
  border-color: var(--color-text);
  box-shadow:
    0 0 0 3px rgba(71, 18, 23, 0.12),
    4px 5px 14px rgba(0, 0, 0, 0.22);
}

/* ================================================================
   CTA Button — 68.8% of card = narrower than input
   Canva: #471217 bg, white text, 19.39px, rounded
   Text-shadow: blur 0.2, offset 0.6, -45°, black 28%
   ================================================================ */
.cta {
  width: 80.7%;
  justify-self: center;
  height: 47px;
  border: 1px solid var(--color-text);
  border-radius: var(--radius-cta);
  cursor: pointer;
  color: var(--color-white);
  font-family: var(--font);
  font-size: clamp(0.88rem, 1.42vw, 1.21rem);
  font-weight: 400;
  letter-spacing: 0;
  background: var(--color-text);
  box-shadow: 4px 5px 14px rgba(0, 0, 0, 0.22);
  text-shadow: 0.4px 0.4px 0.3px rgba(0, 0, 0, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.cta:hover,
.cta:focus-visible {
  outline: none;
  transform: translateY(-1px);
  background: #5a1a20;
  box-shadow: 5px 7px 18px rgba(0, 0, 0, 0.30);
}

.cta:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ================================================================
   Consent — checkbox + text
   Canva: 14.67px Poppins, tracking -0.091em, leading 1.36, justify
   ================================================================ */
.consent {
  width: 85.3%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 10px;
  align-items: start;
  margin-top: 18px;
  color: var(--color-text);
  font-family: var(--font);
  font-size: clamp(0.72rem, 1.07vw, 0.92rem);
  line-height: 1.36;
  letter-spacing: -0.091em;
  font-weight: 400;
  text-align: justify;
  cursor: pointer;
  justify-self: center;
}

.consent input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--color-text);
  cursor: pointer;
  border: 1px solid var(--color-text);
  border-radius: 2px;
}

.consent a {
  color: var(--color-text);
  text-decoration: underline;
}

.consent a:hover {
  opacity: 0.7;
}

/* ================================================================
   Footer Links
   Canva: 14.66px Poppins Bold, underline, #471217
   ================================================================ */
.footer-links {
  width: 85.3%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-bottom: 4px;
  font-family: var(--font);
  font-size: clamp(0.72rem, 1.07vw, 0.92rem);
  font-weight: 700;
}

.footer-links button {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: inherit;
  font-weight: inherit;
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.footer-links button:hover,
.footer-links button:focus-visible {
  outline: none;
  opacity: 0.65;
}

/* ================================================================
   Form Feedback
   ================================================================ */
.form-feedback {
  padding: 12px 16px;
  border-radius: 4px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-feedback--success {
  background: rgba(34, 139, 34, 0.12);
  color: #1a5c1a;
  border: 1px solid rgba(34, 139, 34, 0.25);
}

.form-feedback--error {
  background: rgba(180, 40, 40, 0.1);
  color: #8b1a1a;
  border: 1px solid rgba(180, 40, 40, 0.2);
}

/* ================================================================
   Language Switcher
   ================================================================ */
.lang-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(254, 239, 222, 0.92);
  border: 1px solid rgba(71, 18, 23, 0.15);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
}

.lang-btn:hover {
  background: var(--color-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lang-btn svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.lang-switcher.open .lang-btn svg {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  background: var(--color-card);
  border: 1px solid rgba(71, 18, 23, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown li {
  list-style: none;
}

.lang-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.1s ease;
}

.lang-dropdown button:hover {
  background: rgba(71, 18, 23, 0.06);
}

.lang-dropdown button.active {
  color: var(--color-text);
  font-weight: 700;
}

/* ================================================================
   Modal System
   ================================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(71, 18, 23, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: min(100%, 560px);
  max-height: calc(100dvh - 40px);
  background: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.modal.open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(71, 18, 23, 0.1);
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(71, 18, 23, 0.08);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-text);
  transition: background 0.15s ease;
}

.close-btn:hover {
  background: rgba(71, 18, 23, 0.15);
}

.legal-content {
  padding: 24px;
  overflow-y: auto;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
}

.legal-content h3 {
  margin: 20px 0 10px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.legal-content h3:first-child {
  margin-top: 0;
}

.legal-content p {
  margin: 0 0 12px;
}

.legal-content strong {
  color: var(--color-text);
}

/* ================================================================
   RESPONSIVE
   ================================================================
   Canva design: 531px card in 1366px viewport = 38.9% vw
   All proportions scale down. We use fixed pixel widths for
   logo, divider, etc. at each breakpoint to match Canva ratios.
   ================================================================ */

/* ----------------------------------------------------------------
   Large Desktop (1200px+)
   Card ≈ 540px max, generous spacing
   ---------------------------------------------------------------- */
@media (min-width: 1200px) {
  .card {
    width: min(42%, 560px);
    padding: 12px 44px 18px;
  }

  .hero {
    font-size: clamp(2.2rem, 3.35vw, 2.86rem);
    transform: translateX(-20px)
  }

  .lead {
    font-size: clamp(1.1rem, 1.7vw, 1.5rem);
  }
}

@media (min-width: 1500px) {
  .lead {
    font-size: clamp(0.2rem, 1.2vw, 1.6rem);
  }
}

/* ----------------------------------------------------------------
   Tablet (max 900px) — card fills more
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .card {
    width: min(88%, 520px);
    padding: 10px 32px 16px;
  }

  .hero {
    font-size: clamp(1.6rem, 4.8vw, 2.6rem);
  }

  .lead {
    font-size: clamp(0.88rem, 2.4vw, 1.18rem);
  }
}

/* ----------------------------------------------------------------
   Mobile (max 680px)
   ---------------------------------------------------------------- */
@media (max-width: 680px) {
  .landing {
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .card {
    width: min(96%, 480px);
    max-height: calc(100dvh - 16px);
    padding: 8px 24px 14px;
    border-radius: 20px;
  }

  .logo {
    max-width: 200px;
  }

  .divider {
    max-width: 150px;
    height: 26px;
    margin: 10px 0 2px;
  }

  .hero {
    font-size: clamp(1.5rem, 5.8vw, 2.2rem);
    margin: 0 0 12px;
  }

  .hero-line {
    white-space: normal;
  }

  .lead {
    font-size: clamp(0.84rem, 3.2vw, 1.08rem);
    margin: 0 0 16px;
  }

  .email-input {
    height: 44px;
    font-size: 0.95rem;
    padding: 0 18px;
  }

  .cta {
    height: 44px;
    font-size: 0.95rem;
  }

  .consent {
    font-size: 0.7rem;
    margin-top: 14px;
  }

  .footer-links {
    margin-top: 28px;
    font-size: 0.7rem;
    gap: 14px;
  }

  .lang-switcher {
    top: 8px;
    right: 8px;
  }

  .lang-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* ----------------------------------------------------------------
   Small Mobile (max 420px) or Short viewport (max-height 760px)
   ---------------------------------------------------------------- */
@media (max-width: 420px), (max-height: 760px) {
  .card {
    width: min(97%, 420px);
    padding: 8px 20px 12px;
    border-radius: 18px;
  }

  .logo {
    max-width: 170px;
  }

  .divider {
    max-width: 130px;
    height: 22px;
    margin: 8px 0 2px;
  }

  .hero {
    font-size: clamp(1.35rem, 5.5vw, 1.9rem);
    margin: 0 0 10px;
  }

  .lead {
    font-size: clamp(0.78rem, 2.8vw, 0.95rem);
    margin: 0 0 12px;
  }

  .form {
    gap: 10px;
  }

  .email-input {
    height: 42px;
    font-size: 0.88rem;
    padding: 0 16px;
    border-radius: 20px;
  }

  .cta {
    height: 42px;
    font-size: 0.88rem;
    border-radius: 18px;
  }

  .consent {
    font-size: 0.65rem;
    margin-top: 12px;
  }

  .footer-links {
    margin-top: 22px;
    font-size: 0.65rem;
    gap: 12px;
  }
}

/* ----------------------------------------------------------------
   Very Short Screens (max-height 620px)
   ---------------------------------------------------------------- */
@media (max-height: 620px) {
  .landing {
    padding: 6px;
  }

  .card {
    max-height: calc(100dvh - 12px);
    padding: 6px 18px 10px;
    gap: 0;
  }

  .logo {
    max-width: 140px;
  }

  .divider {
    max-width: 110px;
    height: 18px;
    margin: 6px 0 1px;
  }

  .hero {
    font-size: clamp(1.2rem, 3.8vh, 1.65rem);
    margin: 0 0 6px;
  }

  .lead {
    font-size: clamp(0.7rem, 1.8vh, 0.88rem);
    margin: 0 0 8px;
  }

  .form {
    gap: 6px;
  }

  .email-input {
    height: 38px;
    font-size: 0.82rem;
    padding: 0 14px;
  }

  .cta {
    height: 38px;
    font-size: 0.82rem;
    border-radius: 16px;
  }

  .consent {
    font-size: 0.58rem;
    margin-top: 8px;
  }

  .footer-links {
    margin-top: 14px;
    font-size: 0.58rem;
    gap: 10px;
  }
}

/* ----------------------------------------------------------------
   Wide but Short (Nest Hub, etc.)
   ---------------------------------------------------------------- */
@media (min-width: 900px) and (max-height: 650px) {
  .card {
    width: min(46%, 480px);
    padding: 6px 28px 10px;
    gap: 0;
  }

  .logo {
    max-width: 130px;
  }

  .divider {
    max-width: 100px;
    height: 16px;
    margin: 6px 0 1px;
  }

  .hero {
    font-size: clamp(1.2rem, 3.5vh, 1.6rem);
    margin: 0 0 6px;
  }

  .lead {
    font-size: clamp(0.68rem, 1.7vh, 0.85rem);
    margin: 0 0 8px;
  }

  .email-input {
    height: 36px;
    font-size: 0.8rem;
    padding: 0 14px;
  }

  .cta {
    height: 36px;
    font-size: 0.8rem;
  }

  .consent {
    font-size: 0.56rem;
    margin-top: 6px;
  }

  .footer-links {
    margin-top: 12px;
    font-size: 0.56rem;
    gap: 10px;
  }
}
