/**
 * NGCaptcha Stylesheet
 * Minimal, trusted CAPTCHA widget styling
 * Version: 2.1.0
 */

:root {
    --ngc-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ngc-bg-widget: #ffffff;
    --ngc-border-widget: #e2e8f0;
    --ngc-border-hover: #cbd5e1;
    --ngc-box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    
    --ngc-primary-blue: #2563eb;
    --ngc-primary-hover: #1d4ed8;
    --ngc-primary-light: #eff6ff;
    
    --ngc-text-primary: #0f172a;
    --ngc-text-secondary: #475569;
    --ngc-text-muted: #64748b;
    --ngc-text-light: #94a3b8;
    
    --ngc-success: #16a34a;
}

/* Base Widget Container */
.ngc-container {
    position: relative;
    display: inline-block;
    font-family: var(--ngc-font-family);
    user-select: none;
    -webkit-user-select: none;
}

/* Checkbox Main Box */
.ngc-widget-box {
    width: 304px;
    height: 74px;
    background-color: var(--ngc-bg-widget);
    border: 1px solid var(--ngc-border-widget);
    border-radius: 8px;
    box-shadow: var(--ngc-box-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    box-sizing: border-box;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ngc-widget-box:hover {
    border-color: var(--ngc-border-hover);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* Left Section: Checkbox & Label */
.ngc-left-section {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.ngc-checkbox-slot {
    width: 28px;
    height: 28px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ngc-checkbox {
    width: 26px;
    height: 26px;
    background-color: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
}

.ngc-left-section:hover .ngc-checkbox:not(:disabled) {
    border-color: var(--ngc-primary-blue);
    background-color: var(--ngc-primary-light);
}

.ngc-checkbox:focus-visible {
    border-color: var(--ngc-primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Icons within Checkbox */
.ngc-spinner-icon {
    display: none;
    width: 22px;
    height: 22px;
    animation: ngc-spin 0.8s linear infinite;
}

.ngc-checkmark-icon {
    display: none;
    width: 24px;
    height: 24px;
    animation: ngc-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes ngc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ngc-pop {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Status States */
.ngc-state-loading .ngc-checkbox {
    display: none;
}
.ngc-state-loading .ngc-spinner-icon {
    display: block;
}

.ngc-state-verified .ngc-checkbox {
    display: none;
}
.ngc-state-verified .ngc-checkmark-icon {
    display: block;
}

.ngc-state-error .ngc-checkbox {
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* Label text */
.ngc-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ngc-text-primary);
    cursor: pointer;
    line-height: 1.3;
}

/* Right Section: Branding */
.ngc-right-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 65px;
    text-align: center;
    padding-left: 8px;
}

.ngc-brand-logo {
    width: 28px;
    height: 28px;
    display: block;
    margin-bottom: 2px;
}

.ngc-brand-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--ngc-text-secondary);
    letter-spacing: 0.5px;
    margin: 0;
    text-transform: uppercase;
}

.ngc-legal-links {
    font-size: 8px;
    color: var(--ngc-text-light);
    margin-top: 1px;
}

.ngc-legal-links a {
    color: var(--ngc-text-light);
    text-decoration: none;
}

.ngc-legal-links a:hover {
    color: var(--ngc-text-secondary);
    text-decoration: underline;
}

/* Verification Window / Card Popover */
.ngc-verify-window {
    display: none;
    position: absolute;
    top: -6px;
    left: 318px;
    width: 320px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
    z-index: 9999;
    box-sizing: border-box;
    animation: ngc-fade-slide 0.18s ease-out forwards;
}

@keyframes ngc-fade-slide {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Arrow */
.ngc-verify-arrow {
    position: absolute;
    top: 32px;
    left: -10px;
    width: 10px;
    height: 20px;
    pointer-events: none;
}

.ngc-card-inner {
    padding: 18px 20px;
}

.ngc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.ngc-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ngc-text-primary);
    margin: 0;
}

.ngc-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--ngc-text-light);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.ngc-close-btn:hover {
    color: var(--ngc-text-primary);
}

.ngc-card-subtitle {
    font-size: 12px;
    color: var(--ngc-text-muted);
    margin: 0 0 14px 0;
    line-height: 1.4;
}

/* Download Action Button */
.ngc-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--ngc-primary-blue);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.15s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.ngc-download-btn:hover {
    background-color: var(--ngc-primary-hover);
    color: #ffffff;
}

.ngc-download-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Status row */
.ngc-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 11px;
    color: var(--ngc-text-muted);
}

.ngc-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.ngc-status-dot.active {
    background: var(--ngc-primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    animation: ngc-pulse 1.8s infinite;
}

.ngc-status-dot.verified {
    background: var(--ngc-success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

@keyframes ngc-pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Mobile responsive */
@media (max-width: 680px) {
    .ngc-verify-window {
        left: 0;
        top: 84px;
        width: 304px;
    }
    .ngc-verify-arrow {
        top: -10px;
        left: 30px;
        transform: rotate(90deg);
    }
}
