/* ============================================================
   BFSonline /applynow — Bewerbungs-Modal
   Ergänzt app.css (Tokens von dort).
   ============================================================ */

.an-modal { position: fixed; inset: 0; z-index: 60; display: none; }
.an-modal.is-open { display: block; }

.an-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(16, 20, 24, .58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .22s;
}
.an-modal.is-open .an-modal__backdrop { opacity: 1; }

.an-modal__panel {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.97);
  width: min(720px, calc(100vw - 32px));
  max-height: min(860px, calc(100dvh - 48px));
  display: flex; flex-direction: column;
  background: var(--an-bg); border-radius: 18px; overflow: hidden;
  box-shadow: var(--an-shadow-lg);
  opacity: 0; transition: opacity .22s, transform .22s cubic-bezier(.2,.7,.3,1);
}
.an-modal.is-open .an-modal__panel { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* full-screen sheet on phones */
@media (max-width: 560px) {
  .an-modal__panel {
    left: 0; top: auto; bottom: 0; transform: translateY(6%);
    width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0;
  }
  .an-modal.is-open .an-modal__panel { transform: translateY(0); }
}

.an-modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); color: var(--an-ink);
  display: grid; place-items: center; box-shadow: var(--an-shadow-sm);
  transition: background .14s;
}
.an-modal__close:hover { background: #fff; }
.an-modal__close svg { width: 17px; height: 17px; }

/* ---- head: photo of the selected listing(s) ---- */
.an-modal__head { position: relative; flex: 0 0 auto; background: var(--an-ink); overflow: hidden; }
.an-modal__media { position: absolute; inset: 0; }
.an-modal__media img { width: 100%; height: 100%; object-fit: cover; opacity: .48; }
.an-modal__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(20,23,26,.9) 0%, rgba(20,23,26,.55) 55%, rgba(20,23,26,.25) 100%);
}
.an-modal__headinner { position: relative; padding: 26px 28px 22px; }
@media (max-width: 560px) { .an-modal__headinner { padding: 20px 20px 18px; } }
.an-modal__kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--an-accent); font-weight: 800; font-size: 12px;
  letter-spacing: .18em; text-transform: uppercase; margin-bottom: 10px;
}
.an-modal__kicker::before { content: ""; width: 18px; height: 3px; background: var(--an-accent); }
.an-modal__title { color: #fff; font-size: clamp(21px, 4vw, 27px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }

/* job pills w/ listing thumbnail */
.an-modal__jobs { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.an-mjob {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.96); border-radius: var(--r-pill);
  padding: 5px 6px 5px 5px; font-size: 13.5px; font-weight: 700; color: var(--an-ink);
  box-shadow: var(--an-shadow-sm);
}
.an-mjob__img {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  border: 2px solid var(--an-accent); background: var(--an-bg-sunken);
}
.an-mjob__ph {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--an-bg-sunken); display: grid; place-items: center; color: var(--an-muted);
  border: 2px solid var(--an-accent);
}
.an-mjob__ph svg { width: 15px; height: 15px; }
.an-mjob__x {
  width: 28px; height: 28px; border-radius: 50%; border: none; flex: 0 0 auto;
  background: var(--an-bg-sunken); color: var(--an-muted);
  display: grid; place-items: center; transition: background .14s, color .14s;
}
.an-mjob__x:hover { background: #e6534a; color: #fff; }
.an-mjob__x svg { width: 12px; height: 12px; }

/* ---- scrollable body ---- */
.an-modal__body { flex: 1 1 auto; overflow-y: auto; padding: 22px 28px 26px; overscroll-behavior: contain; }
@media (max-width: 560px) { .an-modal__body { padding: 18px 16px 22px; } }
.an-modal__body .an-fieldset { padding: 18px 20px 22px; }

/* ---- footer ---- */
.an-modal__foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 14px;
  padding: 14px 28px calc(14px + env(safe-area-inset-bottom));
  background: var(--an-surface); border-top: 1px solid var(--an-border);
}
@media (max-width: 560px) { .an-modal__foot { padding-inline: 16px; } }
.an-modal__footinfo { font-size: 13.5px; color: var(--an-muted); font-weight: 600; line-height: 1.35; }
.an-modal__footinfo b { color: var(--an-ink); }
.an-modal__foot .an-btn { margin-left: auto; }
@media (max-width: 560px) {
  .an-modal__footinfo { display: none; }
  .an-modal__foot .an-btn { width: 100%; }
}

body.an-modal-open { overflow: hidden; }
