/* =============================================================================
   TalentVelo - Assistant (chat window)
   -----------------------------------------------------------------------------
   Styles of the floating chat button, the chat window, the full-page chat and the
   "Ready to sign in?" card that visitors see on the sign-in pages.
   Built by /js/talentvelo-assistant.js. Uses the theme variables of talentvelo.css
   (with fallbacks), so dark and light theme both work.
   ============================================================================= */
.tv-as-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 950;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 18px; font: inherit; font-size: 14px; font-weight: 800; color: #fff;
    background: var(--tv-gradient, linear-gradient(135deg, #2563EB, #06B6D4));
    border: 0; border-radius: 999px; cursor: pointer;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tv-as-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(37, 99, 235, 0.55); }
.tv-as-fab:focus-visible { outline: 3px solid #FDE68A; outline-offset: 3px; }
.tv-as-fab-icon { font-size: 18px; line-height: 1; }

.tv-as-panel {
    position: fixed; right: 20px; bottom: 82px; z-index: 960;
    display: none; flex-direction: column;
    width: 390px; max-width: calc(100vw - 24px); height: min(580px, calc(100vh - 110px));
    color: var(--tv-text, #F1F5F9); background: var(--tv-surface, #101829);
    border: 1px solid var(--tv-border, #1F2C45); border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); overflow: hidden;
}
.tv-as-panel.open { display: flex; }

.tv-as-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 14px; color: #fff;
    background: var(--tv-gradient, linear-gradient(135deg, #2563EB, #06B6D4));
}
.tv-as-head strong { display: block; font-size: 15px; font-weight: 800; }
.tv-as-head small { display: block; font-size: 11.5px; opacity: 0.9; }
.tv-as-head-btns { display: flex; gap: 6px; }
.tv-as-icon {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    font: inherit; font-size: 16px; line-height: 1; color: #fff; cursor: pointer;
    background: rgba(255, 255, 255, 0.18); border: 0; border-radius: 8px;
}
.tv-as-icon:hover { background: rgba(255, 255, 255, 0.3); }
.tv-as-icon:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.tv-as-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.tv-as-msg { max-width: 92%; padding: 10px 13px; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; border-radius: 14px; }
.tv-as-msg.bot { align-self: flex-start; background: var(--tv-surface-2, #0B1322); border: 1px solid var(--tv-border, #1F2C45); border-bottom-left-radius: 4px; }
.tv-as-msg.user { align-self: flex-end; color: #fff; background: var(--tv-primary-strong, #2563EB); border-bottom-right-radius: 4px; }
.tv-as-msg strong { font-weight: 800; }
.tv-as-badge { display: inline-block; margin-bottom: 6px; padding: 1px 8px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.4px; color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.55); border-radius: 999px; }
.tv-as-note { margin-top: 6px; font-size: 11px; color: var(--tv-muted, #94A3B8); }

.tv-as-links, .tv-as-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tv-as-link {
    display: inline-block; padding: 5px 11px; font-size: 12.5px; font-weight: 700; text-decoration: none;
    color: var(--tv-accent-text, #60A5FA); background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.4); border-radius: 999px;
}
.tv-as-link:hover { background: rgba(59, 130, 246, 0.24); }
.tv-as-chip {
    padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer;
    color: var(--tv-text, #F1F5F9); background: transparent;
    border: 1px dashed var(--tv-border, #1F2C45); border-radius: 999px;
}
.tv-as-chip:hover { border-color: var(--tv-primary, #3B82F6); color: var(--tv-accent-text, #60A5FA); }

/* The "Ready to sign in?" card (visitors on the sign-in pages). Light card in both themes, like a system message. */
.tv-as-msg.tv-as-card {
    align-self: stretch; max-width: 100%; padding: 16px 16px 18px;
    color: #111827; background: linear-gradient(135deg, #F7F5FF 0%, #ECEEFF 100%);
    border: 1px solid rgba(99, 102, 241, 0.28); border-radius: 14px;
}
.tv-as-card-meta { margin-bottom: 14px; font-size: 12.5px; color: #6B7280; }
.tv-as-card-title { margin-bottom: 14px; font-size: 17px; font-weight: 500; line-height: 1.35; color: #111827; }
.tv-as-card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tv-as-card-btn {
    padding: 11px 20px; font: inherit; font-size: 15.5px; line-height: 1.2; cursor: pointer;
    border-radius: 12px; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tv-as-card-btn.primary { color: #FFFFFF; background: #111111; border: 1px solid #111111; }
.tv-as-card-btn.secondary { color: #111111; background: #FFFFFF; border: 1px solid #6B7280; }
.tv-as-card-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(17, 24, 39, 0.22); }
.tv-as-card-btn:focus-visible { outline: 3px solid #6366F1; outline-offset: 2px; }
.tv-as-card-btn:disabled { cursor: default; opacity: 0.5; }
.tv-as-card.done { opacity: 0.78; }

/* the e-mail field flashes once after "Sign in" */
.tv-as-flash { animation: tv-as-flash 1.8s ease-out 1; }
@keyframes tv-as-flash { 0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.9); } 40% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.45); } 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); } }

.tv-as-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--tv-surface-2, #0B1322); border: 1px solid var(--tv-border, #1F2C45); border-radius: 14px; border-bottom-left-radius: 4px; }
.tv-as-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--tv-muted, #94A3B8); animation: tv-as-dot 1.1s infinite ease-in-out; }
.tv-as-typing i:nth-child(2) { animation-delay: 0.15s; }
.tv-as-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tv-as-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.tv-as-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--tv-border, #1F2C45); background: var(--tv-surface, #101829); }
.tv-as-input {
    flex: 1; min-height: 40px; max-height: 110px; padding: 9px 12px; resize: none;
    font: inherit; font-size: 14px; line-height: 1.4; color: var(--tv-text, #F1F5F9);
    background: var(--tv-input-bg, #0B1322); border: 1px solid var(--tv-border, #1F2C45); border-radius: 12px; outline: none;
}
.tv-as-input:focus { border-color: var(--tv-primary, #3B82F6); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.tv-as-send {
    height: 40px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 800; color: #fff; cursor: pointer;
    background: var(--tv-gradient, linear-gradient(135deg, #2563EB, #06B6D4)); border: 0; border-radius: 12px;
}
.tv-as-send:disabled { opacity: 0.55; cursor: not-allowed; }
.tv-as-foot { padding: 0 14px 10px; font-size: 11px; color: var(--tv-muted, #94A3B8); }

/* full-page chat: the same window, but inside the page */
.tv-as-page .tv-as-panel { position: static; display: flex; width: 100%; max-width: none; height: min(640px, calc(100vh - 260px)); min-height: 420px; box-shadow: none; }
.tv-as-page .tv-as-msg { font-size: 14px; }

@media (max-width: 560px) {
    .tv-as-fab { right: 12px; bottom: 12px; padding: 13px; }
    .tv-as-fab-text { display: none; }
    .tv-as-panel { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; height: min(78vh, 600px); }
    body.tv-as-open .tv-as-fab { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .tv-as-fab, .tv-as-body, .tv-as-card-btn { transition: none; scroll-behavior: auto; }
    .tv-as-typing i { animation: none; opacity: 0.7; }
    .tv-as-flash { animation: none; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.6); }
}
