/* ===== Follow / review modals (employer.php) ===== */

.adr-modal {
  /* Pinned to the viewport explicitly, so theme CSS or a non-modal open can't
     drop it into the page flow at the bottom of the document */
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 2147483000;           /* above the sticky anchor ad */
  height: fit-content;
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(440px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  color: #2d2d2d;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  overflow: hidden;
}
/* Closed = hidden. Some theme/reset CSS sets `dialog { display: block }`,
   which overrides the browser's default and makes closed dialogs visible. */
.adr-modal:not([open]) { display: none !important; }
.adr-modal[open] { display: flex; flex-direction: column; }
.adr-modal-wide  { width: min(640px, calc(100% - 32px)); }
.adr-modal::backdrop { background: rgba(0, 0, 0, .5); }
/* Fallback backdrop if the browser/theme ever shows it non-modally */
.adr-modal[open]:not(:modal) { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
html:has(.adr-modal[open]) { overflow: hidden; }

.adr-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.adr-modal-head h3 { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }

.adr-modal-close {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: #4d5156; cursor: pointer;
}
.adr-modal-close:hover { background: #f1f3f4; }
.adr-modal-close svg { width: 20px; height: 20px; }

.adr-modal-head { flex: none; }
.adr-modal-body { flex: 1 1 auto; min-height: 0; padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.adr-modal-body > p { margin: 0 0 16px; line-height: 1.55; }

.adr-modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }

.adr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid #2d2d2d;
  font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.adr-btn-dark  { background: #2d2d2d; color: #fff; }
.adr-btn-dark:hover  { background: #000; color: #fff; text-decoration: none; }
.adr-btn-light { background: #fff; color: #2d2d2d; }
.adr-btn-light:hover { background: #f1f3f4; color: #2d2d2d; text-decoration: none; }
.adr-btn:disabled { opacity: .6; cursor: default; }
.adr-btn:focus-visible,
.adr-modal-close:focus-visible { outline: 2px solid #0a66c2; outline-offset: 2px; }

/* ---- Star ratings ---- */
.adr-rating-grid { display: grid; grid-template-columns: 1fr; gap: 14px 24px; margin-bottom: 20px; }
@media (min-width: 560px) { .adr-rating-grid { grid-template-columns: 1fr 1fr; } }

.adr-rating { border: 0; margin: 0; padding: 0; min-width: 0; }
.adr-rating legend { padding: 0; margin-bottom: 4px; font-size: .95rem; font-weight: 600; }

/* DOM order is 5→1, row-reverse shows 1→5, so "~ label" = this star and all to the left */
.adr-stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.adr-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.adr-stars label { cursor: pointer; color: #d1d5db; padding: 2px; line-height: 0; }
.adr-stars label svg { width: 28px; height: 28px; fill: currentColor; }

.adr-stars input:checked ~ label            { color: #f5a623; }
.adr-stars:hover input ~ label              { color: #d1d5db; }
.adr-stars input ~ label:hover,
.adr-stars input ~ label:hover ~ label      { color: #f5a623; }
.adr-stars input:focus-visible + label      { outline: 2px solid #0a66c2; outline-offset: 1px; border-radius: 4px; }

/* ---- Text fields ---- */
.adr-field { margin-bottom: 16px; }
.adr-field label { display: block; margin-bottom: 6px; font-size: .95rem; font-weight: 600; }
.adr-field textarea {
  width: 100%; min-height: 96px; resize: vertical;
  padding: 10px 12px; border: 1px solid #c4c7c5; border-radius: 8px;
  font: inherit; font-size: 16px; /* 16px stops iOS zoom */ color: inherit; background: #fff;
}
.adr-field textarea:focus { outline: none; border-color: #0a66c2; box-shadow: 0 0 0 3px rgba(10, 102, 194, .15); }

.adr-form-error {
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: #fdecea; color: #a50e0e; font-size: .9rem;
}

/* ---- Success state ---- */
.adr-review-success { text-align: center; padding: 12px 4px 4px; }
.adr-review-success svg { width: 48px; height: 48px; color: #188038; margin-bottom: 12px; }
.adr-review-success p { margin: 0 auto 20px; max-width: 42ch; line-height: 1.55; }

.adr-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .adr-modal[open] { animation: adr-pop .16s ease-out; }
  @keyframes adr-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}