/**
 * Plutone GEO Suite — Frontend Styles
 * Audit form, results page, trust badges, powered-by badge
 */

/* ── Variables ── */
:root {
    --pgeo-primary: #2b5ce6;
    --pgeo-success: #28a745;
    --pgeo-warning: #f0ad4e;
    --pgeo-danger: #dc3545;
    --pgeo-text: #1a1a2e;
    --pgeo-muted: #666;
    --pgeo-bg: #f8f9fc;
    --pgeo-card-bg: #fff;
    --pgeo-radius: 12px;
}

/* ── Audit Form Wrapper ── */
.pgeo-audit-wrap {
    max-width: 680px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pgeo-step { display: none; }
.pgeo-step.active { display: block; }

.pgeo-step-header {
    text-align: center;
    margin-bottom: 32px;
}

.pgeo-step-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--pgeo-text);
    margin-bottom: 8px;
}

.pgeo-step-header p {
    color: var(--pgeo-muted);
    font-size: 16px;
}

/* ── Form Fields ── */
.pgeo-form { background: var(--pgeo-card-bg); padding: 32px; border-radius: var(--pgeo-radius); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.pgeo-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.pgeo-field { margin-bottom: 16px; }
.pgeo-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--pgeo-text); }
.pgeo-field .required { color: var(--pgeo-danger); }
.pgeo-field .optional { color: var(--pgeo-muted); font-weight: 400; font-size: 12px; }
.pgeo-field input, .pgeo-field select, .pgeo-field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 15px; transition: border-color 0.2s;
}
.pgeo-field input:focus, .pgeo-field select:focus {
    outline: none; border-color: var(--pgeo-primary); box-shadow: 0 0 0 3px rgba(43,92,230,0.1);
}

/* ── Buttons ── */
.pgeo-btn {
    display: inline-block; padding: 14px 28px; border-radius: 8px; font-size: 16px;
    font-weight: 600; cursor: pointer; transition: all 0.2s; border: 2px solid transparent;
    text-decoration: none; text-align: center;
}
.pgeo-btn-primary {
    background: var(--pgeo-primary); color: #fff; border-color: var(--pgeo-primary);
}
.pgeo-btn-primary:hover { background: #1e4ac0; border-color: #1e4ac0; }
.pgeo-btn-outline {
    background: transparent; color: var(--pgeo-primary); border-color: var(--pgeo-primary);
}
.pgeo-btn-outline:hover { background: rgba(43,92,230,0.05); }
.pgeo-btn-row { display: flex; gap: 12px; justify-content: space-between; margin-top: 8px; }

/* ── Progress ── */
.pgeo-progress { text-align: center; margin-top: 24px; }
.pgeo-spinner {
    width: 48px; height: 48px; border: 4px solid #e5e7eb; border-top-color: var(--pgeo-primary);
    border-radius: 50%; animation: pgeo-spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes pgeo-spin { to { transform: rotate(360deg); } }
.pgeo-progress-bar {
    width: 100%; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin-top: 12px;
}
.pgeo-progress-fill {
    height: 100%; background: var(--pgeo-primary); border-radius: 3px; width: 0;
    animation: pgeo-fill 12s ease-out forwards;
}
@keyframes pgeo-fill { to { width: 90%; } }

/* ── Score Circle ── */
.pgeo-score-circle {
    width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    background: linear-gradient(135deg, var(--pgeo-primary) 0%, #667eea 100%);
    color: #fff; font-size: 14px;
}
.pgeo-score-circle .pgeo-score-number,
.pgeo-score-circle #pgeo-score-value { font-size: 40px; font-weight: 700; line-height: 1; }
.pgeo-score-max { font-size: 16px; opacity: 0.8; }
.pgeo-grade-good { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
.pgeo-grade-moderate { background: linear-gradient(135deg, #f0ad4e 0%, #fd7e14 100%); }
.pgeo-grade-poor { background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%); }

/* ── Result Actions ── */
.pgeo-result-actions { text-align: center; margin: 24px 0; }
.pgeo-note { text-align: center; color: var(--pgeo-muted); font-size: 13px; }

/* ── Results Page ── */
.pgeo-results-page { max-width: 800px; }
.pgeo-results-header { text-align: center; padding: 40px 0 24px; }
.pgeo-results-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.pgeo-results-meta { color: var(--pgeo-muted); font-size: 14px; }
.pgeo-results-summary { display: flex; gap: 24px; justify-content: center; margin-top: 20px; }
.pgeo-stat { font-size: 15px; font-weight: 600; padding: 6px 16px; border-radius: 20px; }
.pgeo-stat-pass { background: #d4edda; color: #155724; }
.pgeo-stat-warn { background: #fff3cd; color: #856404; }
.pgeo-stat-fail { background: #f8d7da; color: #721c24; }

/* ── Result Categories ── */
.pgeo-result-category {
    background: var(--pgeo-card-bg); border-radius: var(--pgeo-radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06); margin-bottom: 24px; overflow: hidden;
}
.pgeo-result-category h3 {
    padding: 16px 24px; margin: 0; font-size: 18px; font-weight: 700;
    background: var(--pgeo-bg); border-bottom: 1px solid #eee;
}
.pgeo-checks-list { padding: 8px 0; }
.pgeo-check {
    display: flex; align-items: flex-start; padding: 12px 24px; gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.pgeo-check:last-child { border-bottom: none; }
.pgeo-check-icon { font-size: 18px; flex-shrink: 0; width: 28px; text-align: center; padding-top: 2px; }
.pgeo-check-pass .pgeo-check-icon { color: var(--pgeo-success); }
.pgeo-check-warn .pgeo-check-icon { color: var(--pgeo-warning); }
.pgeo-check-fail .pgeo-check-icon { color: var(--pgeo-danger); }
.pgeo-check-content strong { display: block; font-size: 14px; margin-bottom: 2px; }
.pgeo-check-content p { margin: 0; font-size: 13px; color: var(--pgeo-muted); }

/* ── Trust Badges ── */
.pgeo-trust-section { padding: 40px 0; text-align: center; }
.pgeo-trust-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.pgeo-trust-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px; max-width: 900px; margin: 0 auto;
}
.pgeo-trust-card {
    display: flex; flex-direction: column; align-items: center; padding: 20px 16px;
    background: var(--pgeo-card-bg); border: 1px solid #eee; border-radius: var(--pgeo-radius);
    text-decoration: none; color: var(--pgeo-text); transition: all 0.2s;
}
.pgeo-trust-card:hover { border-color: var(--pgeo-primary); box-shadow: 0 4px 16px rgba(43,92,230,0.1); transform: translateY(-2px); }
.pgeo-trust-icon { font-size: 28px; margin-bottom: 8px; }
.pgeo-trust-card strong { font-size: 14px; margin-bottom: 4px; }
.pgeo-trust-desc { font-size: 12px; color: var(--pgeo-muted); }

/* ── Powered by Badge ── */
.pgeo-powered-by {
    text-align: center; padding: 16px; font-size: 12px; color: #999; margin-top: 16px;
}
.pgeo-powered-by a { color: #2b5ce6; text-decoration: none; font-weight: 600; }
.pgeo-powered-by a:hover { text-decoration: underline; }
.pgeo-powered-by-small { margin-top: 8px; padding: 8px; }

/* ── Error ── */
.pgeo-error {
    text-align: center; padding: 40px; background: #f8d7da; color: #721c24;
    border-radius: var(--pgeo-radius); font-size: 16px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .pgeo-field-row { grid-template-columns: 1fr; }
    .pgeo-btn-row { flex-direction: column; }
    .pgeo-results-summary { flex-direction: column; align-items: center; gap: 8px; }
    .pgeo-trust-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
