* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1d1d1d;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.captcha-container {
    width: 100%;
    max-width: 500px;
}

.captcha-content h1 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 12px;
    color: #ffffff;
    text-align: left;
}

#captchaTitle {
    font-size: 16px;
    color: #a0a0a0;
    margin-bottom: 30px;
    text-align: left;
}

.captcha-box {
    background: #2b2b2b;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.checkbox-state {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 24px;
    width: 24px;
    background-color: transparent;
    border: 2px solid #666;
    border-radius: 3px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-container:hover .checkmark {
    border-color: #999;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #f6821f;
    border-color: #f6821f;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-text {
    color: #e0e0e0;
    font-size: 14px;
}

.cloudflare-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cloudflare-logo svg {
    height: 32px;
    width: auto;
}

.cf-powered {
    font-size: 10px;
    color: #808080;
    text-align: center;
}

.loading-state {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #404040;
    border-top-color: #f6821f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loadingText {
    color: #e0e0e0;
    font-size: 14px;
    flex: 1;
}

.math-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.math-challenge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #404040;
}

#captchaCanvas {
    background: #1d1d1d;
    border-radius: 4px;
    border: 1px solid #404040;
}

.cloudflare-logo-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cloudflare-logo-small svg {
    height: 28px;
    width: auto;
}

.cf-text-small {
    font-size: 9px;
    color: #808080;
    text-align: center;
}

.math-input {
    display: flex;
    gap: 10px;
}

#captchaAnswer {
    flex: 1;
    background: #1d1d1d;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#captchaAnswer:focus {
    border-color: #f6821f;
}

#captchaAnswer::placeholder {
    color: #606060;
}

.refresh-btn {
    background: #1d1d1d;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #ffffff;
    width: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #333;
    border-color: #666;
}

.validate-btn {
    background: #f6821f;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.validate-btn:hover {
    background: #e57520;
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 0;
    text-align: center;
}

.error-message.hidden {
    display: none;
}

#securityMessage {
    font-size: 14px;
    color: #a0a0a0;
    margin-bottom: 30px;
    text-align: left;
}

.footer-info {
    border-top: 1px solid #404040;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ray-id {
    font-size: 12px;
    color: #808080;
}

#rayId {
    color: #a0a0a0;
}

.cloudflare-links {
    font-size: 12px;
    color: #808080;
}

.link-text {
    color: #808080;
}

.hidden {
    display: none !important;
}

body.rtl {
    direction: rtl;
}

body.rtl .checkbox-container {
    flex-direction: row-reverse;
}

body.rtl .checkmark {
    margin-right: 0;
    margin-left: 12px;
}

body.rtl .cloudflare-logo,
body.rtl .cloudflare-logo-small {
    align-items: flex-start;
}

@media (max-width: 600px) {
    .captcha-content h1 {
        font-size: 20px;
    }

    #captchaTitle {
        font-size: 14px;
    }

    .captcha-box {
        padding: 15px;
    }

    .checkbox-state {
        flex-wrap: wrap;
        gap: 12px;
    }

    .checkbox-container {
        flex: 1;
        min-width: 200px;
    }

    .checkbox-text {
        font-size: 13px;
    }

    .cloudflare-logo {
        align-items: center;
    }

    .cloudflare-logo svg {
        height: 28px;
    }

    .cf-powered {
        font-size: 9px;
    }

    .loading-state {
        flex-wrap: wrap;
        gap: 12px;
    }

    #loadingText {
        flex: 1;
        min-width: 150px;
    }

    #captchaCanvas {
        width: 160px;
        height: 50px;
    }

    .footer-info {
        flex-direction: column;
        align-items: flex-start;
    }
}
