/* ═══════════════════════════════════════════════
   CUSTOM ALERT TOAST + BUTTON LOADER
   Add the CSS to your service-page.css
   Add the JS to your main script block
═══════════════════════════════════════════════ */


/* ─────────────────────────────────────────
   1. TOAST NOTIFICATION (replaces alert())
───────────────────────────────────────── */

/* Toast Notification */
.sh-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 99999;
  min-width: 320px;
  max-width: 420px;
  background: rgba(10, 18, 35, 0.97);
  border: 1px solid rgba(232, 114, 30, 0.35);
  border-left: 4px solid #e8721e;
  border-radius: 14px;
  padding: 18px 20px 18px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(232, 114, 30, 0.08),
    0 0 30px rgba(232, 114, 30, 0.08);
  backdrop-filter: blur(16px);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s ease;
  pointer-events: none;
}

.sh-toast.sh-toast--show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

.sh-toast.sh-toast--hide {
  transform: translateX(120%);
  opacity: 0;
}

/* Success variant */
.sh-toast.sh-toast--success {
  border-left-color: #00c864;
  border-color: rgba(0, 200, 100, 0.3);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 200, 100, 0.07);
}

/* Error variant */
.sh-toast.sh-toast--error {
  border-left-color: #e8721e;
  border-color: rgba(232, 114, 30, 0.35);
}

/* Icon circle */
.sh-toast__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.sh-toast--success .sh-toast__icon {
  background: rgba(0, 200, 100, 0.15);
  border: 1px solid rgba(0, 200, 100, 0.4);
}

.sh-toast--error .sh-toast__icon {
  background: rgba(232, 114, 30, 0.15);
  border: 1px solid rgba(232, 114, 30, 0.4);
}

.sh-toast__icon svg {
  width: 18px;
  height: 18px;
}

/* Text content */
.sh-toast__body {
  flex: 1;
}

.sh-toast__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}

.sh-toast__desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
}

/* Close button */
.sh-toast__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  font-size: 1.1rem;
  transition: color 0.2s;
  flex-shrink: 0;
  margin-top: -2px;
}

.sh-toast__close:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Progress bar at bottom of toast */
.sh-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  width: 100%;
  overflow: hidden;
}

.sh-toast__progress-bar {
  height: 100%;
  border-radius: 0 0 14px 14px;
  width: 100%;
  transform-origin: left;
  animation: toastProgress 4s linear forwards;
}

.sh-toast--success .sh-toast__progress-bar {
  background: linear-gradient(90deg, #00c864, rgba(0, 200, 100, 0.4));
}

.sh-toast--error .sh-toast__progress-bar {
  background: linear-gradient(90deg, #e8721e, rgba(232, 114, 30, 0.4));
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Mobile */
@media (max-width: 480px) {
  .sh-toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    min-width: unset;
    max-width: unset;
  }
}


/* ─────────────────────────────────────────
   2. BUTTON LOADING STATE
───────────────────────────────────────── */

.form-submit {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.form-submit:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

/* Spinner inside button */
.form-submit .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.form-submit .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

/* Shimmer sweep while loading */
.form-submit.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: btnShimmer 1.2s ease-in-out infinite;
}

@keyframes btnShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}