/* ================================================================
   SPLASH SCREEN — split modal  (content left / image right)
   ================================================================ */

/* ── Overlay ── */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.splash-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

/* ── Modal shell — two columns ── */
.splash-modal {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  width: min(760px, 95vw);
  max-height: 92vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 45%;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.06),
    0 16px 40px rgba(0,0,0,0.16),
    0 48px 96px rgba(0,0,0,0.20);
  animation: splashIn 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* No-image variant: single column */
.splash-modal.splash-modal--no-image {
  grid-template-columns: 1fr;
  max-width: 480px;
}

/* ── Content panel (left) ── */
.splash-modal__content {
  display: flex;
  flex-direction: column;
  padding: 2.25rem 2rem 2rem;
  overflow-y: auto;
  gap: 0;
}

.splash-modal__badge {
  display: inline-flex;
  align-self: flex-start;
  background: #EEF4FF;
  color: var(--color-primary, #1565C0);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 0.9rem;
}

.splash-modal__headline {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--color-heading, #1a2744);
  line-height: 1.25;
  margin: 0 0 0.85rem;
}

.splash-modal__text {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.65;
  margin: 0 0 1.5rem;
  flex-grow: 1;
}

.splash-modal__text p { margin: 0 0 0.5em; }
.splash-modal__text p:last-child { margin-bottom: 0; }

/* ── Action buttons ── */
.splash-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.splash-modal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s, transform 0.14s, box-shadow 0.18s;
  text-align: center;
}

.splash-modal__btn--primary {
  background: var(--color-primary, #1565C0);
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(21, 101, 192, 0.32);
}
.splash-modal__btn--primary:hover {
  background: var(--color-primary-dark, #0D47A1);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(21, 101, 192, 0.42);
}

.splash-modal__btn--outline {
  background: transparent;
  color: var(--color-primary, #1565C0) !important;
  border: 1.5px solid var(--color-primary, #1565C0);
}
.splash-modal__btn--outline:hover {
  background: #EEF4FF;
  transform: translateY(-1px);
}

/* ── Skip / close text link ── */
.splash-modal__skip {
  all: unset;
  cursor: pointer;
  font-size: 0.78rem;
  color: #999;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
  align-self: center;
  padding: 0.2rem 0;
}
.splash-modal__skip:hover { color: #555; }

/* ── Image panel (right) ── */
.splash-modal__visual {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  background: #f0f4ff;
}

.splash-modal__visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

/* ── Close (×) button — top-right of the image panel ── */
.splash-modal__close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 2.1rem;
  height: 2.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.splash-modal__close:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.1);
}

/* ── No-image: close button against white background ── */
.splash-modal.splash-modal--no-image .splash-modal__close {
  background: rgba(0, 0, 0, 0.08);
  border-color: transparent;
  color: #333;
}
.splash-modal.splash-modal--no-image .splash-modal__close:hover {
  background: rgba(0, 0, 0, 0.16);
}

/* ── Animations ── */
@keyframes splashIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
@keyframes splashOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.94) translateY(10px); }
}

.splash-overlay.is-hiding .splash-modal {
  animation: splashOut 0.3s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .splash-modal,
  .splash-overlay.is-hiding .splash-modal { animation: none; }
}

/* ── Embedded webform inside modal — slightly wider to fit form + image ── */
.splash-modal--has-form {
  grid-template-columns: 55% 45%;
  width: min(860px, 95vw);
}

.splash-modal__form {
  margin-bottom: 0.75rem;
}

/* Strip Drupal's default form chrome */
.splash-modal__form .webform-submission-form {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

/* Form fields */
.splash-modal__form .form-item {
  margin-bottom: 0.75rem;
}
.splash-modal__form .form-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
  display: block;
  margin-bottom: 0.25rem;
}
.splash-modal__form .form-item label.js-form-required::after,
.splash-modal__form .form-item label.form-required::after {
  content: ' *';
  color: var(--color-primary, #1565C0);
}
.splash-modal__form input[type="text"],
.splash-modal__form input[type="email"],
.splash-modal__form input[type="tel"],
.splash-modal__form textarea,
.splash-modal__form select {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid #dde2ec;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1a2744;
  background: #f8f9fc;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.splash-modal__form input:focus,
.splash-modal__form textarea:focus,
.splash-modal__form select:focus {
  border-color: var(--color-primary, #1565C0);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
  background: #fff;
}
.splash-modal__form textarea {
  min-height: 80px;
  resize: vertical;
}

/* intl-tel-input (international phone field with dial-code dropdown) */
.splash-modal__form .iti {
  width: 100%;
  display: block;
}
/* The generic input[type="tel"] rule above has higher specificity (0,2,1 vs 0,2,0),
   so !important is required here to set the correct left padding for the flag+code dropdown. */
.splash-modal__form .iti--separate-dial-code input[type="tel"],
.splash-modal__form .iti--allow-dropdown input[type="tel"] {
  padding-left: 90px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Submit button */
.splash-modal__form .form-actions,
.splash-modal__form .webform-actions {
  margin-top: 0.9rem;
}
.splash-modal__form .form-submit,
.splash-modal__form input[type="submit"],
.splash-modal__form button[type="submit"] {
  width: 100%;
  padding: 0.7rem 1.25rem;
  background: var(--color-primary, #1565C0);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s, transform 0.14s;
  box-shadow: 0 2px 10px rgba(21, 101, 192, 0.3);
}
.splash-modal__form .form-submit:hover,
.splash-modal__form input[type="submit"]:hover,
.splash-modal__form button[type="submit"]:hover {
  background: var(--color-primary-dark, #0D47A1);
  transform: translateY(-1px);
}

/* Secondary alt-link below form */
.splash-modal__alt-link {
  text-align: center;
  margin-top: 0.5rem;
}
.splash-modal__alt-link a {
  font-size: 0.8rem;
  color: var(--color-primary, #1565C0);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Mobile: bottom sheet, image on top, content scrollable below ── */
@media (max-width: 580px) {
  .splash-overlay {
    padding: 0;
    align-items: flex-end;
  }

  /* Switch to flex so content panel can scroll independently */
  .splash-modal {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;  /* cancel desktop grid */
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    animation: splashInMobile 0.38s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  }

  /* Image: fixed height at the top, never grows */
  .splash-modal__visual {
    order: -1;
    flex-shrink: 0;
    height: 200px;
    max-height: 30vh;
    min-height: unset;
    overflow: hidden;
  }

  .splash-modal__visual img {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }

  /* Content: takes remaining space and scrolls */
  .splash-modal__content {
    flex: 1 1 auto;
    min-height: 0;          /* CRITICAL — allows flex item to shrink & scroll */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1.1rem 1.1rem 1.5rem;
    /* Safe-area padding for iPhone home bar */
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .splash-modal__headline { font-size: 1.15rem; }

  /* Bigger close button — minimum 44×44px tap target */
  .splash-modal__close {
    width: 2.75rem;
    height: 2.75rem;
    top: 0.5rem;
    right: 0.5rem;
  }
}

@keyframes splashInMobile {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
