/**
 * Anti-bot TelVirtuel - styles du captcha proof-of-work (composant Blade
 * <x-antibot-captcha />, logique dans assets/antibot/antibot-captcha.js).
 *
 * Deux variantes explicites :
 *   .tv-antibot--dark  -> theme Nebula / vitrine (fond violet fonce, defaut)
 *   .tv-antibot--light -> fond reellement clair
 *
 * Les couleurs reprennent les tokens Nebula (violet-100/200/300, zinc-400,
 * gradient `btn-primary`, ombre `shadow-inner-blur`).
 */

.tv-antibot {
    --tv-antibot-surface: rgba(9, 9, 11, 0.01);
    --tv-antibot-border: rgba(221, 214, 254, 0.06);
    --tv-antibot-text: #ede9fe;
    --tv-antibot-muted: rgba(161, 161, 170, 0.8);
    --tv-antibot-accent: #8b5cf6;
    --tv-antibot-success: #c4b5fd;
    --tv-antibot-danger: #f87171;
    --tv-antibot-inner-blur: inset -0.5px 0.5px 1px 0 rgba(203, 213, 225, 0.12),
        inset 0 0 96px 0 rgba(221, 214, 254, 0.08);

    display: block;
    margin: 0;
}

.tv-antibot--light {
    --tv-antibot-surface: #ffffff;
    --tv-antibot-border: #e4e4e7;
    --tv-antibot-text: #27272a;
    --tv-antibot-muted: #71717a;
    --tv-antibot-success: #7c3aed;
    --tv-antibot-inner-blur: none;
}

/* --- Boite principale --------------------------------------------------- */

.tv-antibot__box {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 340px;
    padding: 12px 14px;
    background-color: var(--tv-antibot-surface);
    border: 1px solid var(--tv-antibot-border);
    border-radius: 0.375rem;
    box-shadow: var(--tv-antibot-inner-blur);
    cursor: default;
    transition: border-color 0.2s ease-in-out;
}

.tv-antibot[data-state='solving'] .tv-antibot__box {
    border-color: rgba(139, 92, 246, 0.45);
}

.tv-antibot[data-state='done'] .tv-antibot__box {
    border-color: rgba(196, 181, 253, 0.35);
}

.tv-antibot[data-state='error'] .tv-antibot__box {
    border-color: rgba(248, 113, 113, 0.5);
}

/* --- Indicateur (case a cocher / spinner / coche) ----------------------- */

.tv-antibot__indicator {
    position: relative;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border: 1px solid var(--tv-antibot-border);
    border-radius: 6px;
    background-color: transparent;
    transition: background 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.tv-antibot[data-state='done'] .tv-antibot__indicator {
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(243, 238, 255, 0.4)),
        linear-gradient(to bottom, rgba(139, 92, 246, 1), rgba(81, 54, 144, 1));
    border-color: transparent;
}

.tv-antibot__check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f5f3ff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.tv-antibot[data-state='done'] .tv-antibot__check {
    opacity: 1;
    transform: scale(1);
}

.tv-antibot__spinner {
    position: absolute;
    inset: 3px;
    display: none;
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-top-color: var(--tv-antibot-accent);
    border-radius: 50%;
    animation: tvAntibotSpin 0.7s linear infinite;
}

.tv-antibot[data-state='solving'] .tv-antibot__spinner {
    display: block;
}

@keyframes tvAntibotSpin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Textes -------------------------------------------------------------- */

.tv-antibot__texts {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.tv-antibot__label {
    color: var(--tv-antibot-text);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
}

.tv-antibot__status {
    color: var(--tv-antibot-muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.tv-antibot[data-state='done'] .tv-antibot__status {
    color: var(--tv-antibot-success);
}

.tv-antibot[data-state='error'] .tv-antibot__status {
    color: var(--tv-antibot-danger);
}

/* --- Marque -------------------------------------------------------------- */

.tv-antibot__brand {
    flex: 0 0 auto;
    text-align: right;
    line-height: 1.15;
}

.tv-antibot__brand strong {
    display: block;
    color: var(--tv-antibot-text);
    font-size: 0.72rem;
    font-weight: 700;
}

.tv-antibot__brand small {
    display: block;
    color: var(--tv-antibot-muted);
    font-size: 0.62rem;
}

/* --- Honeypot : invisible pour l'humain, visible pour les robots ---------- */

.tv-antibot__honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* --- Message d'erreur serveur -------------------------------------------- */

.tv-antibot__error {
    margin-top: 0.5rem;
    color: var(--tv-antibot-danger);
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Message sans JavaScript --------------------------------------------- */

.tv-antibot__nojs {
    margin-top: 0.5rem;
    color: var(--tv-antibot-danger);
    font-size: 0.8rem;
}
