/* Laravel Captcha Styles */

.captcha-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Image Captcha Styles */
.captcha-image-wrapper {
    max-width: 400px;
}

.captcha-image-container {
    position: relative;
    display: inline-block;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.captcha-image {
    display: block;
    max-width: 100%;
    height: auto;
}

.captcha-refresh {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.captcha-refresh:hover {
    background: #fff;
    transform: rotate(180deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.captcha-refresh svg {
    color: #333;
}

/* Input Styles */
.captcha-input-group {
    margin-top: 15px;
}

.captcha-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.captcha-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.captcha-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Math & Text Captcha Styles */
.captcha-math-wrapper,
.captcha-text-wrapper {
    max-width: 400px;
}

.captcha-question-container {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 50px 25px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.captcha-question {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
}

/* Slider Captcha Styles */
.captcha-slider-wrapper {
    max-width: 400px;
}

.captcha-slider-container {
    position: relative;
}

.captcha-precheck {
    width: 300px;
    max-width: 100%;
    min-height: 66px;
    border: 1px solid rgba(67, 89, 113, 0.28);
    border-radius: 6px;
    background: #fff;
    color: #566a7f;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 0.125rem 0.375rem rgba(67, 89, 113, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.captcha-precheck:hover {
    border-color: rgba(105, 108, 255, 0.55);
    box-shadow: 0 0.25rem 0.75rem rgba(67, 89, 113, 0.12);
}

.captcha-precheck-indicator {
    width: 26px;
    height: 26px;
    border: 2px solid rgba(67, 89, 113, 0.32);
    border-radius: 4px;
    background: #fff;
    opacity: 1;
    transition: border-color 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
}

.captcha-precheck-text {
    color: #566a7f;
    font-size: 0.92rem;
    font-weight: 600;
}

.captcha-precheck-brand {
    color: #697a8d;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 44px;
    max-width: 58px;
    text-align: center;
    line-height: 1.1;
}

.captcha-precheck-brand img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.captcha-precheck-brand span {
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.captcha-precheck.is-checking .captcha-precheck-indicator {
    border: 3px solid rgba(105, 108, 255, 0.18);
    border-top-color: #696cff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.captcha-precheck.is-passed {
    border-color: rgba(113, 221, 55, 0.5);
    background: rgba(113, 221, 55, 0.08);
}

.captcha-precheck.is-passed .captcha-precheck-indicator {
    opacity: 1;
    border-color: #71dd37;
    background: #71dd37;
    position: relative;
}

.captcha-precheck.is-passed .captcha-precheck-indicator::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 8px;
    height: 14px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.captcha-precheck.is-passed .captcha-precheck-text {
    color: #2f9f1d;
}

.captcha-precheck.is-complete {
    cursor: default;
    pointer-events: none;
}

.captcha-slider-background {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.captcha-slider-puzzle {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.captcha-slider-hole {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.captcha-slider-track {
    position: relative;
    margin-top: 15px;
    height: 44px;
    background: #f5f5f9;
    border: 1px solid rgba(67, 89, 113, 0.16);
    border-radius: 999px;
    overflow: hidden;
    user-select: none;
    box-shadow: inset 0 1px 2px rgba(67, 89, 113, 0.06);
}

.captcha-slider-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: rgba(105, 108, 255, 0.14);
    transition: background 0.2s ease;
    z-index: 1;
}

.captcha-slider-progress.is-success {
    background: rgba(113, 221, 55, 0.2);
}

.captcha-slider-progress.is-error {
    background: rgba(255, 62, 29, 0.16);
}

.captcha-slider-handle {
    position: absolute;
    left: 0;
    top: 3px;
    width: 38px;
    height: 38px;
    background: #696cff;
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 0.25rem 0.75rem rgba(105, 108, 255, 0.35);
    transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
    z-index: 3;
}

.captcha-slider-handle:active {
    cursor: grabbing;
    transform: scale(0.96);
    box-shadow: 0 0.35rem 1rem rgba(105, 108, 255, 0.42);
}

.captcha-slider-handle.is-success {
    background: #71dd37;
    box-shadow: 0 0.25rem 0.75rem rgba(113, 221, 55, 0.35);
}

.captcha-slider-handle.is-error {
    background: #ff3e1d;
    box-shadow: 0 0.25rem 0.75rem rgba(255, 62, 29, 0.35);
}

.captcha-slider-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #697a8d;
    font-size: 0.86rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 2;
}

.captcha-slider-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.captcha-slider-action {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(67, 89, 113, 0.24);
    border-radius: 50%;
    background: #fff;
    color: #697a8d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0.125rem 0.25rem rgba(67, 89, 113, 0.08);
    transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.captcha-slider-action:hover {
    color: #696cff;
    border-color: rgba(105, 108, 255, 0.45);
    box-shadow: 0 0.25rem 0.5rem rgba(67, 89, 113, 0.12);
    transform: translateY(-1px);
}

.captcha-info-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.captcha-info-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(105, 108, 255, 0.12);
    color: #696cff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 800;
}

.captcha-info-modal {
    z-index: 1065;
}

.modal-backdrop.show {
    z-index: 1055;
}

/* Style Variations */

/* Modern Style */
.captcha-style-modern .captcha-image-container,
.captcha-style-modern .captcha-question-container {
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.captcha-style-modern .captcha-input {
    border-radius: 10px;
    border-width: 1px;
}

.captcha-style-modern .captcha-question-container {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.captcha-style-modern .captcha-slider-background,
.captcha-style-modern .captcha-slider-track {
    border-radius: 12px;
}

.captcha-style-modern .captcha-slider-handle {
    background: #696cff;
}

/* Minimal Style */
.captcha-style-minimal .captcha-image-container,
.captcha-style-minimal .captcha-question-container {
    border-radius: 4px;
    box-shadow: none;
    border: 1px solid #ddd;
}

.captcha-style-minimal .captcha-input {
    border-radius: 4px;
}

.captcha-style-minimal .captcha-question-container {
    background: #f8f9fa;
}

.captcha-style-minimal .captcha-question {
    color: #333;
}

.captcha-style-minimal .captcha-slider-background {
    box-shadow: none;
    border: 1px solid #ddd;
}

.captcha-style-minimal .captcha-slider-track {
    background: #f8f9fa;
    border: 1px solid #ddd;
}

.captcha-style-minimal .captcha-slider-handle {
    background: #566a7f;
}

/* Colorful Style */
.captcha-style-colorful .captcha-question-container {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.captcha-style-colorful .captcha-input:focus {
    border-color: #fa709a;
    box-shadow: 0 0 0 3px rgba(250, 112, 154, 0.1);
}

.captcha-style-colorful .captcha-slider-handle {
    background: #ffab00;
    box-shadow: 0 0.25rem 0.75rem rgba(255, 171, 0, 0.35);
}

/* Success/Error States */
.captcha-input.success {
    border-color: #4CAF50;
    background-color: #f1f8f4;
}

.captcha-input.error {
    border-color: #f44336;
    background-color: #fef1f0;
}

/* Loading State */
.captcha-loading {
    opacity: 0.6;
    pointer-events: none;
}

.captcha-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .captcha-question {
        font-size: 18px;
    }
    
    .captcha-slider-background {
        width: 100% !important;
    }
}

Captcha Styles
.captcha-container {
    margin-bottom: 1rem;
}

.captcha-image, #captcha-svg svg {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: block;
    max-width: 100%;
    height: auto;
    background: white;
}

#captcha-svg {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.captcha-input-group {
    display: flex;
    gap: 0.5rem;
}

.captcha-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.captcha-refresh-btn {
    padding: 0.5rem 1rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.captcha-refresh-btn:hover {
    background-color: #5a6268;
}

.captcha-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
    .captcha-image {
        border-color: #495057;
    }
    
    .captcha-input {
        background-color: #343a40;
        border-color: #495057;
        color: #fff;
    }
    
    .captcha-input:focus {
        border-color: #80bdff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }
}

/* RTL Support */
[dir="rtl"] .captcha-input-group {
    direction: rtl;
}

[dir="rtl"] .captcha-refresh-btn {
    margin-left: 0;
    margin-right: 0.5rem;
}
