/* ==========================================================================
   SISTEMA DE DESIGN & VARIÁVEIS (TEMA TIKTOK CLEAN)
   ========================================================================== */
:root {
    --bg-primary: #f8fafc; /* Fundo cinza azulado ultra-clean */
    --bg-card: #ffffff;    /* Card branco puro */
    --text-primary: #121212; /* Preto TikTok */
    --text-secondary: #86878b; /* Cinza TikTok */
    
    /* Cores Oficiais do TikTok */
    --tiktok-pink: #FE2C55;
    --tiktok-cyan: #25F4EE;
    --tiktok-black: #121212;
    
    --btn-border: rgba(0, 0, 0, 0.06);
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    
    /* Configuração da Circunferência do Círculo de Progresso (2 * PI * 70px ≈ 439.82) */
    --ring-circumference: 439.82;
}

/* ==========================================================================
   RESET & CONFIGURAÇÕES BÁSICAS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   ILUMINAÇÃO DE FUNDO SUTIL (TikTok Colors)
   ========================================================================== */
.bg-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(160px);
    opacity: 0.08; /* Super sutil no fundo branco */
}

.orb-tiktok-pink {
    top: -5%;
    left: 10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--tiktok-pink) 0%, transparent 70%);
}

.orb-tiktok-cyan {
    bottom: -5%;
    right: 10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--tiktok-cyan) 0%, transparent 70%);
}

/* ==========================================================================
   CARD DE VALIDAÇÃO (Clean & Minimalist)
   ========================================================================== */
.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    z-index: 2;
}

.validation-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 24px;
    padding: 48px 32px 36px;
    text-align: center;
    box-shadow: 
        0 20px 40px -15px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.02);
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeInCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabeçalho do Card */
.card-header {
    margin-bottom: 36px;
}

.security-badge {
    width: 56px;
    height: 56px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    /* Efeito de Glitch 3D sutil do TikTok no ícone */
    color: var(--tiktok-black);
    filter: 
        drop-shadow(-1.5px -1.5px 0px var(--tiktok-cyan)) 
        drop-shadow(1.5px 1.5px 0px var(--tiktok-pink));
}

.icon-verify {
    width: 24px;
    height: 24px;
}

h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--tiktok-black);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    padding: 0 12px;
}

/* ==========================================================================
   ÁREA DE AÇÃO: BOTÃO DE INTERAÇÃO (HOLD)
   ========================================================================== */
.action-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.hold-button-container {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

/* Progresso SVG */
.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring__circle {
    stroke-dasharray: var(--ring-circumference);
    stroke-dashoffset: var(--ring-circumference);
    transition: stroke-dashoffset 0.05s linear;
}

/* Botão Central */
.hold-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--btn-border);
    cursor: pointer;
    outline: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: 
        background 0.3s ease, 
        border-color 0.3s ease,
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.hold-button:hover {
    border-color: #cbd5e1;
    box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.08);
}

/* Estado pressionado (active) */
.hold-button.holding {
    transform: scale(0.95);
    border-color: var(--tiktok-pink);
    /* Efeito de Glitch 3D do TikTok na sombra ao segurar */
    box-shadow: 
        -3px -3px 0px var(--tiktok-cyan), 
        3px 3px 0px var(--tiktok-pink);
}

.button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Ícones dentro do botão */
.icon-touch {
    width: 34px;
    height: 34px;
    color: var(--text-secondary);
    opacity: 0.8;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hold-button.holding .icon-touch {
    color: var(--tiktok-pink);
    transform: scale(1.05);
    filter: drop-shadow(0 2px 5px rgba(254, 44, 85, 0.15));
}

.icon-check {
    position: absolute;
    width: 44px;
    height: 44px;
    opacity: 0;
    transform: scale(0.5) rotate(-20deg);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Porcentagem exibida */
.percentage {
    position: absolute;
    bottom: 22px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.25s ease;
}

.hold-button.holding .percentage {
    opacity: 1;
    transform: translateY(0);
    color: var(--tiktok-pink);
}

/* ==========================================================================
   ESTADOS DE SUCESSO DO TIKTOK
   ========================================================================== */
.hold-button.success {
    background: var(--tiktok-pink) !important;
    border-color: var(--tiktok-pink) !important;
    transform: scale(1.05);
    box-shadow: 
        0 12px 28px -5px rgba(254, 44, 85, 0.3),
        -2px -2px 0px var(--tiktok-cyan);
    cursor: default;
}

.hold-button.success .icon-touch {
    opacity: 0;
    transform: scale(0.6);
}

.hold-button.success .icon-check {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    stroke: #ffffff; /* Checkmark fica branco sobre o botão rosa */
}

.hold-button.success .percentage {
    opacity: 0 !important;
}

/* Texto de instrução */
.instruction-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--tiktok-black);
    transition: all 0.3s ease;
    opacity: 0.95;
    letter-spacing: -0.1px;
}

.instruction-text.holding {
    color: var(--tiktok-pink);
}

.instruction-text.success-text {
    color: var(--tiktok-pink) !important;
    animation: textPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes textPop {
    0% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   RODAPÉ DE SEGURANÇA
   ========================================================================== */
.card-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 24px;
    display: flex;
    justify-content: center;
}

.security-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.icon-lock {
    width: 12px;
    height: 12px;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    
    .validation-card {
        padding: 40px 24px 28px;
        border-radius: 20px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .hold-button-container {
        width: 140px;
        height: 140px;
        margin-bottom: 20px;
    }
    

    
    .hold-button {
        width: 105px;
        height: 105px;
    }
    
    .icon-touch {
        width: 32px;
        height: 32px;
    }
}

/* ==========================================================================
   TEMPLATE reCAPTCHA
   ========================================================================== */
body.rc-mode {
    background: #f0f0f0 !important;
}
/* Esconde o template tradicional até o JS decidir qual exibir (evita flash) */
body:not(.template-ready) .container { opacity: 0; pointer-events: none; }
body.rc-mode .bg-decorations { display: none; }
body.rc-mode .container,
body.rc-image-mode .container { display: none; }
body.rc-image-mode .bg-decorations { display: none; }

#rcPage {
    display: none;
    position: relative;
    z-index: 2;
    animation: fadeInCard 0.4s ease forwards;
}

/* Wrapper que limita a mesma largura do widget para alinhar o texto */
.rc-instruction-wrap {
    width: 400px;
    max-width: 96vw;
    text-align: left;
    margin: 0 auto 10px auto;
}
.rc-instruction-text {
    font-family: Roboto, Arial, sans-serif;
    font-size: 13.5px;
    color: #555;
    margin: 0;
}
body.rc-mode #rcTiktokLogo,
body.rc-image-mode #rcTiktokLogo {
    display: block !important;
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    height: 130px;
    width: auto;
    object-fit: contain;
    z-index: 2;
}

.rc-widget {
    display: inline-flex;
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #d3d3d3;
    border-radius: 3px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.15);
    width: 400px;
    max-width: 96vw;
    height: 80px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.rc-widget:hover .rc-checkbox-box { border-color: #888; }

.rc-left {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rc-checkbox-box {
    width: 28px;
    height: 28px;
    border: 2px solid #c1c1c1;
    border-radius: 2px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

/* Estado após clique: sem borda nem fundo, apenas spinner/check flutuam */
.rc-checkbox-box.naked {
    border: none !important;
    background: transparent !important;
    box-shadow: none;
}

.rc-center {
    flex: 1;
    padding: 0 4px 0 0;
}

.rc-label {
    font-family: Roboto, Arial, sans-serif;
    font-size: 14px;
    color: #4a4a4a;
    font-weight: 400;
}

.rc-brand {
    width: 78px;
    background: #f1f1f1;
    border-left: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 8px 4px;
    gap: 2px;
    flex-shrink: 0;
}

.rc-logo-svg { width: 34px; height: 34px; }

.rc-brand-name {
    font-family: Roboto, Arial, sans-serif;
    font-size: 9.5px;
    color: #9A9A9A;
    letter-spacing: 0.3px;
    line-height: 1;
}

.rc-brand-links {
    font-family: Roboto, Arial, sans-serif;
    font-size: 7.5px;
    color: #b5b5b5;
    line-height: 1;
}

.rc-spinner-ring {
    width: 22px;
    height: 22px;
    border: 2.5px solid #4A90D9;
    border-top-color: transparent;
    border-radius: 50%;
    animation: rcSpin 0.7s linear infinite;
}

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

.rc-check-svg { width: 26px; height: 26px; }

/* ============================================================
   reCAPTCHA IMAGE PANEL (rcip)
   ============================================================ */
#rcImagePanel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    animation: fadeInCard 0.3s ease forwards;
}

.rcip-box {
    background: #fff;
    border: 1px solid #d3d3d3;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    border-radius: 2px;
    width: 370px;
    max-width: 96vw;
    overflow: hidden;
    margin: 0 auto;
}

.rcip-header {
    background: #4A90D9;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rcip-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rcip-header-sub {
    font-family: Roboto, Arial, sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
}

.rcip-header-main {
    font-family: Roboto, Arial, sans-serif;
    font-size: 20px;
    color: #fff;
    font-weight: 700;
    line-height: 1.15;
}

.rcip-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.rcip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: #ccc;
    padding: 2px;
}

.rcip-cell {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1;
}

.rcip-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.15s;
}

.rcip-cell.selected img {
    filter: brightness(0.75);
}

.rcip-cell-check {
    display: none;
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: #4A90D9;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
}

.rcip-cell.selected .rcip-cell-check {
    display: flex;
}

.rcip-cell-check svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rcip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-top: 1px solid #e8e8e8;
    background: #f9f9f9;
}

.rcip-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.rcip-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.rcip-icon-btn:hover { background: rgba(0,0,0,0.07); }

.rcip-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
}

.rcip-verify-btn {
    background: #4A90D9;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-family: Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 10px 22px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.rcip-verify-btn:hover { background: #357ABD; }
.rcip-verify-btn:disabled { opacity: 1; cursor: default; background: #4A90D9; }

@keyframes rcipShake {
    0%,100%{ transform: translateX(0); }
    20%{ transform: translateX(-8px); }
    40%{ transform: translateX(8px); }
    60%{ transform: translateX(-5px); }
    80%{ transform: translateX(5px); }
}

.rcip-error {
    font-family: Roboto, Arial, sans-serif;
    font-size: 12px;
    color: #c0392b;
    background: #fdf2f2;
    border-top: 1px solid #f5c6c6;
    padding: 8px 14px;
    text-align: left;
    line-height: 1.4;
}

.rcip-grid.loading .rcip-cell img {
    opacity: 0.35;
    transition: opacity 0.3s ease;
}

.rcip-grid.loading .rcip-cell-check {
    display: none !important;
}
