/* EFCV chat widget — vanilla, no framework, dark theme to match site */
:root {
  --efcv-gold: hsl(45 70% 55%);
  --efcv-bg: hsl(220 20% 8%);
  --efcv-panel: hsl(220 20% 12%);
  --efcv-line: hsl(220 15% 22%);
  --efcv-text: hsl(45 20% 92%);
  --efcv-muted: hsl(220 10% 65%);
}

#efcv-chat-launcher {
  position: fixed; right: 20px; bottom: 56px; z-index: 90;
  width: 68px; height: 68px; border-radius: 50%;
  background: transparent; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
  animation: efcvDrift 5s ease-in-out infinite, efcvHaloIdle 3.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px hsl(45 80% 55% / 0.45));
}
#efcv-chat-launcher .efcv-logo {
  width: 100%; height: 100%; object-fit: contain; display: block;
  border-radius: 50%;
}
#efcv-chat-launcher:hover { transform: scale(1.1); }
#efcv-chat-launcher.efcv-glow { animation: efcvDrift 5s ease-in-out infinite, efcvHaloPulse 1.4s ease-in-out infinite; }

@keyframes efcvHaloIdle {
  0%, 100% { filter: drop-shadow(0 0 8px hsl(45 85% 55% / 0.45))  drop-shadow(0 4px 10px hsl(0 0% 0% / 0.5)); }
  50%      { filter: drop-shadow(0 0 18px hsl(45 90% 60% / 0.75)) drop-shadow(0 6px 14px hsl(0 0% 0% / 0.55)); }
}
@keyframes efcvHaloPulse {
  0%, 100% { filter: drop-shadow(0 0 10px hsl(45 95% 60% / 0.8))  drop-shadow(0 0 22px hsl(45 95% 60% / 0.6)) drop-shadow(0 4px 10px hsl(0 0% 0% / 0.5)); }
  50%      { filter: drop-shadow(0 0 28px hsl(45 95% 65% / 1))    drop-shadow(0 0 46px hsl(45 95% 60% / 0.5)) drop-shadow(0 6px 14px hsl(0 0% 0% / 0.55)); }
}
@keyframes efcvDrift {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(-2px, -3px); }
  50%      { transform: translate(2px, -1px); }
  75%      { transform: translate(-1px, 2px); }
}
@media (prefers-reduced-motion: reduce) {
  #efcv-chat-launcher { animation: none; }
}
#efcv-chat-bubble {
  position: fixed; right: 88px; bottom: 70px; z-index: 90;
  max-width: 240px; padding: 10px 14px;
  background: var(--efcv-panel); color: var(--efcv-text);
  border: 1px solid var(--efcv-line); border-radius: 14px;
  font-family: 'Geist', system-ui, sans-serif; font-size: 13px;
  box-shadow: 0 8px 24px hsl(0 0% 0% / 0.4);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#efcv-chat-bubble.efcv-show { opacity: 1; transform: translateY(0); pointer-events: auto; }

#efcv-chat-panel {
  position: fixed; right: 20px; bottom: 56px; z-index: 91;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 96px));
  background: var(--efcv-bg); color: var(--efcv-text);
  border: 1px solid var(--efcv-line); border-radius: 16px;
  display: none; flex-direction: column; overflow: hidden;
  font-family: 'Geist', system-ui, sans-serif;
  box-shadow: 0 18px 50px hsl(0 0% 0% / 0.55);
}
#efcv-chat-panel.efcv-open { display: flex; }

.efcv-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--efcv-line);
  background: linear-gradient(180deg, hsl(220 20% 11%), hsl(220 20% 8%));
}
.efcv-header h3 { margin: 0; font-size: 15px; color: var(--efcv-gold); font-weight: 600; }
.efcv-header small { color: var(--efcv-muted); font-size: 11px; }
.efcv-close {
  background: transparent; border: none; color: var(--efcv-muted);
  font-size: 20px; cursor: pointer; padding: 4px 8px; line-height: 1;
}

.efcv-log {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.efcv-msg {
  max-width: 85%; padding: 9px 12px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
}
.efcv-msg.bot { background: hsl(220 20% 14%); color: var(--efcv-text); align-self: flex-start; border: 1px solid var(--efcv-line); }
.efcv-msg.user { background: var(--efcv-gold); color: hsl(220 30% 10%); align-self: flex-end; font-weight: 500; }
.efcv-msg.sys { background: transparent; color: var(--efcv-muted); font-style: italic; font-size: 12px; align-self: center; text-align: center; }

.efcv-lead {
  padding: 12px 14px; border-top: 1px solid var(--efcv-line);
  background: hsl(220 20% 10%);
}
.efcv-lead h4 { margin: 0 0 8px; font-size: 13px; color: var(--efcv-gold); font-weight: 600; }
.efcv-lead input {
  width: 100%; box-sizing: border-box; padding: 8px 10px; margin-bottom: 6px;
  background: var(--efcv-bg); border: 1px solid var(--efcv-line); border-radius: 8px;
  color: var(--efcv-text); font-size: 13px; font-family: inherit;
}
.efcv-lead input:focus { outline: none; border-color: var(--efcv-gold); }
.efcv-lead button {
  width: 100%; padding: 9px; margin-top: 4px;
  background: var(--efcv-gold); border: none; border-radius: 8px;
  color: hsl(220 30% 10%); font-weight: 600; font-size: 13px; cursor: pointer;
}
.efcv-lead button:disabled { opacity: 0.5; cursor: not-allowed; }
.efcv-lead .efcv-err { color: hsl(0 70% 65%); font-size: 11px; margin-top: 4px; min-height: 14px; }

/* Field wrapper with live validation tick */
.efcv-field { position: relative; margin-bottom: 6px; }
.efcv-field input { margin-bottom: 0 !important; padding-right: 32px !important; }
.efcv-tick {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; line-height: 1;
  background: transparent; color: transparent;
  border: 1.5px solid transparent;
  transition: all 0.18s ease;
  pointer-events: none;
}
.efcv-field.efcv-valid .efcv-tick {
  background: hsl(140 60% 45%);
  color: #fff;
  border-color: hsl(140 60% 35%);
  box-shadow: 0 0 8px hsl(140 60% 45% / 0.5);
}
.efcv-field.efcv-invalid input {
  border-color: hsl(0 60% 55% / 0.6) !important;
}
.efcv-field.efcv-valid input {
  border-color: hsl(140 60% 45% / 0.6) !important;
}

.efcv-lead .efcv-sub {
  margin: -2px 0 10px; color: var(--efcv-muted); font-size: 12px; line-height: 1.45;
}
.efcv-lead textarea {
  width: 100%; box-sizing: border-box; padding: 8px 10px; margin-bottom: 6px;
  background: var(--efcv-bg); border: 1px solid var(--efcv-line); border-radius: 8px;
  color: var(--efcv-text); font-size: 13px; font-family: inherit; resize: vertical; min-height: 56px;
}
.efcv-lead textarea:focus { outline: none; border-color: var(--efcv-gold); }
.efcv-lead .efcv-altcode {
  margin-top: 8px; text-align: center; font-size: 12px;
}
.efcv-lead .efcv-altcode a {
  color: var(--efcv-muted); text-decoration: none; border-bottom: 1px dotted var(--efcv-muted);
}
.efcv-lead .efcv-altcode a:hover { color: var(--efcv-gold); border-bottom-color: var(--efcv-gold); }

.efcv-req { max-height: 60vh; overflow-y: auto; }
.efcv-req h4, .efcv-unlock h4 { margin: 0 0 4px; }

.efcv-unlock input { font-family: 'Geist Mono', 'JetBrains Mono', Consolas, monospace; letter-spacing: 2px; font-size: 16px; text-align: center; }

.efcv-download {
  padding: 18px 16px; border-top: 1px solid var(--efcv-line);
  background: linear-gradient(180deg, hsl(220 20% 11%), hsl(220 20% 8%));
  text-align: center;
}
.efcv-download h4 { margin: 0 0 4px; font-size: 15px; color: var(--efcv-gold); }
.efcv-download .efcv-sub { color: var(--efcv-muted); font-size: 12px; margin: 0 0 12px; }
.efcv-dl-btn {
  display: inline-block; padding: 12px 22px;
  background: linear-gradient(135deg, var(--efcv-gold), hsl(35 80% 45%));
  color: hsl(220 30% 10%); border-radius: 10px; text-decoration: none; font-weight: 700;
  font-size: 14px; letter-spacing: 0.3px;
  box-shadow: 0 4px 14px hsl(45 80% 50% / 0.35);
  transition: transform 0.15s ease, box-shadow 0.25s ease;
}
.efcv-dl-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px hsl(45 80% 50% / 0.55); }

.efcv-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--efcv-line); background: hsl(220 20% 10%);
}
.efcv-input-row input {
  flex: 1; padding: 9px 12px;
  background: var(--efcv-bg); border: 1px solid var(--efcv-line); border-radius: 10px;
  color: var(--efcv-text); font-size: 13.5px; font-family: inherit;
}
.efcv-input-row input:focus { outline: none; border-color: var(--efcv-gold); }
.efcv-input-row button {
  padding: 9px 14px; background: var(--efcv-gold); border: none; border-radius: 10px;
  color: hsl(220 30% 10%); font-weight: 600; cursor: pointer; font-size: 13px;
}
.efcv-input-row button:disabled { opacity: 0.4; cursor: not-allowed; }

.efcv-counter { font-size: 11px; color: var(--efcv-muted); text-align: center; padding: 4px 0 8px; }

@media (max-width: 480px) {
  #efcv-chat-panel { right: 8px; left: 8px; width: auto; bottom: 8px; height: 70vh; }
  #efcv-chat-launcher { bottom: 16px; right: 16px; }
  #efcv-chat-bubble { display: none; }
}
