/* =========================================================
   allform.css — Premium UI (merged: advanced + fallback)
   ========================================================= */

/* ===== OVERLAYS (fullscreen, animated) ===== */
#apllFormOverlay,
#fallbackFormOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 35, 0.70);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

#apllFormOverlay.is-visible,
#fallbackFormOverlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ===== FORM BOX (card, gradient, animated) ===== */
#apllFormBox {
  position: relative;
  width: 92%;
  max-width: 420px;
  border-radius: 18px;
  padding: 20px 18px 18px;
  background: radial-gradient(120% 180% at 0% 0%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 45%, rgba(245,248,255,0.96) 100%),
              linear-gradient(180deg, #f5f8ff 0%, #dbe4f6 40%, #bfcde8 100%);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.30),
    0 0 0 1px rgba(255,255,255,0.45);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;

  transform: translateY(14px) scale(0.96);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

#apllFormOverlay.is-visible #apllFormBox,
#fallbackFormOverlay.is-visible #apllFormBox {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  #apllFormOverlay,
  #fallbackFormOverlay,
  #apllFormBox {
    transition: none !important;
  }
}

/* ===== TOP CHIP ===== */
#apllFormChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(10, 46, 92, 0.06);
  color: #0A2E5C;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

#apllFormChipDot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.25);
}

/* ===== HEADING & SUBTEXT ===== */
#apllFormBox h2 {
  margin: 3px 0 4px;
  font-size: 22px;
  font-weight: 750;
  color: #0A2E5C;
  letter-spacing: .02em;
}

#apllFormSubtitle {
  font-size: 13px;
  margin: 0 0 14px;
  color: #4c5564;
}

/* ===== CLOSE ICON ===== */
#apllCloseIcon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 2px 8px rgba(15,23,42,0.20);
  color: #111827;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

#apllCloseIcon:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15,23,42,0.26);
}

#apllCloseIcon:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(15,23,42,0.18);
}

/* ===== FORM FIELDS ===== */
#apllForm {
  margin-top: 4px;
}

#apllForm label {
  display: block;
  margin: 7px 0 3px;
  font-size: 12px;
  font-weight: 600;
  color: #1f2933;
}

#apllForm small {
  font-size: 11px;
  color: #6b7280;
}

#apllForm input,
#apllForm select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid #c8ced8;
  font-size: 16px !important;
  background: rgba(255,255,255,0.96);
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

#apllForm input:focus,
#apllForm select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.40);
  background: #ffffff;
}

#apllForm input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  height: 40px;
}

/* Weekend disabled */
#apllTime.apll-closed {
  background: #f3f4f6 !important;
  color: #9ca3af;
  cursor: not-allowed;
}

/* ===== BUTTONS ===== */
#apllSubmit,
#apllClose {
  width: 100%;
  padding: 11px 14px;
  margin-top: 10px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 80ms ease, box-shadow 120ms ease, filter 120ms ease, background-color 120ms ease;
}

#apllSubmit {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.38);
}

#apllSubmit:hover {
  filter: brightness(0.97);
  box-shadow: 0 9px 22px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

#apllSubmit:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

#apllClose {
  background: rgba(255,255,255,0.9);
  color: #0f172a;
  border: 1px solid rgba(148,163,184,0.7);
  box-shadow: 0 3px 8px rgba(15,23,42,0.16);
}

#apllClose:hover {
  background: #ffffff;
  box-shadow: 0 5px 12px rgba(15,23,42,0.22);
  transform: translateY(-1px);
}

#apllClose:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15,23,42,0.18);
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
  #apllFormBox {
    padding: 18px 14px 16px;
    border-radius: 16px;
  }
  #apllFormBox h2 {
    font-size: 20px;
  }
}