/* ==========================================================================
   Ditsara Contact Widget - Ultra-Modern Pure Icon Speed Dial
   โรงเรียนดิษฐ์ราการบริบาล (Ditsara School)
   Minimalist: Pure floating circular icon buttons, zero text clutter
   ========================================================================== */

:root {
  --dcw-primary-1: #b339aa;
  --dcw-primary-2: #932c8b;
  --dcw-primary-3: #6b1864;
  --dcw-primary-grad: linear-gradient(135deg, var(--dcw-primary-1) 0%, var(--dcw-primary-2) 50%, var(--dcw-primary-3) 100%);

  --dcw-line-1: #0ae664;
  --dcw-line-2: #06c755;
  --dcw-line-3: #049e42;
  --dcw-line-grad: linear-gradient(135deg, var(--dcw-line-1) 0%, var(--dcw-line-2) 50%, var(--dcw-line-3) 100%);

  --dcw-call-1: #38bdf8;
  --dcw-call-2: #0284c7;
  --dcw-call-3: #0369a1;
  --dcw-call-grad: linear-gradient(135deg, var(--dcw-call-1) 0%, var(--dcw-call-2) 50%, var(--dcw-call-3) 100%);

  --dcw-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

#ditsara-contact-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: "Prompt", "Kanit", "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

#ditsara-contact-widget *,
#ditsara-contact-widget *::before,
#ditsara-contact-widget *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ambient Pulse Wave behind Main Trigger */
.dcw-pulse-ring {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--dcw-primary-2);
  opacity: 0.45;
  pointer-events: none;
  animation: dcwModernPulse 3s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  z-index: 1;
}

@keyframes dcwModernPulse {
  0% {
    transform: scale(0.95);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.45);
    opacity: 0;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

#ditsara-contact-widget.dcw-active .dcw-pulse-ring {
  opacity: 0;
  animation: none;
}

/* Call To Action Tooltip (Initial greeting capsule) */
.dcw-cta-tooltip {
  position: absolute;
  right: 72px;
  bottom: 11px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #1e293b;
  padding: 8px 16px 8px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(147, 44, 139, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s var(--dcw-spring);
  animation: dcwFloat 3.2s ease-in-out infinite;
  z-index: 2;
}

.dcw-cta-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: dcwDotGlow 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes dcwDotGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.dcw-cta-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
  font-size: 11px;
  margin-left: 2px;
  transition: all 0.2s ease;
}

.dcw-cta-close:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

.dcw-cta-tooltip:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.16), 0 6px 14px -2px rgba(147, 44, 139, 0.18);
}

@keyframes dcwFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

#ditsara-contact-widget.dcw-active .dcw-cta-tooltip,
.dcw-cta-tooltip.dcw-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px) scale(0.9);
}

/* Main Trigger Button */
.dcw-trigger {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--dcw-primary-grad);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px -2px rgba(147, 44, 139, 0.55), 0 4px 10px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s var(--dcw-spring), box-shadow 0.3s ease;
  z-index: 3;
  outline: none;
}

.dcw-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px -2px rgba(147, 44, 139, 0.7), 0 6px 14px rgba(0, 0, 0, 0.18);
}

.dcw-trigger:active {
  transform: scale(0.94);
}

/* Online status dot on trigger button */
.dcw-trigger-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

#ditsara-contact-widget.dcw-active .dcw-trigger-badge {
  opacity: 0;
  transform: scale(0);
}

/* Icons inside Trigger Button */
.dcw-trigger-icon {
  width: 27px;
  height: 27px;
  fill: #ffffff;
  position: absolute;
  transition: transform 0.4s var(--dcw-spring), opacity 0.25s ease;
}

.dcw-icon-chat {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.dcw-icon-close {
  opacity: 0;
  transform: rotate(-120deg) scale(0.4);
}

#ditsara-contact-widget.dcw-active .dcw-icon-chat {
  opacity: 0;
  transform: rotate(120deg) scale(0.4);
}

#ditsara-contact-widget.dcw-active .dcw-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Speed-dial Items List (Pure vertical icon stack centered above trigger) */
.dcw-items-list {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 58px;
  display: flex;
  flex-direction: column-reverse; /* bottom-to-top order */
  align-items: center;
  gap: 14px;
  pointer-events: none;
  z-index: 2;
}

/* Single Speed-dial Item */
.dcw-dial-item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  opacity: 0;
  transform: translateY(24px) scale(0.5);
  transition: opacity 0.25s ease, transform 0.35s var(--dcw-spring);
  pointer-events: none;
}

#ditsara-contact-widget.dcw-active .dcw-items-list {
  pointer-events: auto;
}

#ditsara-contact-widget.dcw-active .dcw-dial-item {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Staggered Spring Bounce */
#ditsara-contact-widget.dcw-active .dcw-dial-item:nth-child(1) {
  transition-delay: 0.04s;
}

#ditsara-contact-widget.dcw-active .dcw-dial-item:nth-child(2) {
  transition-delay: 0.11s;
}

/* Circular Dial Buttons */
.dcw-dial-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s var(--dcw-spring), box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dcw-dial-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.38), transparent 60%);
  pointer-events: none;
}

.dcw-dial-item:hover .dcw-dial-btn {
  transform: scale(1.14);
}

.dcw-dial-btn svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
  transition: transform 0.25s var(--dcw-spring);
  position: relative;
  z-index: 1;
}

.dcw-dial-item:hover .dcw-dial-btn svg {
  transform: scale(1.08);
}

/* Specific Channel Buttons */
.dcw-item-line .dcw-dial-btn {
  background: var(--dcw-line-grad);
  box-shadow: 0 8px 20px -2px rgba(6, 199, 85, 0.55), 0 3px 8px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.dcw-item-line:hover .dcw-dial-btn {
  box-shadow: 0 12px 28px -2px rgba(6, 199, 85, 0.75), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dcw-item-call .dcw-dial-btn {
  background: var(--dcw-call-grad);
  box-shadow: 0 8px 20px -2px rgba(2, 132, 199, 0.55), 0 3px 8px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.dcw-item-call:hover .dcw-dial-btn {
  box-shadow: 0 12px 28px -2px rgba(2, 132, 199, 0.75), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hide all text labels completely - Pure Icon Mode */
.dcw-dial-label {
  display: none !important;
}

/* Mobile & Small Screens Optimization */
@media (max-width: 480px) {
  #ditsara-contact-widget {
    bottom: 18px;
    right: 18px;
  }

  .dcw-trigger {
    width: 52px;
    height: 52px;
  }

  .dcw-pulse-ring {
    width: 52px;
    height: 52px;
  }

  .dcw-dial-btn {
    width: 46px;
    height: 46px;
  }

  .dcw-dial-btn svg {
    width: 24px;
    height: 24px;
  }

  .dcw-items-list {
    bottom: 64px;
    width: 52px;
    gap: 12px;
  }

  .dcw-cta-tooltip {
    right: 64px;
    bottom: 7px;
    font-size: 12.5px;
    padding: 7px 13px 7px 11px;
  }
}

/* ==========================================================================
   Ditsara Modern Contact Form - Premium Elevated Styling
   ========================================================================== */

/* Box sizing for form elements */
.df-card,
.df-card *,
.df-card *::before,
.df-card *::after {
  box-sizing: border-box;
}

/* Apply Prompt font to text elements only */
.df-card,
.df-card input,
.df-card textarea,
.df-card button,
.df-card select,
.df-card label,
.df-card p,
.df-card h1,
.df-card h2,
.df-card h3,
.df-card h4,
.df-card .df-badge,
.df-card .df-subtitle,
.df-card .df-error-msg,
.df-card .df-captcha-label,
.df-card .df-footer-bar,
.df-card .df-trust-item,
.df-card .df-direct-channels,
.df-card .df-chip {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Explicitly protect FontAwesome icons from font-family override */
.df-card .fa,
.df-card [class*="fa-"],
.df-card .fa::before,
.df-card [class*="fa-"]::before {
  font-family: 'FontAwesome' !important;
  font-style: normal !important;
  font-weight: normal !important;
  line-height: 1 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.df-card {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.08), 0 4px 16px -2px rgba(147, 44, 139, 0.04), 0 0 1px rgba(0, 0, 0, 0.08);
  padding: 46px 52px;
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
}

.df-card:hover {
  box-shadow: 0 28px 60px -15px rgba(147, 44, 139, 0.12), 0 8px 24px -4px rgba(0, 0, 0, 0.05), 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Gradient accent bar on top */
.df-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #932c8b 0%, #c026d3 50%, #932c8b 100%);
  box-shadow: 0 2px 10px rgba(147, 44, 139, 0.3);
}

/* Header */
.df-header {
  text-align: center;
  margin-bottom: 34px;
}

.df-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(147, 44, 139, 0.09) 0%, rgba(192, 38, 211, 0.05) 100%);
  color: #932c8b;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 9999px;
  letter-spacing: 0.3px;
  border: 1px solid rgba(147, 44, 139, 0.18);
  box-shadow: 0 2px 6px rgba(147, 44, 139, 0.06);
  margin-bottom: 12px;
}

.df-badge i {
  font-size: 13px;
}

.df-title {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
  line-height: 1.3;
}

.df-subtitle {
  font-size: 15px;
  color: #64748b;
  margin: 0 auto;
  max-width: 520px;
  line-height: 1.6;
}

.df-header-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #932c8b, #c026d3);
  border-radius: 3px;
  margin: 18px auto 0;
}

/* Field Group */
.df-group {
  margin-bottom: 22px;
  position: relative;
}

.df-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.df-label .req {
  color: #ef4444;
  margin-left: 3px;
  font-weight: 700;
}

/* Input Wrapper with left icon */
.df-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.df-icon {
  position: absolute;
  left: 17px;
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 2;
}

.df-input {
  width: 100%;
  height: 50px;
  padding: 12px 18px 12px 48px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14.5px;
  color: #0f172a;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.df-input::placeholder {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 400;
}

.df-input:hover:not(:focus) {
  border-color: #cbd5e1;
  background: #ffffff;
}

.df-input:focus {
  background: #ffffff;
  border-color: #932c8b;
  box-shadow: 0 0 0 4px rgba(147, 44, 139, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.01);
}

.df-input-wrap:focus-within .df-icon {
  color: #932c8b;
  transform: scale(1.15);
}

/* Textarea */
.df-textarea-wrap .df-icon-textarea {
  top: 16px;
}

.df-textarea {
  width: 100%;
  min-height: 125px;
  padding: 14px 18px 14px 48px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14.5px;
  color: #0f172a;
  outline: none;
  transition: all 0.25s ease;
  resize: vertical;
  line-height: 1.6;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.df-textarea::placeholder {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 400;
}

.df-textarea:hover:not(:focus) {
  border-color: #cbd5e1;
  background: #ffffff;
}

.df-textarea:focus {
  background: #ffffff;
  border-color: #932c8b;
  box-shadow: 0 0 0 4px rgba(147, 44, 139, 0.12);
}

/* Error States */
.df-group.has-error .df-input,
.df-group.has-error .df-textarea {
  border-color: #f43f5e !important;
  background: #fff5f6 !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15) !important;
}

.df-group.has-error .df-icon {
  color: #f43f5e !important;
}

.df-error-msg {
  display: none;
  color: #e11d48;
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 6px;
  padding-left: 4px;
  line-height: 1.4;
}

/* Security Captcha Card */
.df-captcha-box {
  background: linear-gradient(135deg, #fdf8fd 0%, #faf5fc 100%);
  border: 1.5px solid #ebd4eb;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(147, 44, 139, 0.04);
}

.df-captcha-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.df-captcha-badge {
  background: rgba(147, 44, 139, 0.1);
  color: #932c8b;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.df-captcha-label {
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
}

.df-captcha-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.df-captcha-math {
  display: flex;
  align-items: center;
  gap: 7px;
}

.df-captcha-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 95px;
  background: #ffffff;
  border: 1.5px solid #d8b4fe;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 15.5px;
  color: #932c8b;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(147, 44, 139, 0.08);
}

.df-captcha-refresh {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  width: 35px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.df-captcha-refresh:hover {
  background: #f3e8f5;
  color: #932c8b;
  border-color: #d8b4fe;
  transform: rotate(180deg);
}

.df-captcha-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.df-captcha-equal {
  font-weight: 700;
  font-size: 18px;
  color: #932c8b;
}

.df-captcha-input {
  width: 95px;
  height: 42px;
  background: #ffffff;
  border: 1.5px solid #d8b4fe;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
}

.df-captcha-input:focus {
  border-color: #932c8b;
  box-shadow: 0 0 0 3px rgba(147, 44, 139, 0.15);
}

/* Submit Button */
.df-btn-submit {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #a02888 0%, #871c72 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px -4px rgba(147, 44, 139, 0.45), 0 4px 10px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  letter-spacing: 0.2px;
}

.df-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -4px rgba(147, 44, 139, 0.6), 0 6px 14px rgba(0, 0, 0, 0.1);
  filter: brightness(1.04);
}

.df-btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px -2px rgba(147, 44, 139, 0.4);
}

.df-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Footer Bar & Direct Channels */
.df-footer-bar {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #64748b;
}

.df-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.df-trust-item i {
  color: #10b981;
}

.df-direct-channels {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.df-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.df-chip-line {
  background: #06C755;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(6, 199, 85, 0.25);
}

.df-chip-line:hover {
  background: #05a847;
  transform: translateY(-1px);
  color: #ffffff !important;
}

.df-chip-phone {
  background: #0284c7;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.df-chip-phone:hover {
  background: #0369a1;
  transform: translateY(-1px);
  color: #ffffff !important;
}

/* Alert Boxes */
#form-result.alert {
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

#form-result.alert-success {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #065f46;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

#form-result.alert-danger {
  background: #fff1f2;
  border: 1.5px solid #fecdd3;
  color: #9f1239;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
  .df-card {
    padding: 30px 20px;
    border-radius: 18px;
  }

  .df-title {
    font-size: 24px;
  }

  .df-captcha-box {
    flex-direction: column;
    align-items: stretch;
  }

  .df-captcha-action-row {
    justify-content: space-between;
  }

  .df-footer-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .df-direct-channels {
    justify-content: center;
  }
}

