/* =====================================================================
   Les Alpinistes Newsletter — Frontend widget
   Inspiration Alpine Cars : zéro border-radius, lignes filaires,
   typographie espacée, accent #0057B8.
   Hérite des variables CSS Swyft (--cs-*) pour dark/light mode auto.
   ===================================================================== */

.lan-block {
  --lan-alpine: #0057b8;
  --lan-alpine-light: #1a6fd4;
  --lan-block-max-width: 480px;
  display: block;
  box-sizing: border-box;
}
.lan-block * {
  box-sizing: border-box;
}

/* Block alignment (Gutenberg). */
.lan-block--align-center .lan-widget {
  margin-left: auto;
  margin-right: auto;
}
.lan-block--align-left .lan-widget {
  margin-left: 0;
  margin-right: auto;
}
.lan-block--align-right .lan-widget {
  margin-left: auto;
  margin-right: 0;
}

/* Default: shortcode usage outside a block — center by default. */
.lan-widget {
  max-width: var(--lan-block-max-width, 480px);
  margin: 0 auto;
  padding: 32px 28px;
  color: var(--cs-color-primary, #fff);
  font-family: var(--cs-font-base-family, "Helvetica Neue", Arial, sans-serif);
  background: var(--cs-layout-background, transparent);
  border: 1px solid var(--cs-color-border, rgba(255, 255, 255, 0.12));
  border-top: 2px solid var(--lan-alpine);
  border-radius: 0;
}

.lan-block--minimal .lan-widget {
  background: transparent;
  border: none;
  border-top: 2px solid var(--lan-alpine);
  padding: 24px 0 0;
}

/* Header */
.lan-widget__eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--lan-alpine);
  font-weight: 700;
}
.lan-widget__title {
  margin: 0 0 8px;
  font-family: var(--cs-font-headings-family, "Helvetica Neue", Arial, sans-serif);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -0.2px;
  color: var(--cs-color-primary, inherit);
}
.lan-widget__subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cs-color-secondary, rgba(255, 255, 255, 0.65));
}

/* Form fields */
.lan-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lan-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lan-field label,
.lan-field__label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--cs-color-secondary, rgba(255, 255, 255, 0.65));
}
.lan-field__opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--cs-color-secondary, rgba(255, 255, 255, 0.45));
}
.lan-field input[type="text"],
.lan-field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--cs-site-background, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--cs-color-border, rgba(255, 255, 255, 0.15));
  border-radius: 0;
  color: var(--cs-color-primary, inherit);
  font: inherit;
  transition: border-color 0.2s ease;
}
.lan-field input:focus {
  outline: none;
  border-color: var(--lan-alpine);
}

/* Checkboxes */
.lan-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.lan-check {
  display: flex;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  align-items: flex-start;
}
.lan-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lan-check__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--cs-color-border, rgba(255, 255, 255, 0.25));
  border-radius: 0;
  background: transparent;
  margin-top: 2px;
  position: relative;
  transition: all 0.15s ease;
}
.lan-check input:checked + .lan-check__box {
  background: var(--lan-alpine);
  border-color: var(--lan-alpine);
}
.lan-check input:checked + .lan-check__box::after {
  content: "";
  position: absolute;
  inset: 3px;
  background:
    linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  /* Use a checkmark via SVG mask for crispness */
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='square' d='M3 8l3.5 3.5L13 5'/></svg>")
    center / 12px no-repeat;
}
.lan-check__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--cs-color-primary, inherit);
}
.lan-check__text strong {
  display: block;
  font-weight: 600;
}
.lan-check__text em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--cs-color-secondary, rgba(255, 255, 255, 0.55));
  margin-top: 2px;
}
.lan-check__text--small {
  font-size: 12px;
  line-height: 1.5;
  color: var(--cs-color-secondary, rgba(255, 255, 255, 0.65));
}
.lan-check__text--small a {
  color: var(--lan-alpine);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lan-field--gdpr {
  margin-top: 4px;
}

/* Turnstile */
.lan-turnstile {
  margin-top: 4px;
}

/* Submit button — sharp, Alpine */
.lan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  padding: 14px 24px;
  background: var(--lan-alpine);
  color: #fff;
  border: 1px solid var(--lan-alpine);
  border-radius: 0;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}
.lan-btn:hover {
  background: var(--lan-alpine-light);
}
.lan-btn:focus-visible {
  outline: 2px solid var(--lan-alpine-light);
  outline-offset: 2px;
}

.lan-privacy-note {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  color: var(--cs-color-secondary, rgba(255, 255, 255, 0.45));
}

/* Notices */
.lan-notice {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--cs-color-border, rgba(255, 255, 255, 0.15));
  border-left: 2px solid var(--lan-alpine);
  border-radius: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cs-color-primary, inherit);
}
.lan-notice--success {
  border-left-color: #2ebd6b;
}
.lan-notice--error {
  border-left-color: #e5484d;
}
.lan-notice--info {
  border-left-color: var(--lan-alpine);
}

/* Preferences extras */
.lan-prefs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}
.lan-link-unsub {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cs-color-secondary, rgba(255, 255, 255, 0.55));
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.lan-link-unsub:hover {
  color: var(--cs-color-primary, inherit);
}

/* Honeypot already hidden inline; safety net */
.lan-hp {
  position: absolute !important;
  left: -9999px !important;
}
