/* ══════════════════════════════════════════════════════════════════
   JG INTERACTIVE BOOKING FORM – PREMIUM DARK REDESIGN (Form ID: 5)
   Gravity Forms + Simply Schedule Appointments Custom Integration
   ══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --accent: #6C63FF;
  --accent-light: #8B84FF;
  --accent-glow: rgba(108, 99, 255, 0.35);
  --accent2: #00D4AA;
  --accent2-light: rgba(0,212,170,0.15);
  --bg: #0D0E1C;
  --bg2: #13142A;
  --bg3: #1A1B35;
  --card: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.09);
  --input-bg: rgba(255,255,255,0.06);
  --input-border: rgba(255,255,255,0.12);
  --input-focus: rgba(108,99,255,0.5);
  --text: #F0F1FF;
  --text-muted: rgba(240,241,255,0.45);
  --text-sub: rgba(240,241,255,0.65);
  --slot-bg: rgba(255,255,255,0.05);
  --slot-hover: rgba(108,99,255,0.18);
  --slot-active: #6C63FF;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}



/* ── WRAPPER & FORM CARD ────────────────────────────────────── */
#preview_form_container {
  width: 100% !important;
  max-width: 780px !important;
  margin: 0 auto !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#gform_wrapper_5, #gform_wrapper_8 {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

#gform_wrapper_5, #gform_wrapper_8 .gform_heading {
  display: none !important; /* Custom HTML header used instead */
}

#gform_5, #gform_8 {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  background: rgba(19,20,42,0.80) !important;
  backdrop-filter: blur(32px) saturate(160%) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 28px !important;
  padding: 44px 44px 40px !important;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(108,99,255,0.08) inset !important;
  box-sizing: border-box !important;
  animation: slideUp 0.6s cubic-bezier(0.16,1,0.3,1) both !important;
}

#gform_5, #gform_8::before {
  display: none !important;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#gform_wrapper_5, #gform_wrapper_8 ul.gform_fields {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

#gform_wrapper_5, #gform_wrapper_8 .gfield {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* ── HEADER FIELD ───────────────────────────────────────────── */
.gfield.jgb-header-field {
  margin-bottom: 12px !important;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent2-light);
  border: 1px solid rgba(0,212,170,0.25);
  color: var(--accent2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}
.badge::before { content: '●'; font-size: 8px; animation: pulse 2s ease-in-out infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

h1 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 32px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  line-height: 1.15 !important;
  letter-spacing: -0.5px !important;
  margin: 0 !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
h1 span { background: linear-gradient(135deg, #6C63FF, #00D4AA); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.header-subtitle {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.step-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.step-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 28px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  transition: var(--transition);
}
.dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.dot.done   { background: var(--accent2); }

.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent); margin: 0 0 24px; }

/* ── SECTION LABELS ─────────────────────────────────────────── */
.gfield.section-heading {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--text-sub) !important;
  margin: 12px 0 6px !important;
  border: none !important;
  padding: 0 !important;
}
.gfield.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.gfield.section-heading .gfield_label {
  display: none !important; /* Hide default label */
}

.gfield.section-heading h2 {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--text-sub) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── INPUT FIELDS & LABELS ───────────────────────────────────── */
#gform_wrapper_5, #gform_wrapper_8 .gfield_label {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--text-sub) !important;
  margin-bottom: 7px !important;
}

#gform_wrapper_5, #gform_wrapper_8 .gfield_required {
  color: var(--accent) !important;
  margin-left: 2px;
}

#gform_wrapper_5, #gform_wrapper_8 .ginput_container {
  position: relative;
  display: flex;
  align-items: center;
}

/* Pseudo-icons for GF inputs */
.jgb-firstname-field .ginput_container::before,
.jgb-email-field .ginput_container::before,
.jg-dept-select .ginput_container::before {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
  transition: var(--transition);
  z-index: 2;
}

.jgb-firstname-field .ginput_container::before { content: '✦'; }
.jgb-email-field .ginput_container::before { content: '✉'; }
.jg-dept-select .ginput_container::before { content: '🏥'; }

#gform_wrapper_5, #gform_wrapper_8 input[type="text"],
#gform_wrapper_5, #gform_wrapper_8 input[type="email"],
#gform_wrapper_5, #gform_wrapper_8 input[type="tel"],
#gform_wrapper_5, #gform_wrapper_8 select {
  width: 100% !important;
  background: var(--input-bg) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: var(--radius-xs) !important;
  color: var(--text) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  padding: 12px 14px 12px 40px !important;
  outline: none !important;
  transition: var(--transition) !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-sizing: border-box !important;
}

#gform_wrapper_5, #gform_wrapper_8 input::placeholder,
#gform_wrapper_5, #gform_wrapper_8 select::placeholder {
  color: var(--text-muted) !important;
}

#gform_wrapper_5, #gform_wrapper_8 select option { color: #6c63ff !important; }

#gform_wrapper_5, #gform_wrapper_8 input:focus,
#gform_wrapper_5, #gform_wrapper_8 select:focus {
  border-color: var(--accent) !important;
  background: rgba(108,99,255,0.08) !important;
  box-shadow: 0 0 0 3px var(--input-focus) !important;
}

#gform_wrapper_5, #gform_wrapper_8 input:focus ~ .icon,
#gform_wrapper_5, #gform_wrapper_8 select:focus ~ .icon {
  color: var(--accent-light);
}

/* ── Custom select chevron ── */
.jg-dept-select .ginput_container::after {
  content: '▾';
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 12px;
  z-index: 2;
}

/* ── PHONE INPUT ── */
.phone-input-wrap { position: relative; }

/* ── TWO-COLUMN ROW LAYOUT FOR DESKTOP ── */
@media (min-width: 601px) {
  #gform_wrapper_5, #gform_wrapper_8 .gfield.gf_left_half {
    float: left !important;
    width: calc(90% - 8px) !important;
    clear: left !important;
  }
  #gform_wrapper_5, #gform_wrapper_8 .gfield.gf_right_half {
    float: right !important;
    width: calc(90% - 8px) !important;
    clear: right !important;
  }
  /* Clearfix for form layout */
  #gform_fields_5, #gform_fields_8::after {
    content: "";
    display: table;
    clear: both;
  }
}

/* ── DATETIME ROW ────────────────────────────────── */
.datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 6px;
}

/* ── CALENDAR ── */
.cal-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-sub);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}
.cal-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-day-name {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0 8px;
  letter-spacing: 0.05em;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.cal-day:hover:not(.empty):not(.disabled) {
  background: var(--slot-hover);
  color: var(--accent-light);
}
.cal-day.today { color: var(--accent2); font-weight: 700; }
.cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent2);
}
.cal-day.selected {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.cal-day.disabled { opacity: 0.25; cursor: not-allowed; }
.cal-day.empty { cursor: default; }
.cal-day.other-month { opacity: 0.3; }

/* ── TIME SLOTS ── */
.time-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.selected-date-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.selected-date-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.selected-date-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.slots-scroll { flex: 1; overflow-y: auto; max-height: 250px; }
.slots-scroll::-webkit-scrollbar { width: 4px; }
.slots-scroll::-webkit-scrollbar-track { background: transparent; }
.slots-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.period-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 10px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.period-label .period-icon { font-size: 13px; }
.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 4px;
}
.slot {
  background: var(--slot-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xs);
  padding: 9px 5px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.slot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), #8B84FF);
  opacity: 0;
  transition: var(--transition);
}
.slot span { position: relative; z-index: 1; }
.slot:hover:not(.booked) {
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-1px);
}
.slot.selected {
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.slot.selected::before { opacity: 1; }
.slot.booked {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ── SUBMIT ROW ─────────────────────────────────────── */
#gform_wrapper_5, #gform_wrapper_8 .gform_footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 16px !important;
  margin-top: 28px !important;
  padding: 24px 0 0 !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  background: transparent !important;
}


#gform_wrapper_5, #gform_wrapper_8 .gform_button,
#gform_wrapper_5, #gform_wrapper_8 input[type="submit"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  background: linear-gradient(135deg, #6C63FF 0%, #8B84FF 100%) !important;
  border: none !important;
  border-radius: 100px !important;
  color: #fff !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  padding: 14px 32px !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  position: relative !important;
  overflow: hidden !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 8px 32px var(--accent-glow) !important;
  height: auto !important;
  line-height: 1 !important;
}

#gform_wrapper_5, #gform_wrapper_8 .gform_button::after,
#gform_wrapper_5, #gform_wrapper_8 input[type="submit"]::after {
  content: '→';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  font-size: 13px;
  transition: transform 0.25s;
  margin-left: 8px;
}

#gform_wrapper_5, #gform_wrapper_8 .gform_button:hover,
#gform_wrapper_5, #gform_wrapper_8 input[type="submit"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 36px var(--accent-glow) !important;
}

#gform_wrapper_5, #gform_wrapper_8 .gform_button:hover::after,
#gform_wrapper_5, #gform_wrapper_8 input[type="submit"]:hover::after {
  transform: translateX(3px);
}

#gform_wrapper_5, #gform_wrapper_8 .gform_button:active,
#gform_wrapper_5, #gform_wrapper_8 input[type="submit"]:active {
  transform: translateY(0) !important;
}

/* ── SUCCESS TOAST ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: rgba(19,20,42,0.95);
  border: 1px solid var(--accent2);
  border-radius: 14px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  z-index: 99999;
  pointer-events: none;
  box-sizing: border-box;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { font-size: 22px; }
.toast-msg { font-size: 13.5px; font-weight: 600; color: var(--text); }
.toast-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── VALIDATION ERRORS & FIELDS ────────────────────────────── */
#gform_wrapper_5, #gform_wrapper_8 .validation_error,
#gform_wrapper_5, #gform_wrapper_8 .gfield_validation_message {
  display: none !important; /* Handled via shakes + tooltip styles */
}

#gform_wrapper_5, #gform_wrapper_8 .gfield_error input,
#gform_wrapper_5, #gform_wrapper_8 .gfield_error select {
  border-color: #EF4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

/* ── SHAKE STYLE FOR VALIDATION FAILURE ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ── SUCCESS MESSAGE STYLING ── */
#gform_confirmation_wrapper_5, #gform_confirmation_wrapper_8,
#gforms_confirmation_message_5, #gforms_confirmation_message_8 {
  background: rgba(19,20,42,0.80) !important;
  backdrop-filter: blur(32px) saturate(160%) !important;
  border: 1px solid var(--accent2) !important;
  border-radius: 28px !important;
  padding: 60px 40px !important;
  text-align: center !important;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55) !important;
  animation: slideUp 0.6s cubic-bezier(0.16,1,0.3,1) both !important;
  color: var(--text) !important;
  max-width: 500px !important;
  margin: 40px auto !important;
  font-family: 'Outfit', sans-serif !important;
}

#gforms_confirmation_message_5, #gforms_confirmation_message_8 h3 {
  color: var(--accent2) !important;
  font-size: 26px !important;
  margin-bottom: 12px !important;
  font-weight: 800 !important;
}

#gforms_confirmation_message_5, #gforms_confirmation_message_8 p {
  color: var(--text-sub) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  margin: 0 !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  #gform_5, #gform_8 {
    padding: 28px 20px 24px !important;
    border-radius: 20px !important;
  }
  h1 { font-size: 24px !important; }
  .datetime-row { grid-template-columns: 1fr; }
  #gform_wrapper_5, #gform_wrapper_8 .gform_footer { flex-direction: column; align-items: stretch !important; }
  #gform_wrapper_5, #gform_wrapper_8 .gform_button,
  #gform_wrapper_5, #gform_wrapper_8 input[type="submit"] { justify-content: center !important; width: 100% !important; }

}


/* ── RTL OVERRIDES FOR ARABIC CALENDAR & FORM ── */
html[lang="ar"] #gform_wrapper_8 {
  direction: rtl !important;
  text-align: right !important;
}

html[lang="ar"] #gform_8 {
  direction: rtl !important;
  text-align: right !important;
}

html[lang="ar"] .jgb-firstname-field .ginput_container::before,
html[lang="ar"] .jgb-email-field .ginput_container::before,
html[lang="ar"] .jg-dept-select .ginput_container::before {
  right: 14px !important;
  left: auto !important;
}

html[lang="ar"] #gform_wrapper_8 input[type="text"],
html[lang="ar"] #gform_wrapper_8 input[type="email"],
html[lang="ar"] #gform_wrapper_8 input[type="tel"],
html[lang="ar"] #gform_wrapper_8 select {
  padding: 12px 40px 12px 14px !important;
}

html[lang="ar"] .jg-dept-select .ginput_container::after {
  left: 14px !important;
  right: auto !important;
}

html[lang="ar"] .cal-btn {
  transform: scaleX(-1); /* Flips arrows for RTL */
}

@media (min-width: 601px) {
  html[lang="ar"] #gform_wrapper_8 .gfield.gf_left_half {
    float: right !important;
    width: calc(90% - 8px) !important;
    clear: right !important;
  }
  html[lang="ar"] #gform_wrapper_8 .gfield.gf_right_half {
    float: left !important;
    width: calc(90% - 8px) !important;
    clear: left !important;
  }
  html[lang="ar"] #gform_fields_8::after {
    content: "";
    display: table;
    clear: both;
  }
}
