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

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

@keyframes tvPulseDot {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

.tv-icon-box-blue {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

.tv-form-input {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #111827;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.tv-form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.tv-form-submit {
    background: #2563eb;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #2563eb;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(37, 99, 235, .3);
    transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.tv-form-submit:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .25);
}

.tv-form-submit:disabled {
    background: #93c5fd;
    border-color: #93c5fd;
    cursor: not-allowed;
    box-shadow: none;
}

.tv-step-num-blue {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    border-radius: 50%;
}

.tv-step-num-muted {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #9ca3af;
    border-radius: 50%;
}

.tv-tabbed-lookup {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.tv-tabbed-tablist {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.tv-lookup-tab {
    background: transparent;
    border: 1px solid transparent;
    color: #6b7280;
}

.tv-lookup-tab:hover {
    color: #374151;
}

.tv-lookup-tab--active {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.tv-nav-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tv-nav-card:hover {
    color: #111827;
    border-color: #bfdbfe;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, .08);
}

.tv-filter-btn {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tv-filter-btn--active,
.tv-filter-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.tv-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 12px;
}

.tv-spinner {
    border-color: #e5e7eb;
    border-top-color: #2563eb;
}

.tv-drop-zone {
    border: 2px dashed #d1d5db;
    background: #f9fafb;
    padding: 40px 20px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.tv-drop-zone:hover,
.tv-drop-zone.tv-drag-over {
    border-color: #93c5fd;
    background: #eff6ff;
}

.tv-image-remove {
    background: #dc2626;
    border: none;
    cursor: pointer;
}

/* ── Country-code flag dropdown ─────────────────────────────── */
.tv-dial-dropdown {
    position: relative;
}

.tv-dial-trigger {
    white-space: nowrap;
    min-width: 8.5rem;
    max-width: 11rem;
    user-select: none;
}

.tv-dial-trigger[aria-expanded="true"] {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.tv-dial-chevron {
    transition: transform 0.15s ease;
}

.tv-dial-trigger[aria-expanded="true"] .tv-dial-chevron {
    transform: rotate(180deg);
}

.tv-dial-panel {
    position: fixed;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    animation: tvFadeIn 0.12s ease;
    overflow: hidden;
}

.tv-dial-panel[hidden] {
    display: none;
}

.tv-dial-search-wrap {
    padding: 8px 8px 4px;
    border-bottom: 1px solid #f3f4f6;
}

.tv-dial-search {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    color: #111827;
    box-sizing: border-box;
}

.tv-dial-search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .10);
}

.tv-dial-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.tv-dial-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s ease;
}

.tv-dial-list li:hover {
    background: #f0f4ff;
    color: #1d4ed8;
}

.tv-dial-list li.is-selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.tv-dial-list li[hidden] {
    display: none;
}

.tv-dial-item-flag {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

@media (max-width: 639px) {
    .tv-dial-trigger {
        min-width: 0;
        max-width: none;
    }
}

/* ── Face detection status bar ───────────────────────────────── */
.tv-face-status {
    padding: 9px 13px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    line-height: 1.4;
}

.tv-face-status--detecting {
    background: #f0f4ff;
    border: 1px solid #c7d7fd;
    color: #3b5bdb;
}

.tv-face-status--ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.tv-face-status--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.tv-face-status--info {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ── Face-selection modal ─────────────────────────────────────── */
.tv-face-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tv-face-modal-overlay.tv-face-modal-visible {
    opacity: 1;
}

.tv-face-modal {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 24px 24px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.tv-face-modal-overlay.tv-face-modal-visible .tv-face-modal {
    transform: translateY(0);
}

.tv-face-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: background 0.15s ease, color 0.15s ease;
}

.tv-face-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.tv-face-modal-title {
    margin: 0 0 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.tv-face-modal-desc {
    margin: 0 0 20px;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.tv-face-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.tv-face-card {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
    cursor: pointer;
    padding: 0;
    aspect-ratio: 1;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tv-face-card:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.tv-face-card--selected {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.tv-face-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tv-face-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.tv-face-modal-cancel {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #6b7280;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tv-face-modal-cancel:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Free-tier preview (blurred synthetic results) */
.tv-free-preview-wrap {
    position: relative;
}

.tv-free-preview-blur-zone {
    filter: blur(7px);
    user-select: none;
    pointer-events: none;
    opacity: 0.72;
    transform: scale(1.01);
    margin-bottom: 8px;
}

.tv-free-preview-paywall {
    position: relative;
    z-index: 2;
    margin-top: 12px;
    padding-top: 0;
}

.tv-free-preview-paywall-inner {
    text-align: center;
    padding: 18px 20px;
    margin-bottom: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, #ffffff 100%);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.tv-free-preview-lock {
    display: block;
    font-size: 1.35rem;
    margin-bottom: 6px;
}

.tv-free-preview-paywall-title {
    margin: 0 0 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.tv-free-preview-paywall-text {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
}

.tv-results-packages {
    position: relative;
    z-index: 2;
    padding: 8px 0 4px;
}

/* ── Coupon connected state ─────────────────────────────────────── */
.tv-coupon-connected {
    animation: tvFadeIn 0.2s ease;
}

.tv-coupon-connected-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 9px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-size: 0.78rem;
    color: #15803d;
}

.tv-coupon-connected-icon {
    flex-shrink: 0;
    color: #16a34a;
}

.tv-coupon-connected-label {
    font-weight: 600;
    color: #15803d;
}

.tv-coupon-connected-code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    color: #166534;
    background: #dcfce7;
    border-radius: 5px;
    padding: 1px 5px;
}

.tv-coupon-disconnect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    padding: 2px;
    background: none;
    border: none;
    border-radius: 4px;
    color: #4ade80;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.tv-coupon-disconnect:hover {
    color: #dc2626;
    background: #fee2e2;
}

/* ── Face Comparison tool ─────────────────────────────────────────────────── */

.ffl-cmp-wrap {
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
    padding: 0;
}

.ffl-cmp-panels {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0 1rem;
    align-items: start;
}

@media (max-width: 600px) {
    .ffl-cmp-panels {
        grid-template-columns: 1fr;
        gap: 1rem 0;
    }
}

.ffl-cmp-panel-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

.ffl-cmp-panel-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ffl-cmp-dz {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2rem 1rem;
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    background: #f9fafb;
    cursor: pointer;
    min-height: 180px;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ffl-cmp-dz:hover,
.ffl-cmp-dz.tv-drag-over {
    border-color: #93c5fd;
    background: #eff6ff;
}

.ffl-cmp-dz:hover .ffl-cmp-dz-icon {
    color: #2563eb;
}

.ffl-cmp-dz-icon {
    color: #9ca3af;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.ffl-cmp-dz-text {
    margin: 0;
    font-size: 0.82rem;
    color: #6b7280;
}

.ffl-cmp-dz-hint {
    margin: 0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.ffl-cmp-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.ffl-cmp-preview-inner {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ffl-cmp-preview-img {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}

.ffl-cmp-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.15s ease;
}

.ffl-cmp-remove:hover {
    background: rgba(220, 38, 38, 0.85);
}

.ffl-cmp-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2.4rem;
    align-self: center;
}

.ffl-cmp-vs-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
}

@media (max-width: 600px) {
    .ffl-cmp-vs {
        padding-top: 0;
        padding-bottom: 0;
    }

    .ffl-cmp-vs-label {
        width: 2rem;
        height: 2rem;
        font-size: 0.65rem;
        margin-inline: auto;
    }
}

.ffl-cmp-action {
    margin-top: 1.25rem;
}

.ffl-cmp-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ffl-cmp-btn-icon {
    flex-shrink: 0;
}

/* ── Result ─── */

.ffl-cmp-result {
    margin-top: 2rem;
    padding: 2rem 1.5rem;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.ffl-cmp-gauge-wrap {
    position: relative;
    width: 220px;
    margin-inline: auto;
}

.ffl-cmp-gauge-svg {
    width: 100%;
    height: auto;
    display: block;
}

.ffl-cmp-gauge-center {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.ffl-cmp-pct {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
    transition: color 0.4s ease;
}

.ffl-cmp-pct-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.ffl-cmp-verdict {
    margin-top: 1.25rem;
}

.ffl-cmp-verdict-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.ffl-cmp-verdict-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.ffl-cmp-verdict-sub {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #64748b;
    max-width: 34rem;
    margin-inline: auto;
}

.ffl-cmp-reset-btn {
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ffl-cmp-reset-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ── Error ─── */

.ffl-cmp-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 0.82rem;
}

/* ── Privacy note ─── */

.ffl-cmp-privacy {
    margin-top: 1.25rem;
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
