/* TNL Addons Pro — Login Popup */

/* ── Overlay ─────────────────────────────────────────────── */
.tnl-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999990;
    background: rgba(10, 25, 47, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: tnl-overlay-in .2s ease;
}
@keyframes tnl-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Caja del popup ──────────────────────────────────────── */
.tnl-popup-box {
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .35);
    animation: tnl-box-in .28s cubic-bezier(.22,.68,0,1.2);
    box-sizing: border-box;
}
@keyframes tnl-box-in {
    from { opacity: 0; transform: scale(.93) translateY(16px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

/* ── Botón cerrar ────────────────────────────────────────── */
.tnl-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px; height: 32px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #aaa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.tnl-popup-close:hover { background: #f5f5f5; color: #333; }

/* ── reCAPTCHA status badge ──────────────────────────────── */
.tnl-recap-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    margin-bottom: 16px;
    font-size: .82rem;
    font-weight: 600;
    transition: background .3s, border-color .3s;
}

/* Dot animado */
.tnl-recap-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background .3s;
}

/* Estados */
.tnl-recap-dot.tnl-recap-checking {
    background: #ffc107;
    animation: tnl-pulse .9s ease-in-out infinite;
}
.tnl-recap-dot.tnl-recap-human  { background: #28a745; }
.tnl-recap-dot.tnl-recap-bot    { background: #dc3545; }

@keyframes tnl-pulse {
    0%, 100% { opacity: 1; transform: scale(1);   }
    50%       { opacity: .5; transform: scale(.75); }
}

.tnl-recap-status.tnl-recap-ok   { background: #f0fff4; border-color: #b7ebc8; }
.tnl-recap-status.tnl-recap-fail { background: #fff5f5; border-color: #ffc5c5; }

.tnl-recap-label { color: #555; line-height: 1.3; }
.tnl-recap-status.tnl-recap-ok   .tnl-recap-label { color: #1a7c34; }
.tnl-recap-status.tnl-recap-fail .tnl-recap-label { color: #c62828; }

/* Mensaje de ayuda cuando falla */
.tnl-recap-help {
    font-size: .78rem;
    color: #c62828;
    background: #fff5f5;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    line-height: 1.5;
    display: none;
}
.tnl-recap-help a { color: #c62828; font-weight: 700; }

/* ── Logo ────────────────────────────────────────────────── */
.tnl-auth-logo {
    text-align: center;
    margin-bottom: 20px;
}
.tnl-auth-logo img {
    max-width: 150px;
    max-height: 56px;
    width: auto; height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.tnl-auth-logo .tnl-site-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0a192f;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tnl-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}
.tnl-tab-btn {
    flex: 1;
    padding: 9px 6px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    color: #999;
    transition: color .18s, border-color .18s;
}
.tnl-tab-btn.active { color: #0a192f; border-bottom-color: #0a192f; }
.tnl-tab-btn:hover:not(.active) { color: #444; }
.tnl-tab-panel          { display: none; }
.tnl-tab-panel.active   { display: block; }

/* ── Campos ──────────────────────────────────────────────── */
.tnl-field { margin-bottom: 14px; }
.tnl-field label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: 4px; color: #444; }
.tnl-input {
    width: 100%; padding: 11px 13px;
    border: 1.5px solid #e0e0e0; border-radius: 10px;
    font-size: .97rem; background: #fafafa; color: #111;
    outline: none; box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s;
    -webkit-appearance: none;
}
.tnl-input:focus { border-color: #0a192f; background: #fff; box-shadow: 0 0 0 3px rgba(10,25,47,.08); }
.tnl-otp-input { letter-spacing: .25em; text-transform: uppercase; font-size: 1.5rem; font-weight: 700; text-align: center; font-family: monospace; }

/* ── Botones ─────────────────────────────────────────────── */
.tnl-btn {
    width: 100%; padding: 13px;
    background: #0a192f; color: #fff;
    border: none; border-radius: 40px;
    font-weight: 700; font-size: .97rem;
    cursor: pointer; margin-top: 6px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .18s, transform .1s;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.tnl-btn:hover:not(:disabled) { background: #0f2544; transform: translateY(-1px); }
.tnl-btn:disabled { background: #bbb; cursor: not-allowed; transform: none; }

/* ── Spinner ─────────────────────────────────────────────── */
.tnl-spinner {
    display: none; width: 16px; height: 16px; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.25); border-top-color: #fff;
    border-radius: 50%; animation: tnl-spin .6s linear infinite;
}
@keyframes tnl-spin { to { transform: rotate(360deg); } }

/* ── Mensajes ────────────────────────────────────────────── */
.tnl-msg { padding: 10px 12px; border-radius: 9px; font-size: .85rem; margin-bottom: 12px; display: none; line-height: 1.4; }
.tnl-msg.error   { background: #ffebee; color: #c62828; }
.tnl-msg.success { background: #e8f5e9; color: #2e7d32; }
.tnl-msg.info    { background: #e3f2fd; color: #1565c0; }

.tnl-countdown { text-align: center; padding: 12px; background: #fff3e0; border-radius: 9px; font-size: .88rem; color: #e65100; font-weight: 600; margin-bottom: 12px; display: none; }

/* ── OTP hints / links ───────────────────────────────────── */
.tnl-otp-hint { text-align: center; color: #666; font-size: .86rem; margin-bottom: 14px; line-height: 1.5; }
.tnl-otp-hint strong { color: #0a192f; }
.tnl-forgot { text-align: center; margin-top: 14px; font-size: .83rem; }
.tnl-forgot a, .tnl-resend-otp, .tnl-back-step1 { color: #0a192f; text-decoration: none; font-weight: 600; }
.tnl-forgot a:hover, .tnl-resend-otp:hover { text-decoration: underline; }
.tnl-back-step1 { color: #aaa; font-weight: 500; }
.tnl-fine-print { font-size: .78rem; color: #aaa; text-align: center; margin-top: 12px; line-height: 1.5; }
.tnl-fine-print a { color: #0a192f; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .tnl-popup-box { padding: 28px 18px 22px; border-radius: 16px; }
    .tnl-input { font-size: 1rem; } /* evitar zoom iOS */
    .tnl-otp-input { font-size: 1.35rem; }
}

/* Trap scroll del body cuando popup abierto */
body.tnl-popup-open { overflow: hidden; }
