/**
 * TurnstileSwitch Frontend Styles
 */

.ts-wrapper {
    position: relative;
    min-height: 100px;
}

/* Panel visibility */
.ts-panel {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.6s ease, max-height 0.6s ease;
}

.ts-panel--active {
    opacity: 1;
    visibility: visible;
    max-height: none;
    overflow: visible;
}

/* Turnstile area */
.ts-turnstile-area {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

/* Error message */
.ts-error {
    text-align: center;
    color: #d63638;
    font-size: 14px;
    padding: 16px;
    background: #fcf0f1;
    border-radius: 4px;
    border: 1px solid #d63638;
}

/* Admin notice in frontend */
.ts-notice {
    padding: 16px 20px;
    background: #fcf9e8;
    border-left: 4px solid #dba617;
    border-radius: 2px;
    margin: 20px 0;
}

.ts-notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.ts-notice a {
    color: #2271b1;
    text-decoration: underline;
}

/* ===========================
   Test Mode Widget (Simulated Turnstile)
   =========================== */

.ts-test-widget {
    width: 300px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 14px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    user-select: none;
}

.ts-test-widget__inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ts-test-widget__checkbox-wrap {
    flex-shrink: 0;
}

.ts-test-widget__checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #c3c4c7;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    position: relative;
}

.ts-test-widget__checkbox:hover {
    border-color: #2271b1;
}

.ts-test-widget__checkbox.ts-checked {
    background: #22c55e;
    border-color: #22c55e;
}

.ts-test-widget__checkbox.ts-checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 7px;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ts-test-widget__label {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 400;
}

.ts-test-widget__brand {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ts-test-widget__logo {
    color: #999;
}

.ts-test-widget__brand-text {
    font-size: 11px;
    color: #999;
    font-weight: 500;
}

/* Spinner state */
.ts-test-widget__spinner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f1;
    font-size: 13px;
    color: #666;
}

.ts-test-widget__spinner-ring {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: ts-spin 0.8s linear infinite;
}

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

/* Success state */
.ts-test-widget__success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #f0f0f1;
    font-size: 13px;
    color: #22c55e;
    font-weight: 500;
}

/* Transition animation */
.ts-panel--entering {
    animation: ts-fadeIn 0.6s ease forwards;
}

@keyframes ts-fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
