/* ========================================
   Simple CAPTCHA System - No JavaScript
   ======================================== */

.captcha-container {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    max-width: 420px; /* allow full image width so larger text is visible */
    margin-left: 0; /* keep left-aligned */
    margin-right: 0; /* ensure it doesn't overflow to the right */
    /* allow horizontal scroll if the image still grows beyond container */
    overflow-x: auto;
}

/* Make the CAPTCHA image fit the container and be responsive (enforced) */
.captcha-container {
    box-sizing: border-box; /* ensure padding is included in width */
    display: block;
    /* Add horizontal padding so content doesn't touch the edges */
    padding-left: 14px;
    padding-right: 14px;
}
.captcha-container img {
    display: block !important;
    width: 100% !important;      /* force image to fill container */
    max-width: 100% !important;  /* never exceed container width */
    height: auto !important;
    object-fit: contain;
    margin: 0 0 8px 0;
}

/* Align refresh link and make it unobtrusive */
.captcha-refresh {
    display: block; /* align under instruction */
    margin-top: 4px;
    margin-bottom: 2px;
    text-align: left;
    color: #2d8cff;
}

/* Ensure instruction, refresh and input align with container padding */
.captcha-instruction,
.captcha-refresh,
.captcha-input {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
}

/* Inner wrapper provides tighter alignment and consistent width for inner elements */
.captcha-inner {
    padding-left: 8px;
    padding-right: 8px;
    max-width: 400px; /* match increased container footprint */
}

.captcha-image-wrap { margin: 6px 0; }


.captcha-instruction {
    margin: 0 0 6px 0; /* reduced gap to align with input */
    font-size: 13px;
    color: #333;
    text-align: left; /* aligned left per UX request */
    line-height: 1.2;
}

.captcha-instruction strong {
    color: #43a047;
    font-size: 14px;
}

/* Tighter refresh link spacing and left alignment to match input */
.captcha-refresh {
    display: block; /* make it line up under instruction */
    margin-top: 4px;
    margin-bottom: 2px;
    font-size: 13px; /* increased per request */
    color: #2d8cff;
}

.captcha-lines {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.captcha-line {
    padding: 6px 12px;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #666;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
    transition: all 0.2s ease;
}

/* The correct answer is highlighted in green */
.captcha-correct {
    color: #43a047 !important;
    background: #e8f5e9 !important;
    border: 2px solid #43a047;
    font-size: 16px;
    padding: 5px 11px;
}

.captcha-input {
    display: block;
    width: 100%;
    max-width: 100%; /* ensure it fills the captcha container */
    padding: 8px 10px;
    font-size: 13px; /* increased per request */
    border: 2px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    text-align: left; /* align user input to left */
    font-weight: bold;
    margin: 6px 0 0 0; /* small top gap */
}

/* Keep fully responsive; input matches container width */
@media (max-width: 520px) {
    .captcha-input {
        width: 100%;
    }
}
.captcha-input:focus {
    outline: none;
    border-color: #43a047;
    background: #f0f9f0;
}

.captcha-error {
    color: #d32f2f;
    background: #ffebee;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 13px;
    text-align: center;
    border: 1px solid #ffcdd2;
}

/* Anti-bot measures - make it harder for scrapers */
.captcha-line::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
}

/* Responsive */
@media (max-width: 520px) {
    .captcha-container {
        padding: 10px;
    }
    
    .captcha-line {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .captcha-correct {
        font-size: 16px;
    }
}
