/* ─── JustSEOAI Frontend Styles ─────────────────────── */
/* Uses theme CSS vars: --te-bg-modal, --te-text-heading, --te-accent, etc. */

/* ─── Reset / Base ──────────────────────────────────── */
.tejs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.tejs-section {
    padding: 60px 0;
}

.tejs-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--te-text-heading, #0f172a);
}

.tejs-section-desc {
    color: var(--te-text-muted, #64748b);
    font-size: 1.05rem;
    margin-bottom: 32px;
}

.tejs-empty {
    color: var(--te-text-muted, #64748b);
    text-align: center;
    padding: 40px 0;
}

/* ─── Buttons ───────────────────────────────────────── */
.tejs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.5;
}

.tejs-btn-primary {
    background: var(--te-accent, #0a66c2);
    color: var(--te-bg-raised, #fff);
}

.tejs-btn-primary:hover {
    background: var(--te-accent-hover, #084d94);
    color: var(--te-bg-raised, #fff);
    transform: translateY(-1px);
}

.tejs-btn-outline {
    background: transparent;
    color: var(--te-accent, #0a66c2);
    border: 2px solid var(--te-accent, #0a66c2);
}

.tejs-btn-outline:hover {
    background: var(--te-accent, #0a66c2);
    color: var(--te-bg-raised, #fff);
}

.tejs-btn-link {
    background: none;
    border: none;
    color: var(--te-accent, #0a66c2);
    padding: 8px 0;
    font-weight: 500;
}

.tejs-btn-link:hover {
    text-decoration: underline;
}

.tejs-btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
}

.tejs-btn:disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ─── Forms ─────────────────────────────────────────── */
.tejs-form {
    width: 100%;
}

.tejs-form-group {
    margin-bottom: 20px;
}

.tejs-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--te-text-heading, #0f172a);
    margin-bottom: 6px;
}

.tejs-form-group input,
.tejs-form-group textarea,
.tejs-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--te-border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--te-text-heading, #0f172a);
    background: var(--te-bg-raised, #fff);
    transition: border-color 0.2s;
}

.tejs-form-group input:focus,
.tejs-form-group textarea:focus,
.tejs-form-group select:focus {
    outline: none;
    border-color: var(--te-accent, #0a66c2);
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.tejs-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.tejs-form-message {
    margin-top: 12px;
    font-size: 0.875rem;
    min-height: 20px;
}

.tejs-form-message.success {
    color: var(--te-success, #059669);
}

.tejs-form-message.error {
    color: var(--te-error, #dc2626);
}

.tejs-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ─── Login Page ────────────────────────────────────── */
.tejs-login-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--te-bg-sunken, #f8fafc);
    padding: 40px 20px;
}

.tejs-login-container {
    width: 100%;
    max-width: 440px;
}

.tejs-login-card {
    background: var(--te-bg-raised, #fff);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.tejs-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.tejs-login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--te-text-heading, #0f172a);
    margin-bottom: 4px;
}

.tejs-login-header p {
    color: var(--te-text-muted, #64748b);
    font-size: 0.95rem;
}

.tejs-otp-info {
    color: var(--te-text-muted, #64748b);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.tejs-login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--te-border, #e2e8f0);
    font-size: 0.85rem;
    color: var(--te-text-muted, #64748b);
}

.tejs-login-footer a {
    color: var(--te-accent, #0a66c2);
    text-decoration: none;
}

/* ─── Onboarding Page ───────────────────────────────── */
.tejs-onboarding-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--te-bg-sunken, #f8fafc);
    padding: 40px 20px;
}

.tejs-onboarding-container {
    width: 100%;
    max-width: 520px;
}

.tejs-onboarding-card {
    background: var(--te-bg-raised, #fff);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.tejs-onboarding-header {
    text-align: center;
    margin-bottom: 28px;
}

.tejs-onboarding-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--te-text-heading, #0f172a);
    margin-bottom: 8px;
}

.tejs-onboarding-header p {
    color: var(--te-text-muted, #64748b);
    font-size: 0.95rem;
}

/* ─── Dashboard Page ────────────────────────────────── */
.tejs-dashboard-page {
    min-height: 100vh;
    background: var(--te-bg-sunken, #f8fafc);
}

.tejs-dashboard-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.tejs-sidebar {
    background: var(--te-text-heading, #0f172a);
    color: var(--te-border, #e2e8f0);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
}

.tejs-sidebar-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.tejs-sidebar-brand h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--te-bg-raised, #fff);
    margin: 0;
}

.tejs-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
}

.tejs-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--te-text-subtle, #94a3b8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.tejs-nav-item:hover,
.tejs-nav-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--te-bg-raised, #fff);
}

.tejs-nav-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.tejs-sidebar-footer {
    padding: 16px 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.tejs-sidebar-footer .tejs-btn-link {
    color: var(--te-text-subtle, #94a3b8);
    font-size: 0.85rem;
}

/* Main content */
.tejs-main-content {
    padding: 32px;
    overflow-y: auto;
}

.tejs-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.tejs-dash-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--te-text-heading, #0f172a);
    margin: 0;
}

.tejs-dash-email {
    color: var(--te-text-muted, #64748b);
    font-size: 0.9rem;
    margin: 0;
}

/* Stat Grid */
.tejs-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.tejs-stat-card {
    background: var(--te-bg-raised, #fff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tejs-stat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--te-text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tejs-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--te-text-heading, #0f172a);
}

.tejs-info-bar {
    background: #eff6ff;
    border-left: 3px solid var(--te-accent, #0a66c2);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 28px;
    font-size: 0.9rem;
    color: #1e40af;
}

/* Tables */
.tejs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--te-bg-raised, #fff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tejs-table thead th {
    background: var(--te-bg-sunken, #f8fafc);
    padding: 10px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--te-text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--te-border, #e2e8f0);
}

.tejs-table tbody td {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--te-bg-section-alt, #f1f5f9);
}

.tejs-table tbody tr:last-child td {
    border-bottom: none;
}

.tejs-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tejs-status-completed { background: #dcfce7; color: #166534; }
.tejs-status-running { background: #dbeafe; color: #1e40af; }
.tejs-status-pending { background: #fef9c3; color: #854d0e; }
.tejs-status-failed { background: #fecaca; color: #991b1b; }
.tejs-status-cancelled { background: var(--te-bg-section-alt, #f1f5f9); color: var(--te-text-muted, #475569); }

/* ─── Landing Page ──────────────────────────────────── */
.tejs-hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
    padding: 80px 20px;
    text-align: center;
}

.tejs-hero-inner {
    max-width: 720px;
    margin: 0 auto;
}

.tejs-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--te-text-heading, #0f172a);
    margin-bottom: 16px;
    line-height: 1.2;
}

.tejs-hero-sub {
    font-size: 1.1rem;
    color: var(--te-text-muted, #475569);
    margin-bottom: 28px;
    line-height: 1.6;
}

.tejs-hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Tool Cards ────────────────────────────────────── */
.tejs-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tejs-tool-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.tejs-tool-card {
    background: var(--te-bg-raised, #fff);
    border: 1.5px solid var(--te-border, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    display: block;
}

.tejs-tool-card:hover {
    border-color: var(--te-accent, #0a66c2);
    box-shadow: 0 4px 16px rgba(10, 102, 194, 0.1);
    transform: translateY(-2px);
}

.tejs-tool-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--te-text-heading, #0f172a);
    margin: 8px 0;
}

.tejs-tool-card p {
    color: var(--te-text-muted, #64748b);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.tejs-tool-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tejs-badge-free { background: #dcfce7; color: #166534; }
.tejs-badge-freemium { background: #dbeafe; color: #1e40af; }
.tejs-badge-premium { background: #fef3c7; color: #92400e; }

.tejs-tool-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--te-text-muted, #94a3b8);
}

.tejs-tool-category {
    font-size: 0.75rem;
    color: var(--te-accent, #0a66c2);
    font-weight: 500;
}

/* ─── Tool Single Page ──────────────────────────────── */
.tejs-breadcrumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--te-text-muted, #64748b);
    flex-wrap: wrap;
}

.tejs-breadcrumbs a {
    color: var(--te-accent, #0a66c2);
    text-decoration: none;
}

.tejs-breadcrumbs .current {
    color: var(--te-text-heading, #0f172a);
    font-weight: 600;
}

.tejs-tool-hero {
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--te-border, #e2e8f0);
    margin-bottom: 32px;
}

.tejs-tool-hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--te-text-heading, #0f172a);
    margin: 12px 0 8px;
}

.tejs-tool-desc {
    color: var(--te-text-muted, #475569);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.tejs-tool-cost {
    font-size: 0.85rem;
    color: var(--te-accent, #0a66c2);
    font-weight: 500;
}

.tejs-tool-category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--te-bg-section-alt, #f1f5f9);
    color: var(--te-text-muted, #64748b);
    margin-left: 8px;
}

.tejs-tool-workspace {
    max-width: 720px;
    margin: 0 auto 48px;
}

.tejs-tool-workspace h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.tejs-login-gate {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.tejs-login-gate p {
    margin-bottom: 16px;
    color: #92400e;
}

/* Results */
.tejs-tool-results {
    margin-top: 28px;
    background: var(--te-bg-raised, #fff);
    border: 1.5px solid var(--te-border, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
}

.tejs-tool-results h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.tejs-tool-output {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--te-text-heading, #0f172a);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.tejs-result-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

/* ─── SEO Copy ──────────────────────────────────────── */
.tejs-seo-copy {
    padding: 48px 0;
    border-top: 1px solid var(--te-border, #e2e8f0);
}

.tejs-seo-copy h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.tejs-seo-copy h3 {
    font-size: 1.1rem;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--te-text-heading, #0f172a);
}

.tejs-seo-copy p {
    color: var(--te-text-muted, #475569);
    line-height: 1.7;
    margin-bottom: 12px;
}

/* ─── Tool CTA ──────────────────────────────────────── */
.tejs-tool-cta {
    text-align: center;
    padding: 48px 0;
    border-top: 1px solid var(--te-border, #e2e8f0);
}

/* ─── How It Works ──────────────────────────────────── */
.tejs-how-it-works {
    background: var(--te-bg-raised, #fff);
}

.tejs-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}

.tejs-step {
    text-align: center;
    padding: 24px;
}

.tejs-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--te-accent, #0a66c2);
    color: var(--te-bg-raised, #fff);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.tejs-step h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.tejs-step p {
    font-size: 0.9rem;
    color: var(--te-text-muted, #64748b);
    line-height: 1.6;
}

/* ─── Pricing ───────────────────────────────────────── */
.tejs-pricing {
    background: var(--te-bg-sunken, #f8fafc);
}

.tejs-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.tejs-pricing-card {
    background: var(--te-bg-raised, #fff);
    border: 1.5px solid var(--te-border, #e2e8f0);
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    transition: border-color 0.2s;
}

.tejs-pricing-card:hover {
    border-color: var(--te-accent, #0a66c2);
}

.tejs-pricing-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.tejs-pricing-amount {
    margin-bottom: 4px;
}

.tejs-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--te-text-heading, #0f172a);
}

.tejs-pricing-credits {
    color: var(--te-text-muted, #64748b);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.tejs-section-cta {
    text-align: center;
    margin-top: 28px;
}

.tejs-section-cta a {
    color: var(--te-accent, #0a66c2);
    font-weight: 600;
    text-decoration: none;
}

/* ─── Final CTA ─────────────────────────────────────── */
.tejs-final-cta {
    background: linear-gradient(135deg, var(--te-text-heading, #0f172a) 0%, var(--te-text-heading, #1e293b) 100%);
    text-align: center;
    padding: 60px 20px;
}

.tejs-final-cta h2 {
    color: var(--te-bg-raised, #fff);
    font-size: 1.5rem;
}

.tejs-final-cta p {
    color: var(--te-text-subtle, #94a3b8);
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Tools Filter ──────────────────────────────────── */
.tejs-tools-hero {
    padding: 40px 0 32px;
    text-align: center;
}

.tejs-tools-hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--te-text-heading, #0f172a);
    margin-bottom: 12px;
}

.tejs-tools-hero p {
    color: var(--te-text-muted, #475569);
    font-size: 1.05rem;
    max-width: 640px;
    margin: 0 auto 28px;
}

.tejs-tools-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.tejs-filter-btn {
    padding: 6px 16px;
    border: 1.5px solid var(--te-border, #e2e8f0);
    border-radius: 20px;
    background: var(--te-bg-raised, #fff);
    color: var(--te-text-muted, #64748b);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}

.tejs-filter-btn:hover,
.tejs-filter-btn.active {
    background: var(--te-accent, #0a66c2);
    color: var(--te-bg-raised, #fff);
    border-color: var(--te-accent, #0a66c2);
}

.tejs-filter-count {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ─── Form Layout ──────────────────────────────────── */
.tejs-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tejs-form-half {
    width: 100%;
}

.tejs-form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--te-text-muted, #94a3b8);
    margin-top: 4px;
}

/* ─── Progress Bar ─────────────────────────────────── */
.tejs-progress {
    margin-top: 20px;
    padding: 20px;
    background: var(--te-bg-sunken, #f8fafc);
    border-radius: 12px;
    border: 1px solid var(--te-border, #e2e8f0);
}

.tejs-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tejs-progress-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--te-text-heading, #1e293b);
}

.tejs-progress-pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--te-accent, #0a66c2);
    font-variant-numeric: tabular-nums;
}

.tejs-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--te-border, #e2e8f0);
    border-radius: 3px;
    overflow: hidden;
}

.tejs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--te-accent, #0a66c2), #38bdf8);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}

.tejs-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    gap: 4px;
}

.tejs-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.tejs-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--te-border-strong, #cbd5e1);
    border: 2px solid var(--te-border, #e2e8f0);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.tejs-step-name {
    font-size: 0.7rem;
    color: var(--te-text-subtle, #94a3b8);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: color 0.3s;
}

.tejs-step-active .tejs-step-dot {
    background: var(--te-accent, #0a66c2);
    border-color: var(--te-accent, #0a66c2);
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.2);
    animation: tejs-pulse 1.5s ease-in-out infinite;
}

.tejs-step-active .tejs-step-name {
    color: var(--te-accent, #0a66c2);
    font-weight: 600;
}

.tejs-step-done .tejs-step-dot {
    background: #22c55e;
    border-color: #22c55e;
}

.tejs-step-done .tejs-step-name {
    color: var(--te-success, #16a34a);
}

@keyframes tejs-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(10, 102, 194, 0.1); }
}

/* ─── Result Items ─────────────────────────────────── */
.tejs-result-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--te-bg-section-alt, #f1f5f9);
    line-height: 1.6;
}

.tejs-result-item:last-child {
    border-bottom: none;
}

.tejs-result-num {
    font-weight: 700;
    color: var(--te-accent, #0a66c2);
    margin-right: 6px;
}

.tejs-tool-output h3,
.tejs-tool-output h4 {
    margin: 16px 0 8px;
    color: var(--te-text-heading, #0f172a);
}

.tejs-tool-output h3 { font-size: 1.1rem; }
.tejs-tool-output h4 { font-size: 0.95rem; }

.tejs-tool-output ul {
    margin: 8px 0 8px 20px;
    list-style: disc;
}

.tejs-tool-output li {
    margin-bottom: 4px;
    line-height: 1.6;
}

.tejs-tool-output mark {
    background: #fef08a;
    padding: 1px 3px;
    border-radius: 2px;
}

/* ─── SEO Scorer Report ────────────────────────────── */
.tejs-seo-report {
    font-size: 0.9rem;
}

.tejs-score-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.tejs-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tejs-score-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.tejs-score-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--te-text-muted, #64748b);
}

.tejs-score-meta p {
    margin: 4px 0;
    font-size: 0.9rem;
}

.tejs-checks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tejs-check-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--te-bg-sunken, #f8fafc);
}

.tejs-check-good { border-left: 3px solid #22c55e; }
.tejs-check-ok { border-left: 3px solid #f59e0b; }
.tejs-check-warning { border-left: 3px solid #f59e0b; }
.tejs-check-bad { border-left: 3px solid #ef4444; }

.tejs-check-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    padding-top: 2px;
}

.tejs-check-content {
    flex: 1;
    min-width: 0;
}

.tejs-check-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.tejs-check-pct {
    color: var(--te-text-muted, #94a3b8);
    font-weight: 500;
}

.tejs-check-bar {
    height: 4px;
    background: var(--te-border, #e2e8f0);
    border-radius: 2px;
    margin-bottom: 6px;
    overflow: hidden;
}

.tejs-check-fill {
    height: 100%;
    background: var(--te-accent, #0a66c2);
    border-radius: 2px;
}

.tejs-check-msg {
    font-size: 0.8rem;
    color: var(--te-text-muted, #64748b);
    margin: 0;
    line-height: 1.4;
}

/* ─── Density Result ───────────────────────────────── */
.tejs-density-result .tejs-stat-grid {
    margin-bottom: 16px;
}

.tejs-recommendation {
    padding: 10px 14px;
    background: #eff6ff;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e40af;
    margin-bottom: 16px;
}

.tejs-text-preview {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.7;
    padding: 12px;
    background: var(--te-bg-raised, #fff);
    border: 1px solid var(--te-border, #e2e8f0);
    border-radius: 8px;
    color: var(--te-text-heading, #334155);
}

/* ─── Button Loading State ─────────────────────────── */
.tejs-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tejs-btn-loading .tejs-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-top-color: var(--te-bg-raised, #fff);
    border-color: rgba(255,255,255,0.3);
    border-top-color: var(--te-bg-raised, #fff);
}

/* ─── FAQ Section ──────────────────────────────────── */
.tejs-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tejs-faq-item {
    background: var(--te-bg-raised, #fff);
    border: 1px solid var(--te-border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.tejs-faq-question {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--te-text-heading, #1e293b);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tejs-faq-question::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--te-text-subtle, #94a3b8);
    transition: transform 0.2s;
}

.tejs-faq-item[open] .tejs-faq-question::after {
    content: '-';
}

.tejs-faq-question::-webkit-details-marker {
    display: none;
}

.tejs-faq-answer {
    padding: 0 20px 16px;
    color: var(--te-text-muted, #475569);
    font-size: 0.9rem;
    line-height: 1.6;
}

.tejs-faq-answer p {
    margin: 0;
}

/* ─── HowTo Steps ─────────────────────────────────── */
.tejs-steps-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tejs-steps-list li {
    counter-increment: step;
    background: var(--te-bg-raised, #fff);
    border: 1px solid var(--te-border, #e2e8f0);
    border-radius: 8px;
    padding: 20px 20px 20px 64px;
    position: relative;
}

.tejs-steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 18px;
    width: 32px;
    height: 32px;
    background: var(--te-accent, #0a66c2);
    color: var(--te-bg-raised, #fff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.tejs-steps-list li strong {
    display: block;
    font-size: 1rem;
    color: var(--te-text-heading, #1e293b);
    margin-bottom: 4px;
}

.tejs-steps-list li p {
    margin: 0;
    color: var(--te-text-muted, #64748b);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ─── Readability Report ───────────────────────────── */
.tejs-readability-report {
    padding: 20px 0;
}

.tejs-reading-level {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ─── Loading Spinner ───────────────────────────────── */
.tejs-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--te-border, #e2e8f0);
    border-top-color: var(--te-accent, #0a66c2);
    border-radius: 50%;
    animation: tejs-spin 0.6s linear infinite;
}

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

/* ─── Subscription Page ─────────────────────────────── */
.tejs-pricing-card {
    position: relative;
    overflow: visible;
}

.tejs-pricing-card--current {
    border: 2px solid var(--te-accent, #0a66c2);
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.tejs-pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--te-accent, #0a66c2);
    color: var(--te-bg-raised, #fff);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.tejs-pricing-alt {
    font-size: 0.8rem;
    color: var(--te-text-subtle, #94a3b8);
    margin-top: -4px;
}

.tejs-pricing-per-credit {
    font-size: 0.75rem;
    color: var(--te-text-muted, #64748b);
    margin-top: 2px;
}

.tejs-pricing-card .tejs-btn {
    margin-top: 16px;
    width: 100%;
}

.tejs-info-bar--active {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    color: #166534;
}

.tejs-section-desc {
    color: var(--te-text-muted, #64748b);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* ─── Payment Modal ────────────────────────────────── */
.tejs-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tejs-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.tejs-modal-content {
    position: relative;
    background: var(--te-bg-raised, #fff);
    border-radius: 16px;
    padding: 32px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.tejs-modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--te-text-heading, #1e293b);
    margin: 0 0 4px;
}

.tejs-modal-content > p {
    color: var(--te-text-muted, #64748b);
    font-size: 0.9rem;
    margin: 0 0 20px;
}

.tejs-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--te-text-subtle, #94a3b8);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.tejs-modal-close:hover {
    color: var(--te-text-heading, #1e293b);
}

.tejs-modal-section {
    margin-bottom: 20px;
}

.tejs-modal-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--te-text-muted, #64748b);
    margin-bottom: 12px;
}

.tejs-pricing-grid--modal {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.tejs-pricing-card--compact {
    padding: 16px 12px;
}

.tejs-pricing-card--compact h3 {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.tejs-pricing-card--compact .tejs-price {
    font-size: 1.25rem;
}

.tejs-pricing-card--compact .tejs-pricing-credits {
    margin-bottom: 12px;
}

.tejs-pricing-card--compact .tejs-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.tejs-modal-footer-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
}

.tejs-modal-footer-link a {
    color: var(--te-accent, #0a66c2);
    text-decoration: none;
    font-weight: 500;
}

.tejs-modal-footer-link a:hover {
    text-decoration: underline;
}

/* ─── Consultation CTA ─────────────────────────────── */
.tejs-consultation-cta {
    text-align: center;
    background: linear-gradient(135deg, var(--te-bg-sunken, #f8fafc) 0%, #eef2ff 100%);
    border-radius: 16px;
    padding: 48px 32px;
}

.tejs-consultation-cta h2 {
    color: var(--te-text-primary, #1e293b);
}

.tejs-consultation-cta p {
    color: var(--te-text-muted, #64748b);
    max-width: 560px;
    margin: 0 auto 24px;
}

.tejs-cta-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.tejs-inline-lead-form {
    max-width: 480px;
    margin: 0 auto;
}

.tejs-inline-lead-row {
    display: flex;
    gap: 8px;
}

.tejs-inline-lead-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--te-bg-raised, #fff);
    transition: border-color 0.2s;
}

.tejs-inline-lead-input:focus {
    outline: none;
    border-color: var(--te-accent, #0a66c2);
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.tejs-inline-lead-row .tejs-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.tejs-inline-lead-msg {
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
}

.tejs-inline-lead-msg.tejs-msg-success {
    color: var(--te-success, #16a34a);
}

.tejs-inline-lead-msg.tejs-msg-error {
    color: var(--te-error, #dc2626);
}

/* ─── Post-Payment Success Banner ───────────────────── */
.tejs-payment-success-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--te-success, #16a34a);
    color: var(--te-bg-raised, #fff);
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    transform: translateY(-100%);
    transition: transform 0.35s ease;
    box-shadow: 0 2px 12px rgba(22,163,74,0.3);
}
.tejs-payment-success-banner.tejs-banner-visible {
    transform: translateY(0);
}
.tejs-payment-success-banner svg {
    flex-shrink: 0;
}

/* ─── Currency Toggle ───────────────────────────────── */
.tejs-currency-toggle {
    display: inline-flex;
    align-items: center;
    background: var(--te-bg-section-alt, #f1f5f9);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 24px;
}

.tejs-currency-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--te-text-muted, #64748b);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.tejs-currency-btn.active {
    background: var(--te-bg-raised, #fff);
    color: var(--te-accent, #0a66c2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tejs-currency-btn:hover:not(.active) {
    color: var(--te-text-body, #334155);
}

/* ─── Dual Price Display ────────────────────────────── */
.tejs-price-primary,
.tejs-price-secondary {
    transition: all 0.25s ease;
}

.tejs-price-secondary {
    font-size: 0.8rem;
    color: var(--te-text-subtle, #94a3b8);
    margin-top: -2px;
}

.tejs-price-primary .tejs-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--te-text-heading, #0f172a);
}

.tejs-pricing-card--compact .tejs-price-primary .tejs-price {
    font-size: 1.25rem;
}

.tejs-per-credit-label {
    font-size: 0.75rem;
    color: var(--te-text-muted, #64748b);
    margin-top: 2px;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .tejs-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .tejs-score-header {
        flex-direction: column;
        text-align: center;
    }

    .tejs-dashboard-container {
        grid-template-columns: 1fr;
    }

    .tejs-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s;
    }

    .tejs-sidebar.open {
        left: 0;
    }

    .tejs-main-content {
        padding: 20px 16px;
    }

    .tejs-hero h1 {
        font-size: 1.5rem;
    }

    .tejs-inline-lead-row {
        flex-direction: column;
    }

    .tejs-consultation-cta {
        padding: 32px 20px;
    }

    .tejs-tool-grid {
        grid-template-columns: 1fr;
    }

    .tejs-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tejs-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tejs-pricing-grid {
        grid-template-columns: 1fr;
    }

    .tejs-stat-grid {
        grid-template-columns: 1fr;
    }

    .tejs-login-card,
    .tejs-onboarding-card {
        padding: 28px 20px;
    }
}
