/* ============================================================
   D+A Newsletter Popup
   File: css/da-newsletter-popup.css
   ============================================================ */

/* ---------- Overlay ---------- */
#da-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99998;
  animation: daFadeIn 0.35s ease;
}
#da-popup-overlay.da-visible {
  display: block;
}

@keyframes daFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Popup card ---------- */
#da-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 99999;
  width: 860px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0,0,0,0.22);
  animation: daSlideIn 0.35s ease forwards;
  direction: rtl;
}
#da-popup.da-visible {
  display: flex;
}

@keyframes daSlideIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Close button ---------- */
#da-popup-close {
  position: absolute;
  top: 14px;
  left: 14px;        /* left side in RTL = top-left visually */
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
  padding: 0;
}
#da-popup-close:hover { background: rgba(255,255,255,0.35); }
#da-popup-close svg { width: 16px; height: 16px; stroke: #fff; }

/* ---------- Image / left panel ---------- */
.da-popup-image {
  width: 42%;
  min-height: 420px;
  position: relative;
  flex-shrink: 0;
  background: #c8bfb4;
  overflow: hidden;
}
.da-popup-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Logo over image */
.da-popup-logo {
  position: absolute;
  top: 28px;
  right: 28px;        /* right in RTL = inside the image on the right */
  color: #fff;
  line-height: 1;
}
.da-popup-logo-title {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -1px;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  font-family: Arial, sans-serif;
}
.da-popup-logo-title .da-plus {
  color: #e82020;
  font-size: 36px;
  margin-top: 4px;
}
.da-popup-logo-sub {
  font-size: 11px;
  letter-spacing: 3.5px;
  margin-top: 2px;
  font-weight: 400;
  font-family: Arial, sans-serif;
}
.da-popup-logo-line {
  width: 36px;
  height: 2px;
  background: #fff;
  margin-top: 10px;
}

/* ---------- Form / right panel ---------- */
.da-popup-form-side {
  flex: 1;
  padding: 48px 44px 36px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: right;
}

.da-popup-headline {
  font-size: 24px;
  font-weight: 900;
  color: #111;
  line-height: 1.4;
  margin: 0 0 8px;
  font-family: Arial, sans-serif;
}
.da-popup-redline {
  width: 56px;
  height: 3px;
  background: #e82020;
  margin: 0 0 14px auto;
}
.da-popup-subtext {
  font-size: 15px;
  color: #333;
  line-height: 1.65;
  margin-bottom: 26px;
  font-family: Arial, sans-serif;
}

/* ---------- CF7 field wrappers ---------- */
#da-popup .wpcf7-form {
  margin: 0;
}

/* each field row */
#da-popup .da-field-wrap {
  position: relative;
  margin-bottom: 13px;
}

/* shared input + select style */
#da-popup .da-input,
#da-popup .da-select {
  width: 100%;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 13px 44px 13px 16px; /* right padding leaves room for icon */
  font-size: 15px;
  color: #333;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  text-align: right;
  direction: rtl;
  outline: none;
  transition: border-color 0.2s;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}
#da-popup .da-input:focus,
#da-popup .da-select:focus {
  border-color: #e82020;
}
#da-popup .da-input::placeholder {
  color: #aaa;
}

/* ---------- Field icons (person + envelope) ---------- */
/* Icon sits on the RIGHT side inside the field (RTL layout) */
.da-field-name .wpcf7-form-control-wrap::after,
.da-field-email .wpcf7-form-control-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

/* Person icon for full-name field */
.da-field-name .wpcf7-form-control-wrap::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

/* Envelope icon for email field */
.da-field-email .wpcf7-form-control-wrap::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpolyline points='2,4 12,13 22,4'/%3E%3C/svg%3E");
}

/* Chevron for profession dropdown */
.da-field-profession {
  position: relative;
}
.da-field-profession::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}
.da-field-profession .wpcf7-form-control-wrap {
  display: block;
}

/* ---------- Submit button ---------- */
#da-popup .da-submit {
  width: 100%;
  background: #e82020;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  transition: background 0.2s;
  font-family: Arial, sans-serif;
  direction: rtl;
  letter-spacing: 0.3px;
}
#da-popup .da-submit:hover { background: #c41818; }

/* Add arrow → after button text via pseudo */
#da-popup .da-submit::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

/* ---------- Footer note ---------- */
.da-popup-footnote {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: 12px;
  font-family: Arial, sans-serif;
}

/* ---------- CF7 validation messages ---------- */
#da-popup .wpcf7-not-valid-tip {
  font-size: 12px;
  color: #e82020;
  text-align: right;
  display: block;
  margin-top: 3px;
}
#da-popup .wpcf7-response-output {
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
}

/* ============================================================
   MOBILE  (≤ 640px)  — stack image on top, form below
   ============================================================ */
@media (max-width: 640px) {
  #da-popup {
    flex-direction: column;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    max-width: 100%;
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow-y: auto;
    animation: daFadeIn 0.3s ease;
  }

  .da-popup-image {
    width: 100%;
    min-height: 300px;
    max-height: 42vh;
  }

  .da-popup-logo {
    top: 22px;
    right: 20px;
  }
  .da-popup-logo-title { font-size: 38px; }

  .da-popup-form-side {
    padding: 32px 24px 28px;
  }

  .da-popup-headline {
    font-size: 20px;
  }

  #da-popup-close {
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.25);
  }
}

/* Background image div (fills the image panel) */
.da-popup-bg-img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background-color: #c8bfb4;
  background-image: url('../images/da-newsletter-bg-desktop.webp');
  background-size: cover;
  background-position: center top;
}

/* Mobile: switch to mobile-optimised crop */
@media (max-width: 640px) {
  .da-popup-bg-img {
    background-image: url('../images/da-newsletter-bg-mobile.webp');
    background-position: center top;
  }
}
