/* ═══════════════════════════════════════════════════════════════
   RCRC Newsletter — homepage banner, sign-up dialog, unsubscribe page
   Loaded only on the homepage and /newsletter/unsubscribe/
   (inc/newsletter.php). Inputs reuse the global DGA .rcrc-input look.
   ═══════════════════════════════════════════════════════════════ */

/* The JS toggles parts with the `hidden` attribute; make it beat any
   display value set below (e.g. the inline-flex buttons). */
.rcrc-nl-section [hidden],
.rcrc-nl-dialog [hidden],
.rcrc-nl-unsub [hidden] {
  display: none !important;
}

/* ── 1. Homepage banner ─────────────────────────────────────── */
.rcrc-nl-section {
  padding: 56px 0 72px;
  background: #fff;
}

/* [rcrc_newsletter] inside page content (test page) */
.rcrc-nl-section--embedded {
  padding: 24px 0;
  background: transparent;
}

.rcrc-nl-banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 320px;
  padding: 64px 72px;
  overflow: hidden;
  color: #fff;
  /* Design (Figma, Nov 2026): navy linear gradient #101828 → #475467, dark
     corner bottom-left, light corner top-right (the text side in Arabic). */
  background: linear-gradient(to top right, #101828 0%, #475467 100%);
}

[dir="ltr"] .rcrc-nl-banner {
  background: linear-gradient(to top left, #101828 0%, #475467 100%);
}

/* With the background photo: the same gradient laid over it at 80% in
   "multiply", as measured from the design — the photo's shadows go deep
   navy and its light areas show through. */
.rcrc-nl-banner.has-image {
  background-image:
    linear-gradient(to top right, rgba(16, 24, 40, .8) 0%, rgba(71, 84, 103, .8) 100%),
    var(--rcrc-nl-bg);
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply, normal;
}

[dir="ltr"] .rcrc-nl-banner.has-image {
  background-image:
    linear-gradient(to top left, rgba(16, 24, 40, .8) 0%, rgba(71, 84, 103, .8) 100%),
    var(--rcrc-nl-bg);
}

.rcrc-nl-banner__inner {
  position: relative;
  width: 100%;
}

.rcrc-nl-banner__body {
  position: relative;
  max-width: 660px;
  text-align: start;
}

.rcrc-nl-banner__title {
  margin: 0 0 16px;
  color: #fff;
  font-family: var(--fp-font) !important;
  font-size: clamp(26px, 1.6vw + 16px, 40px);
  font-weight: 700;
  line-height: 1.3;
}

.rcrc-nl-banner__text {
  margin: 0 0 32px;
  color: rgba(255, 255, 255, .9);
  font-size: 18px;
  line-height: 1.7;
}

.rcrc-nl-banner__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 20px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #161616;
  font-family: var(--fp-font) !important;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  cursor: pointer;
  transition: background-color var(--fp-trans, .2s ease);
}

.rcrc-nl-banner__btn:hover {
  background: #f3f4f6;
}

.rcrc-nl-banner__btn:active {
  background: #e5e7eb;
}

.rcrc-nl-banner__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* After signing up (this browser): the "subscribed" note */
.rcrc-nl-banner__done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}

.rcrc-nl-banner__done-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 4px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

@media (max-width: 767px) {
  .rcrc-nl-section {
    padding: 40px 0 48px;
  }

  .rcrc-nl-banner {
    min-height: 0;
    padding: 40px 24px;
  }

  .rcrc-nl-banner__text {
    font-size: 16px;
    margin-bottom: 24px;
  }
}

/* Homepage: the band runs the full page width; the text sits in
   .figma-container, so it lines up with the sections above. 80px of space
   above it — the same gap as between the other homepage sections
   (40px + 40px padding). */
.rcrc-nl-section.rcrc-nl-section--full {
  margin-top: 80px;
  padding: 0;
  background: none;
}

.rcrc-nl-section--full .rcrc-nl-banner {
  min-height: 360px;
  padding: 80px 0;
}

@media (max-width: 767px) {
  .rcrc-nl-section.rcrc-nl-section--full {
    margin-top: 48px;
  }

  .rcrc-nl-section--full .rcrc-nl-banner {
    min-height: 0;
    padding: 48px 0;
  }
}

/* ── 2. Sign-up dialog ──────────────────────────────────────── */
html.rcrc-nl-lock {
  overflow: hidden;
}

.rcrc-nl-dialog {
  width: 100%;
  max-width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #161616;
  overflow: visible;
}

.rcrc-nl-dialog::backdrop {
  background: rgba(12, 17, 27, .55);
}

.rcrc-nl-dialog__card {
  position: relative;
  max-height: calc(100vh - 32px);
  padding: 32px;
  overflow-y: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .25);
  text-align: start;
}

.rcrc-nl-dialog__close {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #161616;
  cursor: pointer;
}

.rcrc-nl-dialog__close:hover {
  background: #f3f4f6;
}

.rcrc-nl-dialog__close:active {
  background: #e5e7eb;
}

.rcrc-nl-dialog__close:focus-visible {
  outline: 2px solid #161616;
  outline-offset: 2px;
}

.rcrc-nl-dialog__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--fp-primary-50, #f3fcf6);
  color: #1b8354;
}

.rcrc-nl-dialog__title {
  margin: 16px 0 24px;
  color: #1b8354;
  font-family: var(--fp-font) !important;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}

/* ── 3. Form parts (dialog + unsubscribe page) ──────────────── */
.rcrc-nl-field {
  margin: 0 0 20px;
}

.rcrc-nl-fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

.rcrc-nl-label {
  display: block;
  float: none;
  width: auto;
  margin: 0 0 6px;
  padding: 0;
  color: #161616;
  font-family: var(--fp-font) !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.rcrc-nl-req {
  margin-inline-end: 2px;
  color: #d92d20;
}

.rcrc-nl-form .rcrc-input {
  text-align: start;
}

/* Browsers force email fields LTR; in Arabic keep the placeholder on the right
   like the other RTL fields (same convention as the contact forms). */
[dir="rtl"] .rcrc-nl-form input[type="email"] {
  direction: rtl;
  text-align: right;
}

.rcrc-nl-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  padding-top: 4px;
}

.rcrc-nl-radio,
.rcrc-nl-check {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  color: #384250;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
}

.rcrc-nl-radio input,
.rcrc-nl-check input {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  opacity: 0;
  cursor: pointer;
}

.rcrc-nl-radio__mark,
.rcrc-nl-check__mark {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid #9da4ae;
  background: #fff;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.rcrc-nl-radio__mark {
  border-radius: 50%;
}

.rcrc-nl-check__mark {
  border-radius: 4px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px;
}

.rcrc-nl-radio:hover .rcrc-nl-radio__mark,
.rcrc-nl-check:hover .rcrc-nl-check__mark {
  border-color: #384250;
}

.rcrc-nl-radio input:checked + .rcrc-nl-radio__mark {
  border-color: #1b8354;
  box-shadow: inset 0 0 0 4px #fff;
  background: #1b8354;
}

.rcrc-nl-check input:checked + .rcrc-nl-check__mark {
  border-color: #1b8354;
  background-color: #1b8354;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.rcrc-nl-radio input:focus-visible + .rcrc-nl-radio__mark,
.rcrc-nl-check input:focus-visible + .rcrc-nl-check__mark {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #161616;
}

.rcrc-nl-radio input:checked:focus-visible + .rcrc-nl-radio__mark {
  box-shadow: inset 0 0 0 4px #fff, 0 0 0 2px #fff, 0 0 0 4px #161616;
}

.rcrc-nl-field.is-invalid .rcrc-nl-radio__mark {
  border-color: #d92d20;
}

/* Privacy consent: the box, text and link come from the site-wide
   .policy-checkbox styles (style.css); only the error state is ours. */
.rcrc-nl-field.policy-checkbox.is-invalid input[type="checkbox"][name="accept_policy"] {
  border-color: #d92d20 !important;
}

.rcrc-nl-field.policy-checkbox .rcrc-nl-error {
  margin-top: 8px;
}

.rcrc-nl-hint,
.rcrc-nl-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  color: #4d5761;
  font-size: 14px;
  line-height: 20px;
}

.rcrc-nl-hint svg,
.rcrc-nl-note svg {
  flex: none;
  margin-top: 0;
}

.rcrc-nl-error {
  margin: 6px 0 0;
  color: #d92d20;
  font-size: 14px;
  line-height: 20px;
}

.rcrc-nl-alert {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fef3f2;
  color: #b42318;
  font-size: 14px;
  line-height: 20px;
}

.rcrc-nl-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 24px;
}

.rcrc-nl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #1b8354;
  color: #fff;
  font-family: var(--fp-font) !important;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease;
}

.rcrc-nl-btn:hover {
  background: #166a45;
  color: #fff;
}

.rcrc-nl-btn:active {
  background: #14573a;
}

.rcrc-nl-btn:focus-visible {
  outline: 2px solid #161616;
  outline-offset: 2px;
}

.rcrc-nl-btn[disabled] {
  cursor: progress;
  opacity: .85;
}

.rcrc-nl-btn--secondary {
  border-color: #d2d6db;
  background: #fff;
  color: #161616;
}

.rcrc-nl-btn--secondary:hover {
  background: #f9fafb;
  color: #161616;
}

.rcrc-nl-btn--secondary:active {
  background: #f3f4f6;
}

.rcrc-nl-btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: rcrc-nl-spin .7s linear infinite;
}

.rcrc-nl-btn.is-loading .rcrc-nl-btn__spinner {
  display: inline-block;
}

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

/* Result panel (sign-up success, unsubscribed, invalid link) */
.rcrc-nl-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ecfdf3;
  color: #067647;
}

.rcrc-nl-success__icon.is-warning {
  background: #fffaeb;
  color: #b54708;
}

.rcrc-nl-success__title {
  margin: 16px 0 8px;
  color: #161616;
  font-family: var(--fp-font) !important;
  font-size: 20px;
  font-weight: 700;
  line-height: 30px;
}

.rcrc-nl-success__text {
  margin: 0 0 24px;
  color: #4d5761;
  font-size: 16px;
  line-height: 24px;
}

@media (max-width: 575px) {
  .rcrc-nl-dialog__card {
    padding: 24px 20px;
  }

  .rcrc-nl-dialog__close {
    top: 12px;
    inset-inline-end: 12px;
  }

  .rcrc-nl-btn {
    width: 100%;
  }
}

/* ── 4. Unsubscribe page ────────────────────────────────────── */
.rcrc-nl-unsub {
  padding: 40px 0 80px;
}

.rcrc-nl-unsub__card {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  text-align: start;
}

.rcrc-nl-unsub__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.rcrc-nl-unsub__title {
  margin: 0 0 4px;
  color: #1b8354;
  font-family: var(--fp-font) !important;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}

.rcrc-nl-unsub__subtitle {
  margin: 0;
  color: #1b8354;
  font-size: 16px;
  line-height: 24px;
}

.rcrc-nl-unsub__reasons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rcrc-nl-unsub__question {
  float: none;
  width: auto;
  margin: 0 0 4px;
  padding: 0;
  color: #161616;
  font-family: var(--fp-font) !important;
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
}

.rcrc-nl-unsub__intro {
  margin: 0 0 4px;
  color: #6c737f;
  font-size: 14px;
  line-height: 20px;
}

.rcrc-nl-unsub__other {
  margin-top: 4px;
}

.rcrc-nl-note {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #dff6e7;
  border-radius: 8px;
  background: var(--fp-primary-50, #f3fcf6);
  color: #14573a;
}

.rcrc-nl-note svg {
  color: #1b8354;
}

.rcrc-nl-unsub .rcrc-nl-actions {
  justify-content: flex-end;
}

.rcrc-nl-unsub .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

@media (max-width: 575px) {
  .rcrc-nl-unsub {
    padding: 24px 0 56px;
  }

  .rcrc-nl-unsub__card {
    padding: 24px 20px;
  }

  .rcrc-nl-unsub__head {
    align-items: flex-start;
  }
}
