/* PFG v2.1 | build 2026-04-30 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { overflow-x: hidden; }

body { font-family: 'Inter', sans-serif; }

#pfg-wrap {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    overflow-x: hidden;
}

/* Header */
.pfg-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.pfg-logo-mark {
    display: inline-block;
    margin-bottom: 1rem;
}

.pfg-logo-img {
    max-width: 250px;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.pfg-company-name-title {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.pfg-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}

.pfg-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Glassmorphism sections */
.pfg-section {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pfg-section-title {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(240, 180, 41, 0.3);
}

.pfg-csf-def-icon {
    margin-left: 10px;
    background: #64748b;
}

.pfg-section-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
}

/* 2-col capture grid */
.pfg-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 580px) {
    .pfg-grid-2 { grid-template-columns: 1fr; }
}

/* Form fields */
.pfg-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pfg-field .req { color: #ef4444; }

.pfg-field input[type="text"],
.pfg-field input[type="email"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.pfg-field input:focus {
    border-color: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* CSF rows */
.pfg-csf-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pfg-csf-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(240, 180, 41, 0.15);
    transition: background 0.2s;
}

.pfg-csf-row:hover { background: rgba(255, 255, 255, 0.9); }

.pfg-csf-label-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 210px;
    flex-shrink: 0;
}

@media (max-width: 580px) {
    .pfg-csf-row { flex-wrap: wrap; }
    .pfg-csf-label-wrap { min-width: unset; width: 100%; }
}

.pfg-csf-num {
    font-size: 0.65rem;
    font-weight: 700;
    color: #F0B429;
    letter-spacing: 0.05em;
}

.pfg-csf-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a2e;
}

/* Tooltip */
.pfg-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #334155;
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    flex-shrink: 0;
    line-height: 1;
}

.pfg-tooltip-icon::after {
    content: attr(data-tip);
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 26, 46, 0.95);
    color: #fff;
    font-size: 0.73rem;
    font-weight: 400;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    width: 280px;
    white-space: pre-line;
    text-align: left;
    line-height: 1.5;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.pfg-tooltip-icon:hover::after { opacity: 1; }

/* Sliders */
.pfg-csf-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.pfg-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #E0FFFF;
    outline: none;
    cursor: pointer;
}

.pfg-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F0B429, #22C55E);
    cursor: pointer;
    transition: transform 0.1s;
}

.pfg-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.pfg-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F0B429, #22C55E);
    cursor: pointer;
    border: none;
}

.pfg-slider-val {
    font-size: 1rem;
    font-weight: 700;
    color: #94a3b8;
    min-width: 24px;
    text-align: center;
}

/* Live total */
.pfg-live-score-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(240, 180, 41, 0.4);
}

.pfg-live-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.pfg-live-total {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
    min-width: 48px;
    text-align: right;
}

.pfg-live-max {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Error */
.pfg-error {
    background: #fef2f2;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1rem;
    display: block;
}

/* Primary button */
.pfg-btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #F0B429, #22C55E);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.pfg-btn-primary:hover  { opacity: 0.9; transform: translateY(-1px); }
.pfg-btn-primary:active { transform: translateY(0); }
.pfg-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Results */
.pfg-results-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
}

.pfg-score-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 2rem 3rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}

.pfg-score-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-bottom: 1rem;
}

.pfg-score-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.25rem;
}

.pfg-score-circle span {
    font-size: 4.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #F0B429, #22C55E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.pfg-score-circle small {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.pfg-tier-badge {
    display: inline-block;
    padding: 0.4rem 1.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #F0B429, #22C55E);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.pfg-chart-wrap {
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.pfg-btn-secondary {
    display: block;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    background: transparent;
    border: 2px solid rgba(240, 180, 41, 0.5);
    border-radius: 14px;
    color: #1a1a2e;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.pfg-btn-secondary:hover {
    background: rgba(240, 180, 41, 0.1);
    border-color: #F0B429;
}

.pfg-login-notice {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    color: #64748b;
}

/* Optional field label */
.pfg-optional {
    font-size: 0.7rem;
    font-weight: 400;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}

/* Interpretation text */
.pfg-interpretation-text {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    text-align: left;
}

/* Results actions row */
.pfg-results-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0;
}

/* Reduced header spacing on results screen */
#pfg-results .pfg-header {
    margin-bottom: 1.5rem;
}

/* PDF export: shrink results to fit one page */
#pfg-results.pdf-export-mode {
    transform: scale(0.65);
    transform-origin: top center;
    margin: 0;
    padding: 0;
}

/* Mobile tooltip: real DOM element, click-positioned */
#pfg-mobile-tooltip {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 90vw;
    box-sizing: border-box;
    background: rgba(26, 26, 46, 0.95);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.55;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    white-space: pre-line;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .pfg-tooltip-icon:hover::after { opacity: 0; }
}

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.pfg-dash-wrap { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }

.pfg-dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 2rem;
}

.pfg-dash-select {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    color: #1a1a2e;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pfg-dash-select:focus { border-color: #22C55E; }

input[type="date"].pfg-dash-select {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
}

/* Averages layout */
.pfg-avg-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 680px) {
    .pfg-avg-layout { grid-template-columns: 1fr; }
}

.pfg-avg-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Hero total metric */
.pfg-avg-hero {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.pfg-avg-hero-num {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #F0B429, #22C55E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pfg-avg-hero-denom {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
    margin-bottom: 6px;
}

.pfg-avg-hero-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

/* Radar wrap */
.pfg-avg-radar-wrap {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1rem;
}

/* 2-col CSF cards */
.pfg-avg-csf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.pfg-avg-csf-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(240, 180, 41, 0.18);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}

.pfg-avg-csf-num {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.1;
}

.pfg-avg-csf-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
    line-height: 1.3;
}

/* Benchmarking controls */
.pfg-dash-bench-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pfg-dash-bench-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.pfg-dash-loading {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Dashboard table */
.pfg-dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 900px;
}

.pfg-dash-table th {
    position: sticky;
    top: 0;
    background: rgba(248, 250, 252, 0.95);
    padding: 10px 12px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(240, 180, 41, 0.35);
    white-space: nowrap;
}

.pfg-dash-table td {
    padding: 9px 12px;
    color: #1a1a2e;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    white-space: nowrap;
}

.pfg-dash-table tbody tr:hover td { background: rgba(255, 255, 255, 0.7); }

/* Per-row table buttons */
.pfg-pdf-row-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1.5px solid var(--pfg-accent, #F0B429);
    color: var(--pfg-accent, #F0B429);
    border-radius: 6px; padding: 3px 8px; font-size: 0.75rem;
    cursor: pointer; transition: background 0.15s, color 0.15s;
}
.pfg-pdf-row-btn:hover { background: var(--pfg-accent, #F0B429); color: #fff; }

.pfg-del-company-btn,
.pfg-del-row-btn {
    background: transparent;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px; padding: 3px 8px;
    font-size: 0.75rem; font-weight: 700;
    color: #64748b; cursor: pointer; line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pfg-del-company-btn:hover,
.pfg-del-row-btn:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* Company quick-link buttons (Companies table) */
.pfg-co-link-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 12px; border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.03em; text-decoration: none; white-space: nowrap;
    transition: opacity 0.15s, transform 0.1s; cursor: pointer;
}
.pfg-co-link-btn:hover { opacity: 0.85; transform: translateY(-1px); text-decoration: none; }

.pfg-co-link-assess { background: linear-gradient(135deg, #F0B429, #22C55E); color: #fff; }
.pfg-co-link-assess:hover,
.pfg-co-link-assess:focus { opacity: 0.85; transform: translateY(-1px); color: #fff !important; text-decoration: none; }

.pfg-co-link-dash { background: transparent; border: 1.5px solid #22C55E; color: #16a34a; }
.pfg-co-link-dash:hover,
.pfg-co-link-dash:focus { background: rgba(34,197,94,0.08); color: #16a34a !important; text-decoration: none; }

.pfg-co-link-admin { background: transparent; border: 1.5px solid #F0B429; color: #b45309; }
.pfg-co-link-admin:hover,
.pfg-co-link-admin:focus { background: rgba(240,180,41,0.08); color: #b45309 !important; text-decoration: none; }

/* Dashboard Toolbar Fix */
.pfg-dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

/* Error Message */
.pfg-error {
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 500;
}

/* PDF Export Scale Fix */
.pdf-export-mode {
    transform: scale(0.60);
    transform-origin: top center;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
}

