/* ── Newsletter Page ───────────────────────────────────────────── */
header:before {
  opacity: 1;
}

.newsletter .hero {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 140px 0 160px;
  box-sizing: border-box;
  overflow: hidden;
}

.newsletter .hero .container {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

/* ── Left column ── */
.newsletter .hero .inner-container.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 570px;
  flex-shrink: 0;
}

.newsletter .hero h1 {
  font-size: 45px;
  line-height: 1.111;
  margin: 0;
  color: var(--qvac-green);
}

.newsletter .hero p {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.3;
  color: var(--qvac-white);
  margin: 0;
}

/* ── Right column ── */
.newsletter .hero .inner-container.visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.newsletter-hero-img {
  width: 652px;
  max-width: 100%;
  display: block;
}

/* ── Form wrapper ── */
.newsletter-form-wrapper {
  width: 505px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Label ── */
.newsletter-label {
  display: block;
  font-family: "Inconsolata", sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 14px;
  color: #a0b2ac;
  cursor: default;
  user-select: none;
  transition: color 0.2s ease;
}

.newsletter-label.has-error {
  color: #f05454;
}

/* ── Strip MailerLite container chrome ── */
.newsletter-form-wrapper .ml-form-embedContainer,
.newsletter-form-wrapper .ml-form-align-center,
.newsletter-form-wrapper .ml-form-embedWrapper,
.newsletter-form-wrapper .ml-form-embedBody {
  all: unset;
  display: block !important;
}

/* Hide MailerLite's default heading */
.newsletter-form-wrapper .ml-form-embedContent {
  display: none !important;
}

/* Hide MailerLite's built-in success body (we use our toast) */
.newsletter-form-wrapper .ml-form-successBody {
  display: none !important;
}

/* Form column layout */
.newsletter-form-wrapper .ml-block-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.newsletter-form-wrapper .ml-form-formContent,
.newsletter-form-wrapper .ml-form-fieldRow {
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Input bar (.ml-field-group) ── */
.newsletter-form-wrapper .ml-field-group.ml-field-email {
  display: flex !important;
  align-items: center !important;
  padding: 14px 16px !important;
  background-color: var(--qvac-black) !important;
  border: 1px solid var(--qvac-green) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.newsletter-form-wrapper .ml-field-group.ml-field-email:focus-within {
  box-shadow: 0 0 0 2px rgba(22, 227, 193, 0.15) !important;
}

.newsletter-form-wrapper .ml-field-group.ml-field-email.has-error {
  border-color: #f05454 !important;
  box-shadow: 0 0 0 2px rgba(240, 84, 84, 0.15) !important;
}

/* ── Email input ── */
.newsletter-form-wrapper input.form-control[type="email"] {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: "Inconsolata", sans-serif !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  letter-spacing: 0.5px !important;
  line-height: 16px !important;
  color: var(--qvac-white) !important;
  caret-color: var(--qvac-green);
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.newsletter-form-wrapper input.form-control[type="email"]::placeholder {
  color: #a0b2ac !important;
}

/* ── Injected error message ── */
.newsletter-form-wrapper p.newsletter-error {
  font-family: "Inconsolata", sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 14px;
  color: #f05454;
  margin: 0 !important;
  padding: 0 !important;
}

.newsletter-form-wrapper p.newsletter-error:empty {
  display: none;
}

/* ── Submit row ── */
.newsletter-form-wrapper .ml-form-embedSubmit {
  display: flex !important;
  justify-content: flex-end !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
}

/* ── Submit button (button.primary) ── */
.newsletter-form-wrapper button.primary {
  background-color: var(--qvac-green) !important;
  border: 2px solid var(--qvac-green) !important;
  color: var(--qvac-black) !important;
  border-radius: 8px !important;
  font-family: "Inconsolata", sans-serif !important;
  font-weight: 500 !important;
  font-size: 15px !important;
  letter-spacing: 1px !important;
  line-height: 16px !important;
  text-transform: capitalize !important;
  padding: 8px 16px !important;
  min-height: 32px;
  cursor: pointer !important;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
  width: auto !important;
}

.newsletter-form-wrapper button.primary:hover {
  background-color: var(--qvac-dark-green) !important;
  border-color: var(--qvac-dark-green) !important;
}

/* Error state — submit button turns white */
.newsletter-form-wrapper button.primary.has-error {
  background-color: var(--qvac-white) !important;
  border-color: var(--qvac-white) !important;
  color: var(--qvac-black) !important;
}

.newsletter-form-wrapper button.primary.has-error:hover {
  background-color: #d0ddd7 !important;
  border-color: #d0ddd7 !important;
}

/* ── Loading button (button.loading) ── */
.newsletter-form-wrapper button.loading {
  background-color: var(--qvac-green) !important;
  border: 2px solid var(--qvac-green) !important;
  color: var(--qvac-black) !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  min-height: 32px;
  cursor: wait !important;
  width: auto !important;
  white-space: nowrap;
}

/* MailerLite spinner inside button.loading */
.newsletter-form-wrapper .ml-form-embedSubmitLoad {
  display: inline-block;
  vertical-align: middle;
  width: 10px !important;
  height: 10px !important;
  border: 2px solid rgba(23, 24, 23, 0.3) !important;
  border-top-color: var(--qvac-black) !important;
  border-radius: 50% !important;
  animation: nl-spin 0.7s linear infinite !important;
}

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

/* ── Success toast ────────────────────────────────────────────── */

.newsletter-toast {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 24, 23, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.newsletter-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.newsletter-toast-card {
  position: relative;
  background: #292929;
  border: 1px solid var(--qvac-green);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow:
    1px 1px 0 0 var(--qvac-green),
    2px 2px 0 0 var(--qvac-green),
    3px 3px 0 0 var(--qvac-green);
  overflow: hidden;
  width: 380px;
  max-width: calc(100vw - 32px);
  transform: translateY(12px);
  transition: transform 0.3s ease;
}

.newsletter-toast.is-visible .newsletter-toast-card {
  transform: translateY(0);
}

/* ── Toast close (×) button — top-right ── */
.newsletter-toast-close {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #a0b2ac;
  padding: 0;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.newsletter-toast-close:hover {
  color: var(--qvac-white);
  background-color: rgba(255, 255, 255, 0.08);
}

/* ── Toast info row ── */
.newsletter-toast-info {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.newsletter-toast-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  line-height: 0;
}

.newsletter-toast-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.newsletter-toast-title {
  font-family: "Inconsolata", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  line-height: 16px;
  color: var(--qvac-white);
  margin: 0;
}

.newsletter-toast-body {
  font-family: "Inconsolata", sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.5px;
  line-height: 16px;
  color: var(--qvac-white);
  margin: 0;
}

/* ── Toast actions row ── */
.newsletter-toast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.newsletter-toast-btn-close {
  background-color: var(--qvac-white);
  border: 2px solid var(--qvac-white);
  color: var(--qvac-black);
  border-radius: 8px;
  font-family: "Inconsolata", sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 1px;
  line-height: 16px;
  text-transform: capitalize;
  padding: 8px 16px;
  min-height: 32px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.newsletter-toast-btn-close:hover {
  background-color: #d0ddd7;
  border-color: #d0ddd7;
}

/* ── Mobile fade-in animation ─────────────────────────────────── */
@keyframes nl-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 991.98px) {
  .newsletter .hero h1,
  .newsletter .hero > .container > .inner-container.content > p,
  .newsletter-form-wrapper,
  .newsletter .hero .inner-container.visual {
    opacity: 0;
    animation: nl-fade-in 0.5s ease forwards;
  }

  .newsletter .hero h1 {
    animation-delay: 0.1s;
  }
  .newsletter .hero > .container > .inner-container.content > p {
    animation-delay: 0.3s;
  }
  .newsletter-form-wrapper {
    animation-delay: 0.5s;
  }
  .newsletter .hero .inner-container.visual {
    animation-delay: 0.7s;
  }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .newsletter .hero {
    padding: 50px 0 80px;
  }

  .newsletter .hero .container {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .newsletter .hero .inner-container.content {
    align-items: center;
  }

  .newsletter .hero h1 {
    font-size: 22px;
    line-height: 28px;
    text-align: center;
  }

  .newsletter .hero p {
    font-size: 13px;
    line-height: 18px;
    text-align: center;
  }

  .newsletter-form-wrapper {
    width: 100%;
  }

  /* Centre label and error messages */
  .newsletter-label {
    text-align: center;
    display: block;
    width: 100%;
  }

  .newsletter-error {
    text-align: center;
  }

  /* Full-width submit button */
  .newsletter-submit-row {
    justify-content: stretch;
  }

  .newsletter-btn-submit {
    width: 100%;
  }

  /* Image below form, square, full width */
  .newsletter .hero .inner-container.visual {
    width: 100%;
    justify-content: center;
  }

  .newsletter-hero-img {
    width: 100%;
    max-width: 361px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }

  .newsletter-toast-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .newsletter-toast-btn-close {
    width: 100%;
  }
}
