/* ═══════════════════════════════════════════
   Affiliate Tools - Global Styles
   Two-column layout: tool + sticky sidebar
   ═══════════════════════════════════════════ */

:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-accent: #a855f7;
    --color-good: #22c55e;
    --color-good-bg: #f0fdf4;
    --color-medium: #eab308;
    --color-medium-bg: #fefce8;
    --color-risk: #ef4444;
    --color-risk-bg: #fef2f2;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Page Wrapper ────────────────────────── */
.page-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ── Site Navigation ──────────────────────── */
.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.site-brand {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-dropdown-trigger:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.nav-arrow {
    font-size: 10px;
    color: var(--color-text-muted);
    transition: transform 0.2s;
}

.nav-dropdown:hover .nav-arrow,
.nav-dropdown:focus-within .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 280px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.15s;
}

.nav-dropdown-item:hover {
    background: var(--color-bg);
}

.nav-dropdown-item.active {
    background: var(--color-primary-light);
}

.nav-dropdown-item .nav-item-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.nav-dropdown-item strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.nav-dropdown-item span {
    font-size: 11px;
    color: var(--color-text-muted);
}

.nav-dropdown-item.active strong {
    color: var(--color-primary);
}

/* Recommendations nav link */
.nav-recs-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius);
    background: rgba(168, 85, 247, 0.05);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-recs-link:hover {
    background: rgba(168, 85, 247, 0.12);
    border-color: var(--color-accent);
}

.nav-recs-link.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.nav-recs-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f97316;
    flex-shrink: 0;
    animation: dotBlink 2s ease-in-out infinite;
}

.nav-recs-link.active .nav-recs-dot {
    background: #fff;
    animation: none;
}

@keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Two-Column Layout ───────────────────── */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}

/* ── Tool Main ───────────────────────────── */
.tool-main {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    min-width: 0;
}

.tool-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.tool-desc {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ── Sidebar (Sticky, desktop only) ──────── */
.sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-inner {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    padding: 20px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.sidebar-accent {
    width: 4px;
    height: 28px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
    flex-shrink: 0;
}

.sidebar-title strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.sidebar-title span {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* ── Sidebar Cards ───────────────────────── */
.sidebar-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-card {
    display: block;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.25s ease;
}

.sidebar-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.card-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.card-logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    object-fit: cover;
}

.card-logo-fallback {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--color-bg);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.card-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-top: 4px;
}

.card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding: 8px 0;
    border-radius: var(--radius);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.sidebar-card:hover .card-cta {
    background: var(--color-primary);
    color: #fff;
}

.sidebar-disclaimer {
    text-align: center;
    font-size: 10px;
    color: var(--color-text-muted);
    margin-top: 14px;
    opacity: 0.6;
}

/* Sidebar highlight on risky score */
.sidebar-highlight-risk .sidebar-inner {
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), var(--shadow-md);
    animation: pulseRisk 2s ease-in-out 1;
}

.sidebar-highlight-warn .sidebar-inner {
    border-color: #fde68a;
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.1), var(--shadow-md);
}

@keyframes pulseRisk {
    0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), var(--shadow-md); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.15), var(--shadow-lg); }
}

/* ── Upload Zone ─────────────────────────── */
.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--color-bg);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--color-primary);
    background: #eff6ff;
}

.upload-zone .upload-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.upload-zone .upload-text {
    font-size: 15px;
    color: var(--color-text-secondary);
}

.upload-zone .upload-text strong {
    color: var(--color-primary);
}

.upload-zone .upload-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 8px;
}

.upload-zone input[type="file"] {
    display: none;
}

/* ── Progress Bar ────────────────────────── */
.progress-wrap {
    display: none;
    margin-top: 20px;
}

.progress-wrap.active {
    display: block;
}

.progress-bar-bg {
    background: var(--color-bg);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    background: var(--color-primary);
    height: 100%;
    width: 0%;
    border-radius: 20px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 6px;
}

/* ── Result Panel ────────────────────────── */
.result-panel {
    display: none;
    margin-top: 24px;
}

.result-panel.active {
    display: block;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

.result-header .check-icon {
    color: var(--color-good);
    font-size: 20px;
}

.md5-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.md5-card {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--color-border);
}

.md5-card .label {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.md5-card .hash {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: var(--color-text);
    word-break: break-all;
}

.md5-card.changed .hash {
    color: var(--color-good);
}

.exif-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--color-good-bg);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    color: #15803d;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-download {
    background: var(--color-good);
    color: #fff;
}

.btn-download:hover {
    background: #16a34a;
}

.btn-reset {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    margin-left: 8px;
}

.btn-reset:hover {
    background: var(--color-border);
}

/* ── IP Checker ──────────────────────────── */
.loading-wrap {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Score Gauge */
.score-section {
    text-align: center;
    margin-bottom: 24px;
}

.score-ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
}

.score-ring svg {
    transform: rotate(-90deg);
}

.score-ring .ring-bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 10;
}

.score-ring .ring-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease, stroke 0.3s;
}

.score-ring .score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 800;
}

.score-tier {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.score-tier-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Deductions list */
.deductions {
    margin-bottom: 24px;
}

.deductions-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text-secondary);
}

.deduction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 6px;
    font-size: 13px;
}

.deduction-item.risk {
    background: var(--color-risk-bg);
    color: #991b1b;
}

.deduction-item.safe {
    background: var(--color-good-bg);
    color: #15803d;
}

.deduction-points {
    font-weight: 700;
    white-space: nowrap;
    margin-left: 12px;
}

.no-deductions {
    padding: 12px;
    background: var(--color-good-bg);
    border-radius: var(--radius);
    color: #15803d;
    font-size: 14px;
    text-align: center;
}

/* IP Details Card */
.ip-details {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--color-border);
}

.ip-details-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.ip-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
}

.ip-detail-row:last-child {
    border-bottom: none;
}

.ip-detail-label {
    color: var(--color-text-secondary);
}

.ip-detail-value {
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

/* ── Smart Tip (score < 70) ───────────────── */
.smart-tip {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
    border: 1px solid #fca5a5;
    border-left: 4px solid var(--color-risk);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    animation: fadeSlideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.smart-tip-icon {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}

.smart-tip-body strong {
    display: block;
    font-size: 14px;
    color: #991b1b;
    margin-bottom: 6px;
}

.smart-tip-body p {
    font-size: 13px;
    color: #7c2d12;
    line-height: 1.7;
}

.smart-tip-body a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed var(--color-primary);
    transition: all 0.2s;
}

.smart-tip-body a:hover {
    color: var(--color-primary-hover);
    border-bottom-style: solid;
}

/* Smart tip - success variant (post-download) */
.smart-tip-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    border-color: #86efac;
    border-left-color: var(--color-good);
    position: relative;
}

.smart-tip-success .smart-tip-body strong {
    color: #166534;
}

.smart-tip-success .smart-tip-body p {
    color: #15803d;
}

.smart-tip-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.2s;
}

.smart-tip-close:hover {
    color: var(--color-text);
}

/* ── Post-Download Modal ─────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    animation: modalSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 10px;
}

.modal-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 22px;
}

.modal-desc strong {
    color: var(--color-risk);
    font-weight: 700;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    text-align: left;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.modal-btn-ads {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.modal-btn-ads:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.modal-btn-ip {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.modal-btn-ip:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
}

.modal-btn-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.modal-btn-sub {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}

.modal-footer {
    margin-top: 16px;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ── Error ────────────────────────────────── */
.error-msg {
    display: none;
    padding: 12px 16px;
    background: var(--color-risk-bg);
    color: #991b1b;
    border-radius: var(--radius);
    font-size: 13px;
    margin-top: 16px;
}

.error-msg.active {
    display: block;
}

/* ══ Responsive ══════════════════════════════ */

/* Tablet: sidebar below main */
@media (max-width: 900px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .page-wrap {
        max-width: 720px;
    }
}

/* Mobile: hide sidebar entirely */
@media (max-width: 640px) {
    .sidebar {
        display: none;
    }

    .page-wrap {
        padding: 12px 10px;
    }

    .tool-main {
        padding: 20px 16px;
    }

    .md5-compare {
        grid-template-columns: 1fr;
    }

    .score-ring {
        width: 130px;
        height: 130px;
    }

    .score-ring .score-value {
        font-size: 28px;
    }

    .site-nav {
        gap: 10px;
    }

    .nav-dropdown-menu {
        min-width: 240px;
    }
}

/* ── Risk Fix Plan (score < 80) ──────────── */
.risk-fix-plan {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 50%, #fffbeb 100%);
    border: 1px solid #fca5a5;
    border-radius: var(--radius-xl);
    animation: fadeSlideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.rfp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.rfp-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.rfp-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #991b1b;
}

.rfp-subtitle {
    display: block;
    font-size: 12px;
    color: #b45309;
    margin-top: 2px;
}

.rfp-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rfp-card {
    display: block;
    position: relative;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.25s ease;
    overflow: hidden;
}

.rfp-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.rfp-card-badge {
    position: absolute;
    top: 0;
    right: 0;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: var(--color-risk);
    border-radius: 0 var(--radius-lg) 0 var(--radius);
}

.rfp-card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rfp-card-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.rfp-icon-ip {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.rfp-icon-ads {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.rfp-card-info {
    flex: 1;
    min-width: 0;
}

.rfp-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.rfp-card-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.rfp-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 12px;
    padding: 10px 0;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    transition: all 0.25s ease;
}

.rfp-cta-ip {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.rfp-card-ip:hover .rfp-cta-ip {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
}

.rfp-cta-ads {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.rfp-card-ads:hover .rfp-cta-ads {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.rfp-footer {
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
    font-weight: 600;
    color: #b45309;
}

/* Social proof line under CTA */
.rfp-card-proof {
    text-align: center;
    font-size: 11px;
    color: #15803d;
    margin-top: 8px;
    line-height: 1.4;
}

/* ── Critical state: score < 60 ──────────── */
.risk-fix-plan-critical {
    border-color: #f87171;
    background: linear-gradient(135deg, #fef2f2 0%, #fef2f2 50%, #fff1f2 100%);
    animation: rfpPulse 2.5s ease-in-out infinite;
}

@keyframes rfpPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
        border-color: #f87171;
    }
    50% {
        box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.12);
        border-color: #f97316;
    }
}

.risk-fix-plan-critical .rfp-cta-ip {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.risk-fix-plan-critical .rfp-card-ip:hover .rfp-cta-ip {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

.risk-fix-plan-critical .rfp-cta-ads {
    background: linear-gradient(135deg, #f97316, #dc2626);
}

.risk-fix-plan-critical .rfp-card-ads:hover .rfp-cta-ads {
    background: linear-gradient(135deg, #ea580c, #b91c1c);
}

.risk-fix-plan-critical .rfp-card-badge {
    background: #f97316;
}

/* ── FAQ Section ─────────────────────────── */
.faq-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.faq-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-text);
}

.faq-item {
    margin-bottom: 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    overflow: hidden;
}

.faq-item[open] {
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.faq-question {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--color-text);
    transition: background 0.2s;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
    content: '\2212';
}

.faq-question:hover {
    background: var(--color-bg);
}

.faq-answer {
    padding: 0 16px 14px;
}

.faq-answer p {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

/* Responsive additions for risk-fix-plan */
@media (max-width: 640px) {
    .risk-fix-plan {
        padding: 14px;
    }

    .rfp-card {
        padding: 12px;
    }

    .rfp-card-icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* ══ Recommendations Page ════════════════════ */

.rec-page {
    max-width: 100%;
}

.rec-hero {
    text-align: center;
    margin-bottom: 32px;
}

.rec-hero-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 8px;
}

.rec-hero-desc {
    font-size: 14px;
    color: var(--color-text-secondary);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Category sections */
.rec-category {
    margin-bottom: 32px;
}

.rec-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border);
}

.rec-cat-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.rec-cat-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 2px;
}

.rec-cat-desc {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Cards container */
.rec-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rec-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Individual card */
.rec-card {
    position: relative;
    display: block;
    padding: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.25s ease;
    overflow: hidden;
}

.rec-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.25);
}

.rec-card-featured {
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--shadow);
}

.rec-card-self {
    border-color: rgba(34, 197, 94, 0.25);
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 30%);
}

/* Ribbon */
.rec-card-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    padding: 3px 12px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), #7c3aed);
    border-radius: 0 var(--radius-lg) 0 var(--radius);
}

/* Card header */
.rec-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.rec-card-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.rec-logo-ads { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.rec-logo-ip  { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.rec-logo-sp  { background: linear-gradient(135deg, #0d9488, #0f766e); }
.rec-logo-pay { background: linear-gradient(135deg, #f59e0b, #d97706); }
.rec-logo-mu  { background: linear-gradient(135deg, var(--color-primary), var(--color-accent)); }

.rec-card-name {
    font-size: 16px;
    font-weight: 700;
}

.rec-card-tagline {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 1px;
}

/* Features list */
.rec-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
}

.rec-card-features li {
    position: relative;
    padding: 4px 0 4px 20px;
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.rec-card-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--color-good);
    font-weight: 700;
    font-size: 13px;
}

/* CTA button */
.rec-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 0;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    transition: all 0.2s ease;
}

.rec-cta-blue   { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.rec-cta-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.rec-cta-teal   { background: linear-gradient(135deg, #0d9488, #0f766e); }
.rec-cta-amber  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.rec-cta-green  { background: linear-gradient(135deg, #22c55e, #16a34a); }

.rec-card:hover .rec-card-cta {
    filter: brightness(1.1);
}

/* Social proof */
.rec-card-proof {
    text-align: center;
    font-size: 11px;
    color: #15803d;
    margin-top: 8px;
}

/* Bottom note */
.rec-bottom-note {
    margin-top: 8px;
    padding: 16px 20px;
    background: var(--color-primary-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-lg);
    text-align: center;
}

.rec-bottom-note p {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.rec-bottom-note strong {
    color: var(--color-primary);
}

/* Responsive for recommendations */
@media (max-width: 900px) {
    .rec-cards-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .rec-hero-title {
        font-size: 20px;
    }

    .rec-card {
        padding: 16px;
    }

    .rec-card-logo {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
}

/* ══ Trust Counter ═══════════════════════════ */
.trust-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 10px 16px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: var(--radius-lg);
    font-size: 13px;
    color: var(--color-text-secondary);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.trust-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: trustPulse 2s ease-in-out infinite;
}

.trust-dot-green {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.trust-dot-blue {
    background: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

@keyframes trustPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}

.trust-item strong {
    font-weight: 700;
    color: var(--color-text);
}

/* ══ Site Footer ════════════════════════════ */
.site-footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--color-border);
    background: #f1f5f9;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-left {
    font-size: 12px;
    color: var(--color-text-muted);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.footer-right a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: var(--color-primary);
}

.footer-sep {
    color: var(--color-text-muted);
}

/* ══ Floating Action Button (Contact) ═══════ */
.fab-contact {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.fab-contact:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.fab-contact svg {
    width: 22px;
    height: 22px;
}

/* ══ Legal Pages (Privacy / ToS) ═══════════ */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 24px;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.legal-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 4px;
}

.legal-updated {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
}

.legal-section {
    margin-bottom: 24px;
}

.legal-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 10px;
}

.legal-section p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 8px;
}

.legal-section ul {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
}

.legal-section ul li {
    position: relative;
    padding: 4px 0 4px 20px;
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.legal-section ul li::before {
    content: '\2022';
    position: absolute;
    left: 4px;
    color: var(--color-primary);
    font-weight: 700;
}

.legal-section a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.legal-section a:hover {
    text-decoration: underline;
}

/* ── Responsive: Trust Counter ──────────── */
@media (max-width: 640px) {
    .trust-counter {
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
        padding: 8px 12px;
    }

    .fab-contact {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }

    .fab-contact svg {
        width: 20px;
        height: 20px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .legal-page {
        padding: 20px 16px;
    }

    .legal-title {
        font-size: 20px;
    }
}

/* ══ SEO Deep Content Block ═════════════════ */
.seo-content {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border);
}

.seo-content-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
    line-height: 1.5;
}

.seo-content-body p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.9;
    margin-bottom: 14px;
}

.seo-content-body p:last-child {
    margin-bottom: 0;
}

.seo-content-body strong {
    color: var(--color-text);
    font-weight: 600;
}

.seo-content-body code {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    background: var(--color-bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

@media (max-width: 640px) {
    .seo-content-title {
        font-size: 16px;
    }

    .seo-content-body p {
        font-size: 13px;
    }
}

/* ══ Add to Home Screen Banner ══════════════ */
.a2hs-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-size: 13px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    max-width: calc(100vw - 32px);
}

.a2hs-banner.a2hs-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.a2hs-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.a2hs-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.a2hs-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    margin-left: 2px;
    cursor: pointer;
}

.a2hs-link:hover {
    text-decoration: underline;
}

.a2hs-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.a2hs-close:hover {
    color: var(--color-text);
}

@media (max-width: 640px) {
    .a2hs-banner {
        bottom: 68px;
        font-size: 12px;
        padding: 8px 12px;
        white-space: normal;
    }
}
