/* ============================================
   Application modal
   Matches site design: #1B4626 primary, Geologica font,
   32px button radius, 24px card radius, 0.2s transitions
   ============================================ */

/* ── Overlay ──────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal--open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

/* ── Window ───────────────────────────────── */
.modal__window {
  position: relative;
  z-index: 1;
  display: flex;
  width: 880px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2), 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* ── Left image ───────────────────────────── */
.modal__picture {
  flex: 0 0 40%;
  position: relative;
  overflow: hidden;
}

.modal__picture img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ── Right side ───────────────────────────── */
.modal__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 52px 44px 44px;
  overflow-y: auto;
  position: relative;
}

/* ── Close button ─────────────────────────── */
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: background-color 0.2s ease-in-out;
  font-family: system-ui, sans-serif;
  flex-shrink: 0;
}

.modal__close:hover {
  background: rgba(0, 0, 0, 0.14);
}

/* ── Content wrapper ──────────────────────── */
.modal__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Heading ──────────────────────────────── */
.modal__heading {
  font-size: 26px;
  font-weight: 600;
  color: #000000;
  text-transform: uppercase;
  line-height: 1.25;
  margin-bottom: 10px;
  font-family: 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.modal__subheading {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.55;
  margin-bottom: 32px;
}

/* ── Form ─────────────────────────────────── */
.modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal__input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  font-family: 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: #333;
  background: #ffffff;
  transition: border-color 0.2s ease-in-out;
  outline: none;
  -webkit-appearance: none;
}

.modal__input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

.modal__input:focus {
  border-color: #1b4626;
}

.modal__input--error {
  border-color: #d32f2f !important;
}

/* ── Inline error messages ────────────────── */
.modal__error {
  font-size: 12px;
  color: #d32f2f;
  padding-left: 4px;
  display: none;
}

.modal__error--visible {
  display: block;
}

/* ── Consent checkbox ─────────────────────── */
.modal__checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.modal__checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: #1b4626;
  cursor: pointer;
}

.modal__checkbox-text {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  line-height: 1.65;
}

.modal__link {
  color: #1b4626;
  text-decoration: underline;
  transition: color 0.2s ease-in-out;
}

.modal__link:hover {
  color: #15381e;
}

/* ── Submit button ────────────────────────── */
.modal__submit {
  margin-top: 6px;
  justify-content: center;
  width: 100%;
}

/* ── Thank-you screen ─────────────────────── */
.modal__success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 0;
  flex: 1;
}

.modal__success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #1b4626;
  color: #ffffff;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.modal__success-heading {
  font-size: 28px;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.25;
  color: #000000;
  margin-bottom: 12px;
  font-family: 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.modal__success-text {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.55;
}

/* ── Scroll lock ──────────────────────────── */
body.modal-open {
  overflow: hidden;
}

/* ── Mobile ───────────────────────────────── */
@media (max-width: 767px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal__window {
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
  }

  .modal__picture {
    display: none;
  }

  .modal__body {
    padding: 48px 24px 32px;
  }

  .modal__heading {
    font-size: 22px;
  }

  .modal__subheading {
    margin-bottom: 24px;
  }
}
