/* Proxim Digital — Contact widget */
#pd-widget-root {
  --pd-accent: #c94c1a;
  --pd-accent-dark: #a83d14;
  --pd-bg: #ffffff;
  --pd-bg-alt: #f5f2ee;
  --pd-text: #1a1816;
  --pd-muted: #7a6d64;
  --pd-border: #e2ded8;
  --pd-green: #22c55e;
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] #pd-widget-root {
  --pd-bg: #222019;
  --pd-bg-alt: #2c2a22;
  --pd-text: #eae7e3;
  --pd-muted: #a89e94;
  --pd-border: #3a3632;
}

#pd-widget-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--pd-accent);
  border: none;
  box-shadow: 0 6px 20px rgba(201, 76, 26, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  padding: 0;
}

#pd-widget-launcher:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(201, 76, 26, 0.45), 0 4px 10px rgba(0, 0, 0, 0.2);
}

#pd-widget-launcher:focus-visible {
  outline: 3px solid rgba(201, 76, 26, 0.4);
  outline-offset: 4px;
}

#pd-widget-launcher.pd-widget-launcher-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.7);
}

.pd-widget-launcher-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  background: var(--pd-green);
  border-radius: 50%;
  border: 2px solid var(--pd-accent);
  animation: pd-widget-pulse 2s infinite;
}

@keyframes pd-widget-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

#pd-widget-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: var(--pd-bg);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 8px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#pd-widget-panel.pd-widget-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.pd-widget-header {
  background: var(--pd-accent);
  color: #fff;
  padding: 22px 22px 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.pd-widget-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.pd-widget-subtitle {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.pd-widget-status {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-widget-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pd-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

#pd-widget-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

#pd-widget-close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.pd-widget-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.pd-widget-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--pd-bg-alt);
  border: 1px solid var(--pd-border);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--pd-text);
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.pd-widget-option:hover {
  border-color: var(--pd-accent);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pd-widget-option-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(201, 76, 26, 0.1);
  color: var(--pd-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pd-widget-option-text {
  flex: 1;
}

.pd-widget-option-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--pd-text);
  margin-bottom: 2px;
}

.pd-widget-option-sub {
  font-size: 0.8rem;
  color: var(--pd-muted);
  line-height: 1.4;
}

.pd-widget-option-arrow {
  font-size: 1.4rem;
  color: var(--pd-muted);
  font-weight: 300;
}

.pd-widget-callback-form {
  padding: 16px 20px 20px;
  display: none;
  flex-direction: column;
  gap: 10px;
}

.pd-widget-callback-form.pd-widget-form-visible {
  display: flex;
}

.pd-widget-back {
  background: none;
  border: none;
  color: var(--pd-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 8px;
  text-align: left;
  align-self: flex-start;
  font-family: inherit;
}

.pd-widget-back:hover {
  color: var(--pd-accent);
}

.pd-widget-form-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--pd-text);
  margin-bottom: 8px;
}

.pd-widget-callback-form form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-widget-callback-form input,
.pd-widget-callback-form textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--pd-border);
  border-radius: 9px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--pd-bg);
  color: var(--pd-text);
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}

.pd-widget-callback-form input:focus,
.pd-widget-callback-form textarea:focus {
  border-color: var(--pd-accent);
}

.pd-widget-callback-form button[type="submit"] {
  padding: 12px 18px;
  background: var(--pd-accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  margin-top: 2px;
}

.pd-widget-callback-form button[type="submit"]:hover {
  background: var(--pd-accent-dark);
}

.pd-widget-form-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  color: var(--pd-text);
  font-size: 0.92rem;
  gap: 10px;
}

.pd-widget-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--pd-green);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-widget-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--pd-border);
  font-size: 0.78rem;
  color: var(--pd-muted);
  text-align: center;
  background: var(--pd-bg-alt);
}

.pd-widget-footer a {
  color: var(--pd-accent);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 480px) {
  #pd-widget-launcher {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
  #pd-widget-panel {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #pd-widget-launcher,
  #pd-widget-panel,
  .pd-widget-option {
    transition: none;
  }
  .pd-widget-launcher-dot {
    animation: none;
  }
}
