/* assets/css/captcha.css — cadre « Je ne suis pas un robot » (2026-11-19)
 * Tout le cadre est cliquable (assets/js/captcha-frame.js) ; case dessinée à la main.
 * Chargé APRÈS forms.css / forgot_password.css sur login, register, forgot_password, contact. */

.simple-captcha {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid #263244;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.simple-captcha:hover {
    border-color: rgba(255, 204, 0, 0.45);
    background-color: rgba(255, 204, 0, 0.03);
}
.simple-captcha.is-checked,
.simple-captcha:has(input[type="checkbox"]:checked) {
    border-color: rgba(255, 204, 0, 0.75);
    background-color: rgba(255, 204, 0, 0.06);
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.10), 0 8px 20px rgba(0,0,0,0.12);
}
.simple-captcha:has(input[type="checkbox"]:focus-visible) {
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.35), 0 8px 20px rgba(0,0,0,0.12);
}

.simple-captcha h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffcc00;
}

.simple-captcha .captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e2e8f0;
    font-weight: 600;
}

/* La case */
.simple-captcha .captcha-row input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    position: relative;
    width: 26px;
    height: 26px;
    margin: 0;
    border: 2px solid #4b5a70;
    border-radius: 7px;
    background: #0b1220;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.45);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.simple-captcha:hover .captcha-row input[type="checkbox"]:not(:checked) {
    border-color: #ffcc00;
}
/* Coche : tracé SVG révélé au cochage */
.simple-captcha .captcha-row input[type="checkbox"]::after {
    content: "";
    position: absolute;
    inset: 0;
    background: center / 16px 16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4l3 3 6.6-6.8' fill='none' stroke='%23111827' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    opacity: 0;
    transform: scale(.4);
    transition: opacity .15s ease, transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.simple-captcha .captcha-row input[type="checkbox"]:checked {
    border-color: #ffcc00;
    background: #ffcc00;
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.18);
}
.simple-captcha .captcha-row input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: scale(1);
}
.simple-captcha .captcha-row input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.45);
}
.simple-captcha:active .captcha-row input[type="checkbox"] {
    transform: scale(.92);
}

.simple-captcha .captcha-hint {
    margin-top: 8px;
    padding-left: 38px; /* aligné sur le texte, sous la case */
    font-size: 12px;
    color: #94a3b8;
}

/* Message stylé dans le cadre (remplace les alert() natifs — PNCaptcha.notify) */
.simple-captcha .captcha-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 9px;
    background: rgba(248, 113, 113, 0.10);
    color: #fecaca;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: default;
    animation: pn-captcha-msg-in .2s ease;
}
.simple-captcha .captcha-msg[hidden] { display: none; }
.simple-captcha .captcha-msg::before {
    content: "!";
    flex: 0 0 18px;
    height: 18px;
    border-radius: 50%;
    background: #f87171;
    color: #1f100f;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
@keyframes pn-captcha-msg-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* Petite secousse si on envoie sans cocher (classe posée par captcha-frame.js) */
.simple-captcha.is-missing {
    border-color: #f87171;
    animation: pn-captcha-shake .38s ease;
}
@keyframes pn-captcha-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}
@media (prefers-reduced-motion: reduce) {
    .simple-captcha,
    .simple-captcha .captcha-row input[type="checkbox"],
    .simple-captcha .captcha-row input[type="checkbox"]::after { transition: none; }
    .simple-captcha.is-missing,
    .simple-captcha .captcha-msg { animation: none; }
}
