/* PASADA modal / toast UI (SweetAlert replacement)
   Clean, modern confirmation & status overlay.
*/

/* =========================
   CONFIRM / ALERT MODAL
   ========================= */

.psa-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s cubic-bezier(.4,0,.2,1), visibility 0.25s;
  z-index: 9999;
}

.psa-modal{
  width: 420px;
  max-width: 92vw;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 64px -12px rgba(15,23,42,0.12), 0 0 0 1px rgba(15,23,42,0.04);
  overflow: hidden;
  animation: psaPop 0.3s cubic-bezier(.34,1.56,.64,1);
  font-family: inherit;
}

@keyframes psaPop{
  from { transform: scale(0.92) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.psa-head{
  padding: 32px 36px 0 36px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.psa-title{
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: #0F172A;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.psa-loading{ display: inline-flex; align-items: center; }

.psa-spinner{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.08);
  border-top-color: #2563eb;
  animation: psaSpin .7s linear infinite;
}

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

.psa-body{
  padding: 8px 36px 0 36px;
}

.psa-text{
  font-size: 15px;
  color: #64748B;
  margin: 0;
  line-height: 1.55;
}

.psa-html{ margin-top: 10px; }

.psa-divider{
  height: 1px;
  background: rgba(15, 23, 42, 0.06);
  margin: 24px 36px 20px 36px;
}

.psa-actions{
  padding: 0 36px 28px 36px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.psa-actions.psa-actions--single{ justify-content: flex-end; }

.psa-btn{
  flex: 1;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  letter-spacing: 0.01em;
}

.psa-btn:active{ transform: scale(0.97); }

.psa-btn--cancel{
  border-color: rgba(15,23,42,0.08);
  background: #F8FAFC;
  color: #334155;
}

.psa-btn--cancel:hover{ background: #F1F5F9; border-color: rgba(15,23,42,0.12); }

.psa-btn--primary{
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #ffffff;
}

.psa-btn--success{
  background: #16a34a;
  border: 1px solid #16a34a;
  color: #ffffff;
}

.psa-btn--danger{
  background: #dc2626;
  border: 1px solid #dc2626;
  color: #ffffff;
}

.psa-btn--primary:hover{ background: #1d4ed8; border-color: #1d4ed8; }

.psa-btn--success:hover{ background: #15803d; border-color: #15803d; }

.psa-btn--danger:hover{ background: #b91c1c; border-color: #b91c1c; }

.psa-btn:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.psa-btn__mark{ font-weight: 400; font-size: 18px; line-height: 1; }

/* Input + validation (kept for existing flows) */
.psa-inputlabel{
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
}

.psa-input{
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  padding: 10px 14px;
  outline: none;
  background: #F8FAFC;
  color: #0F172A;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.psa-input:focus{
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
  background: #ffffff;
}

.psa-textarea{ resize: vertical; }

.psa-validation{
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #dc2626;
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 520px){
  .psa-modal{ border-radius: 16px; }
  .psa-head{ padding: 22px 22px 0 22px; }
  .psa-body{ padding: 8px 22px 0 22px; }
  .psa-divider{ margin: 20px 22px 16px 22px; }
  .psa-actions{ padding: 0 22px 22px 22px; gap: 10px; }
  .psa-btn{ font-size: 14px; }
}

/* =========================
   STATUS (SUCCESS/ERROR) MODAL
   Used for auto-close welcome messages.
   ========================= */

.psa-modal--status{
  width: min(92vw, 400px);
}

.psa-modal--image-preview{
  width: min(94vw, 1080px);
}

.psa-modal--image-preview .psa-head{
  padding: 22px 24px 0 24px;
}

.psa-modal--image-preview .psa-body{
  padding: 10px 24px 0 24px;
}

.psa-modal--image-preview .psa-html{
  margin-top: 0;
}

.psa-modal--image-preview .psa-divider{
  margin: 18px 24px 18px 24px;
}

.psa-modal--image-preview .psa-actions{
  padding: 0 24px 22px 24px;
}

.psa-status{
  padding: 32px 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.psa-status__icon{
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  margin-bottom: 18px;
  position: relative;
}

.psa-status__icon i{
  font-size: 34px;
  line-height: 1;
}

.psa-status__title{
  font-weight: 600;
  color: #0F172A;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.psa-status__text{
  font-size: 14px;
  color: #94A3B8;
  margin-top: 6px;
  line-height: 1.5;
  max-width: 280px;
}

.psa-status--success .psa-status__icon{ background: rgba(34,197,94,0.08); }
.psa-status--success .psa-status__icon i{ color: #16a34a; }

.psa-status--error .psa-status__icon{ background: rgba(239,68,68,0.08); }
.psa-status--error .psa-status__icon i{ color: #dc2626; }

.psa-status--warning .psa-status__icon{ background: rgba(245,158,11,0.08); }
.psa-status--warning .psa-status__icon i{ color: #d97706; }

.psa-status--info .psa-status__icon{ background: rgba(37,99,235,0.08); }
.psa-status--info .psa-status__icon i{ color: #2563eb; }

/* =========================
   TOAST
   ========================= */

.psa-toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: min(92vw, 420px);
  pointer-events: none;
}

.psa-toast--top{ top: 20px; }
.psa-toast--bottom{ bottom: 20px; }

.psa-toast__inner{
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 14px;
  box-shadow: 0 12px 40px -8px rgba(15,23,42,0.15), 0 0 0 1px rgba(15,23,42,0.03);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: psaToast .28s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes psaToast{
  from{ transform: translateY(-10px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

.psa-toast__icon{ display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; }
.psa-toast__icon--success{ background: rgba(34,197,94,0.08); }
.psa-toast__icon--success i{ color: #16a34a; }
.psa-toast__icon--error{ background: rgba(239,68,68,0.08); }
.psa-toast__icon--error i{ color: #dc2626; }
.psa-toast__icon--warning{ background: rgba(245,158,11,0.08); }
.psa-toast__icon--warning i{ color: #d97706; }
.psa-toast__icon--info{ background: rgba(37,99,235,0.08); }
.psa-toast__icon--info i{ color: #2563eb; }
.psa-toast__icon i{ font-size: 18px; }

.psa-toast__title{
  font-weight: 600;
  color: #0F172A;
  font-size: 14px;
  line-height: 1.3;
}

.psa-toast__text{
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.35;
}

/* Compatibility styles for existing markup inside Swal html blocks */
.swal2-input,
.swal2-textarea,
.swal2-file{
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  padding: 10px 14px;
  outline: none;
  background: #F8FAFC;
  color: #0F172A;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.swal2-textarea{ resize: vertical; min-height: 90px; }

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-file:focus{
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
  background: #ffffff;
}


.psa-modal--session-timeout{
  width: min(92vw, 440px);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.psa-modal--session-timeout .psa-body{
  overflow-y: auto;
}

.psa-modal--session-timeout .psa-actions{
  justify-content: stretch;
}

.psa-modal--session-timeout .psa-btn--session-timeout,
.psa-modal--session-timeout .psa-actions .psa-btn{
  width: 100%;
  min-height: 48px;
}

@media (max-width: 520px){
  .psa-modal--session-timeout{
    width: min(94vw, 440px);
    max-height: calc(100dvh - 20px);
  }

  .psa-modal--session-timeout .psa-head{
    padding: 20px 18px 0 18px;
  }

  .psa-modal--session-timeout .psa-body{
    padding: 10px 18px 0 18px;
  }

  .psa-modal--session-timeout .psa-divider{
    margin: 18px 18px 16px 18px;
  }

  .psa-modal--session-timeout .psa-actions{
    padding: 0 18px 18px 18px;
  }
}
