/* ================================================================
   visitor-widget.css — Floating Visitor Form Widget
   Drop this on any page that also includes visitor-widget.js
   ================================================================ */

/* ── WIDGET TOKENS ──────────────────────────────────────────────── */
:root {
  --vw-accent:      #00e5ff;
  --vw-accent2:     #ff3d71;
  --vw-bg:          #13141a;
  --vw-card:        #1a1c25;
  --vw-text:        #e8eaf0;
  --vw-muted:       #6b7080;
  --vw-border:      rgba(255, 255, 255, 0.09);
  --vw-glow:        0 0 30px rgba(0, 229, 255, 0.18);
  --vw-radius:      10px;
  --vw-z:           9999;
}

/* ── FAB BUTTON ─────────────────────────────────────────────────── */
#vw-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: var(--vw-z);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--vw-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.35);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  outline: none;
}

#vw-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0, 229, 255, 0.5);
}

#vw-fab svg {
  width: 24px;
  height: 24px;
  fill: #0b0c10;
  transition: transform 0.3s ease;
}

#vw-fab.open svg {
  transform: rotate(45deg);
}

/* pulse ring */
#vw-fab::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(0, 229, 255, 0.4);
  animation: vw-pulse 2.5s ease-out infinite;
}

@keyframes vw-pulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ── PANEL ──────────────────────────────────────────────────────── */
#vw-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  z-index: var(--vw-z);
  width: 340px;
  background-color: var(--vw-card);
  border: 1px solid var(--vw-border);
  border-radius: var(--vw-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--vw-glow);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  overflow: hidden;

  /* hidden state */
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

#vw-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

/* panel header */
#vw-panel-header {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(255, 61, 113, 0.08));
  border-bottom: 1px solid var(--vw-border);
  padding: 1.1rem 1.25rem 1rem;
}

#vw-panel-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--vw-text);
  margin-bottom: 0.2rem;
}

#vw-panel-header p {
  font-size: 0.78rem;
  color: var(--vw-muted);
}

/* panel body */
#vw-panel-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ── FORM FIELDS ────────────────────────────────────────────────── */
.vw-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.vw-field label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vw-muted);
}

.vw-field input,
.vw-field select,
.vw-field textarea {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--vw-border);
  border-radius: 6px;
  color: var(--vw-text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.6rem 0.85rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vw-field input::placeholder,
.vw-field textarea::placeholder {
  color: var(--vw-muted);
  opacity: 0.6;
}

.vw-field input:focus,
.vw-field select:focus,
.vw-field textarea:focus {
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.08);
}

.vw-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7080' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

.vw-field select option {
  background-color: #1a1c25;
  color: var(--vw-text);
}

.vw-field textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}

/* optional badge */
.vw-optional {
  font-size: 0.65rem;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--vw-border);
  color: var(--vw-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  letter-spacing: 0.05em;
  vertical-align: middle;
  text-transform: none;
  font-weight: 400;
}

/* ── SUBMIT BUTTON ──────────────────────────────────────────────── */
#vw-submit {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--vw-accent);
  color: #0b0c10;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.2rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#vw-submit:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}

#vw-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* anonymous note */
#vw-anon-note {
  font-size: 0.72rem;
  color: var(--vw-muted);
  text-align: center;
  padding-bottom: 0.25rem;
}

/* ── SUCCESS STATE ──────────────────────────────────────────────── */
#vw-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  text-align: center;
  gap: 0.75rem;
}

#vw-success .vw-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(0, 229, 255, 0.12);
  border: 2px solid var(--vw-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

#vw-success h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--vw-text);
}

#vw-success p {
  font-size: 0.83rem;
  color: var(--vw-muted);
}

/* ── TOAST (error) ──────────────────────────────────────────────── */
#vw-toast {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  z-index: calc(var(--vw-z) + 10);
  background-color: #1a1c25;
  border: 1px solid rgba(255, 61, 113, 0.4);
  color: var(--vw-accent2);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#vw-toast.show {
  opacity: 1;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 400px) {
  #vw-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
  }

  #vw-fab {
    right: 1rem;
    bottom: 1rem;
  }
}

