/* ========================================
   FLOATING CONTACT
   ======================================== */

/* ── Floating Contact ─────────────────────────────────── */

.fc-wrap {
    position: fixed;
    bottom: 50px;
    right: 20px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Bouton principal */
.fc-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color, #6366f1);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    flex-shrink: 0;
    z-index: 1;
}

.fc-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}

/* Anneau pulsant quand inactif */
.fc-btn-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--primary-color, #6366f1);
    opacity: 0.4;
    animation: fc-pulse 2.4s ease-out infinite;
}

.fc-wrap.active .fc-btn-ring {
    animation: none;
    opacity: 0;
}

@keyframes fc-pulse {
    0%   { transform: scale(1);   opacity: 0.45; }
    70%  { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

/* Panneau */
.fc-panel {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.97);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.fc-wrap.active .fc-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* En-tête */
.fc-header {
    background: var(--primary-color, #6366f1);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.fc-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.fc-header-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.fc-header-sub {
    font-size: 0.75rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.fc-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(74,222,128,0.3);
}

.fc-close-btn {
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.fc-close-btn:hover {
    background: rgba(255,255,255,0.28);
}

/* Corps */
.fc-body {
    padding: 15px;
}

/* Champ */
.fc-field {
    margin-bottom: 12px;
}

.fc-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
}

.fc-input-wrap {
    position: relative;
}

.fc-input-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
    pointer-events: none;
}

.fc-textarea-icon {
    top: 12px;
    transform: none;
}

.fc-input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    line-height: 1.4;
}

.fc-input:focus {
    border-color: var(--primary-color, #6366f1);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99,102,241), 0.12);
}

.fc-textarea {
    resize: none;
    padding-top: 10px;
}

/* Message erreur */
.fc-error-msg {
    font-size: 0.8rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

/* Indicateur champ obligatoire */
.fc-required {
    color: #dc2626;
    font-size: 0.8rem;
    margin-left: 2px;
    line-height: 1;
}

/* Champ invalide */
.fc-input--error {
    border-color: #dc2626 !important;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.fc-field-error {
    display: block;
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 4px;
}

/* Bouton submit */
.fc-submit {
    width: 100%;
    padding: 11px 16px;
    background: var(--primary-color, #6366f1);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(var(--primary-rgb, 99,102,241), 0.3);
    margin-top: 4px;
}

.fc-submit:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb, 99,102,241), 0.38);
}

.fc-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner dans le bouton */
.fc-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: fc-spin 0.7s linear infinite;
}

@keyframes fc-spin {
    to { transform: rotate(360deg); }
}

/* État succès */
.fc-success {
    text-align: center;
    padding: 24px 8px 12px;
}

.fc-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color, #6366f1);
    color: #fff;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    animation: fc-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes fc-pop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.fc-success-title {
    font-weight: 700;
    font-size: 1rem;
    color: #111827;
    margin-bottom: 6px;
}

.fc-success-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .fc-wrap {
        right: 20px;
        bottom: 40px;
    }

    .fc-panel {
        width: calc(100vw - 24px);
        right: -6px;
    }
}
