/* ==========================================================================
   captcha.css — Shared captcha widget styles.
   Loaded globally. Used by every form that includes <x-captcha-widget />.
   ========================================================================== */

.captcha-inner {
    display: flex;
    gap: 20px;
}

/* ── Image side ─────────────────────────────────────────────────────────── */
.captcha-img-wrap {
    flex-shrink: 0;    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;}

.captcha-img-wrap img[data-captcha-img] {
    display: block;
    width: 150px;
    height: 52px;
    border: 1.5px solid #b0cfe8;
    border-radius: 8px;
    background: #f0f7ff;
    user-select: none;
}

.captcha-refresh-wrap {
    order: -1;
}

.captcha-refresh-link {
    color: rgba(254, 254, 254, 0.5);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.captcha-refresh-link:hover {
    color: #fff;
}

.captcha-refresh-link i {
    font-size: 0.8rem;
    transition: transform 0.35s ease;
}

.captcha-refresh-link:hover i {
    transform: rotate(180deg);
}

/* ── Input side ─────────────────────────────────────────────────────────── */
.captcha-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;

}

.captcha-input-wrap .form-label {
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.captcha-input-wrap input[data-captcha-input] {
    height: 52px;
    letter-spacing: 3px;
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ── Error (shown as red placeholder inside the input) ────────────────── */
.captcha-input-wrap input[data-captcha-input].is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
    text-transform: none;
}

.captcha-input-wrap input[data-captcha-input].is-invalid::placeholder {
    color: #dc3545;
    opacity: 1;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: normal;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .captcha-inner {
        flex-direction: column;
        gap: 10px;
    }

    .captcha-input-wrap input[data-captcha-input] {
        max-width: 100%;
    }
}

/* ── Required label asterisk ─────────────────────────────────────────────── */
.required-star {
    color: #dc3545;
    margin-left: 3px;
    font-weight: 700;
}

/* ── Inline field error tooltip ──────────────────────────────────────────── */
/*
   Appears directly below the invalid input.
   Arrow points UP toward the input, imitating the browser validation bubble.
*/
.field-error-tip {
    display: none;
    position: relative;
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #e6ac00;
    border-radius: 6px;
    font-size: 0.8125rem;
    line-height: 1.4;
    padding: 5px 10px;
    margin-top: 7px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    max-width: 100%;
    word-break: break-word;
}

/* Outer arrow (border colour) */
.field-error-tip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 14px;
    border: 7px solid transparent;
    border-bottom-color: #e6ac00;
}

/* Inner arrow (fill colour) */
.field-error-tip::after {
    content: '';
    position: absolute;
    bottom: calc(100% - 1px);
    left: 15px;
    border: 6px solid transparent;
    border-bottom-color: #fff3cd;
}
