/**
 * Anti-bot Project151 - styles du captcha proof-of-work (composant Blade
 * <x-antibot-captcha />, logique dans public/js/antibot-captcha.js).
 *
 * Deux variantes explicites, JAMAIS de variable de theme Sash (elles resolvent
 * en clair et cassent le rendu sur fond sombre) :
 *   .p151-antibot--dark  -> back-office / layout coreui  (fond #1c1c1c)
 *   .p151-antibot--light -> layout auth / vitrine        (carte blanche)
 */

.p151-antibot {
    --p151-antibot-surface: #262626;
    --p151-antibot-border: #3a3a3a;
    --p151-antibot-text: #e6e6f0;
    --p151-antibot-muted: #9a9a9a;
    --p151-antibot-accent: #a855f7;
    --p151-antibot-accent-2: #f747f2;
    --p151-antibot-success: #22c55e;
    --p151-antibot-danger: #ef4444;

    display: block;
    margin: 0 0 1rem;
}

.p151-antibot--light {
    --p151-antibot-surface: #ffffff;
    --p151-antibot-border: #d9d9e3;
    --p151-antibot-text: #1c1c1c;
    --p151-antibot-muted: #6b6b7b;
}

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

.p151-antibot__box {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 340px;
    padding: 12px 14px;
    background-color: var(--p151-antibot-surface);
    border: 1px solid var(--p151-antibot-border);
    border-radius: 10px;
    cursor: default;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.p151-antibot[data-state="solving"] .p151-antibot__box {
    border-color: var(--p151-antibot-accent);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, .15);
}

.p151-antibot[data-state="done"] .p151-antibot__box {
    border-color: var(--p151-antibot-success);
}

.p151-antibot[data-state="error"] .p151-antibot__box {
    border-color: var(--p151-antibot-danger);
}

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

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

.p151-antibot[data-state="done"] .p151-antibot__indicator {
    background: linear-gradient(135deg, #f747f2 0%, #a855f7 100%);
    border-color: transparent;
}

.p151-antibot__check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .2s ease, transform .2s ease;
}

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

.p151-antibot__spinner {
    position: absolute;
    inset: 3px;
    display: none;
    border: 2px solid rgba(168, 85, 247, .25);
    border-top-color: var(--p151-antibot-accent);
    border-radius: 50%;
    animation: p151AntibotSpin .7s linear infinite;
}

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

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

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

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

.p151-antibot__label {
    color: var(--p151-antibot-text);
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
}

.p151-antibot__status {
    color: var(--p151-antibot-muted);
    font-size: .75rem;
    line-height: 1.3;
}

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

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

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

.p151-antibot__brand {
    flex: 0 0 auto;
    text-align: right;
    line-height: 1.1;
}

.p151-antibot__brand strong {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f747f2 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

.p151-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 -------------------------------------------- */

.p151-antibot__error {
    margin-top: .5rem;
    color: var(--p151-antibot-danger);
    font-size: .8rem;
    font-weight: 600;
}

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

.p151-antibot__nojs {
    margin-top: .5rem;
    color: var(--p151-antibot-danger);
    font-size: .8rem;
}
