/* ===== Apply-for-role modal =====
   Load this AFTER assets/css/theme.css, e.g.:
   <link href="assets/css/theme.css" rel="stylesheet" />
   <link href="assets/css/apply-modal.css" rel="stylesheet" />
*/
.apply-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,32,.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000; /* above the vacancy-modal-overlay (z-index: 999) */
  padding: 24px;
}

.apply-modal-overlay.open {
  display: flex;
}

.apply-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px rgba(2,6,23,.35);
  animation: memberModalIn .25s ease;
  display: flex;
  flex-direction: column;
}

.apply-modal-header {
  background: #1b2f42;
  border-radius: 16px 16px 0 0;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.apply-modal-header-name {
  color: #fff;
  font: 700 17px "Manrope";
  margin: 0;
}

.apply-modal-header-title {
  color: #9ac5f3;
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 3px;
}

.apply-modal-close {
  border: 0;
  background: rgba(255,255,255,.15);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: .2s;
}

.apply-modal-close:hover {
  background: rgba(255,255,255,.28);
}

.apply-modal-body {
  padding: 24px;
  overflow-y: auto;
}

.apply-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.apply-form .field.full {
  grid-column: 1/-1;
}

.apply-form label {
  font: 800 10px "Manrope";
  text-transform: uppercase;
  letter-spacing: .11em;
  display: block;
  margin-bottom: 7px;
}

.apply-form input[type=text],
.apply-form input[type=email],
.apply-form input[type=tel],
.apply-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 12px;
  outline: 0;
}

.apply-form input[type=file] {
  width: 100%;
  padding: 11px;
  border: 1px dashed var(--line);
  background: var(--cream);
  border-radius: 12px;
  font-size: 13px;
}

.apply-form textarea {
  min-height: 110px;
  resize: vertical;
}

.apply-form input:focus,
.apply-form textarea:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 4px rgba(31,111,196,.11);
}

.apply-form-actions {
  display: flex;
  justify-content: flex-end;
}

/* ----- Submit button loading state ----- */
.apply-submit-btn {
  position: relative;
  min-width: 180px;
}

.apply-submit-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  animation: applySpin .7s linear infinite;
}

.apply-submit-btn.is-loading {
  cursor: not-allowed;
  opacity: .88;
}

.apply-submit-btn.is-loading .apply-submit-spinner {
  display: inline-block;
}

.apply-submit-btn:disabled {
  pointer-events: none;
}

@keyframes applySpin {
  to { transform: rotate(360deg); }
}

/* ----- Toast notifications ----- */
.toast-container {
  position: fixed;
  z-index: 1200;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 20px 48px rgba(15,23,32,.22);
  border-left: 4px solid #2e6740;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.hide {
  opacity: 0;
  transform: translateY(8px) scale(.98);
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e7f3e8;
  color: #2e6740;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.toast-error {
  border-left-color: #b3261e;
}

.toast-error .toast-icon {
  background: #fbe9e7;
  color: #b3261e;
}

.toast-text {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.55;
  padding-top: 2px;
}

.toast-close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 3px;
  line-height: 1;
}

.toast-close:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  .apply-form {
    grid-template-columns: 1fr;
  }

  .toast-container {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}