/* ============================================
   RankinPages — Audit Styles
   ============================================ */

/* ---- Audit Landing Page ---- */
.audit-page { padding-top: 72px; }

.audit-hero {
    position: relative;
    padding: 100px 0 80px;
    overflow: hidden;
    text-align: center;
}
.audit-hero .hero-bg {
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(108,99,255,0.2) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 80% 50%, rgba(14,165,233,0.08) 0%, transparent 50%);
}
.audit-hero-inner {
    position: relative;
    max-width: 740px;
    margin: 0 auto;
}
.audit-badge {
    display: inline-block;
    background: rgba(0,200,150,0.12);
    color: #00C896;
    border: 1px solid rgba(0,200,150,0.3);
    border-radius: 50px;
    padding: 5px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 24px;
}
.audit-hero h1 { margin-bottom: 20px; }
.audit-hero > .container > .audit-hero-inner > p {
    font-size: 1.1rem;
    max-width: 540px;
    margin: 0 auto 40px;
}

/* URL Input */
.audit-url-form { margin-bottom: 32px; }
.url-input-wrap {
    display: flex;
    align-items: center;
    background: var(--dark-3);
    border: 1.5px solid var(--dark-border);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
    transition: border-color 0.2s;
}
.url-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.url-icon { color: var(--text-faint); flex-shrink: 0; }
.url-icon svg { width: 18px; height: 18px; display: block; }
.url-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 8px 0;
}
.url-input-wrap input::placeholder { color: var(--text-faint); }
.audit-submit-btn { border-radius: 50px; white-space: nowrap; flex-shrink: 0; }
.url-hint { color: var(--text-faint); font-size: 0.78rem; margin-top: 12px; }

/* Checks preview */
.audit-checks-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.check-item {
    background: var(--dark-3);
    border: 1px solid var(--dark-border);
    border-radius: 50px;
    padding: 5px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Explainer */
.audit-explainer { padding: 80px 0; background: var(--dark-2); }
.audit-explainer h2 { text-align: center; margin-bottom: 48px; font-size: 1.8rem; }
.text-center { text-align: center; }
.explainer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.explainer-card {
    background: var(--dark-3);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition);
}
.explainer-card:hover { transform: translateY(-3px); border-color: rgba(108,99,255,0.3); }
.exp-icon { font-size: 2rem; margin-bottom: 14px; }
.explainer-card h4 { color: var(--text); margin-bottom: 8px; }
.explainer-card p { font-size: 0.875rem; }

/* ============================================
   Results Page
   ============================================ */
.results-page { padding-top: 72px; }

/* Loading */
.results-loading {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-inner { text-align: center; padding: 40px 20px; }
.loading-spinner {
    width: 56px; height: 56px;
    border: 3px solid var(--dark-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 32px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-inner h2 { margin-bottom: 12px; }
.loading-inner p { margin-bottom: 40px; }
.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}
.loading-step {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-faint);
    background: var(--dark-3);
    border: 1px solid var(--dark-border);
    transition: all 0.3s;
    text-align: left;
}
.loading-step.active {
    color: var(--text);
    border-color: var(--primary);
    background: rgba(108,99,255,0.1);
}
.loading-step.active::before { content: '⟳ '; }
.loading-step.complete { color: #00C896; border-color: rgba(0,200,150,0.3); background: rgba(0,200,150,0.07); }
.loading-step.complete::before { content: '✓ '; }

/* Results header */
.results-header {
    position: relative;
    padding: 60px 0;
    overflow: hidden;
    border-bottom: 1px solid var(--dark-border);
}
.results-header .hero-bg {
    background: radial-gradient(ellipse 80% 80% at 50% -20%, rgba(108,99,255,0.15) 0%, transparent 60%);
}
.results-header-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 60px;
}

/* Score circle */
.score-block { text-align: center; flex-shrink: 0; }
.score-circle-wrap {
    position: relative;
    width: 140px; height: 140px;
    margin: 0 auto 12px;
}
.score-ring { width: 140px; height: 140px; transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--dark-4); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1.2s; }
.score-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text);
}
.score-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.score-grade { font-size: 1.1rem; font-weight: 700; margin-top: 6px; }

/* Results meta */
.results-meta h1 { font-size: clamp(1.5rem, 3vw, 2.4rem); margin-bottom: 8px; }
.audited-url {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-family: monospace;
    word-break: break-all;
}
.results-summary-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.pill {
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}
.pill-pass { background: rgba(0,200,150,0.12); color: #00C896; border: 1px solid rgba(0,200,150,0.25); }
.pill-warn { background: rgba(245,158,11,0.12); color: #F59E0B; border: 1px solid rgba(245,158,11,0.25); }
.pill-fail { background: rgba(239,68,68,0.12); color: #EF4444; border: 1px solid rgba(239,68,68,0.25); }

/* PSI scores */
.psi-row { display: flex; gap: 20px; margin-bottom: 10px; flex-wrap: wrap; }
.psi-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.psi-score {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
}
.psi-good { color: #00C896; }
.psi-ok   { color: #F59E0B; }
.psi-bad  { color: #EF4444; }
.psi-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.vitals-row { display: flex; gap: 10px; flex-wrap: wrap; }
.vital {
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--dark-3);
    border: 1px solid var(--dark-border);
}
.vital-good { color: #00C896; border-color: rgba(0,200,150,0.3); background: rgba(0,200,150,0.08); }
.vital-ok   { color: #F59E0B; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.vital-bad  { color: #EF4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }

/* Checks grid */
.checks-section { padding: 60px 0; background: var(--dark-2); }
.checks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.check-card {
    background: var(--dark-3);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    overflow: hidden;
    position: relative;
    transition: all var(--transition);
}
.check-card:hover { transform: translateY(-2px); }
.check-pass { border-left: 3px solid #00C896; }
.check-warn { border-left: 3px solid #F59E0B; }
.check-fail { border-left: 3px solid #EF4444; }
.check-icon-status {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}
.status-pass { background: rgba(0,200,150,0.15); color: #00C896; }
.status-warn { background: rgba(245,158,11,0.15); color: #F59E0B; }
.status-fail { background: rgba(239,68,68,0.15); color: #EF4444; }
.check-body { flex: 1; min-width: 0; }
.check-label { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.check-message { font-size: 0.825rem; color: var(--text-muted); line-height: 1.5; }
.check-value {
    font-size: 0.75rem;
    color: var(--text-faint);
    font-style: italic;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.check-score-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--dark-4);
}
.check-score-fill {
    height: 100%;
    border-radius: 0 2px 2px 0;
    transition: width 0.8s ease;
}

/* Lead section */
.lead-section {
    padding: 80px 0;
    background: var(--dark);
}
.lead-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}
.lead-badge {
    display: inline-block;
    background: rgba(0,200,150,0.12);
    color: #00C896;
    border: 1px solid rgba(0,200,150,0.3);
    border-radius: 50px;
    padding: 4px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}
.lead-text h2 { margin-bottom: 16px; }
.lead-text > p { margin-bottom: 28px; font-size: 1.05rem; }
.lead-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lead-points li { font-size: 0.9rem; color: var(--text-muted); }
.lead-form-wrap {
    background: var(--dark-3);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius);
    padding: 36px;
}
.lead-form { display: flex; flex-direction: column; gap: 18px; }
.form-disclaimer { font-size: 0.75rem; color: var(--text-faint); text-align: center; margin-top: 4px; }

/* Success state */
.lead-success-msg { text-align: center; padding: 20px 0; }
.lead-success-msg .success-icon {
    width: 64px; height: 64px;
    background: rgba(0,200,150,0.15);
    color: #00C896;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 auto 20px;
}
.lead-success-msg h2 { color: var(--text); margin-bottom: 8px; }

/* Error state */
.audit-error {
    text-align: center;
    padding: 80px 20px;
}
.audit-error h2 { margin-bottom: 12px; }

/* Run another */
.another-audit {
    padding: 32px 0;
    background: var(--dark-2);
    text-align: center;
    border-top: 1px solid var(--dark-border);
}
.another-audit p { font-size: 0.9rem; }
.another-audit a { color: var(--primary); text-decoration: none; font-weight: 600; }
.another-audit a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .explainer-grid { grid-template-columns: repeat(2, 1fr); }
    .checks-grid    { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .url-input-wrap { flex-direction: column; border-radius: var(--radius); padding: 16px; }
    .audit-submit-btn { width: 100%; }
    .results-header-inner { flex-direction: column; text-align: center; }
    .results-summary-pills { justify-content: center; }
    .psi-row { justify-content: center; }
    .vitals-row { justify-content: center; }
    .lead-inner { grid-template-columns: 1fr; gap: 40px; }
    .lead-form-wrap { padding: 24px 18px; }
    .explainer-grid { grid-template-columns: 1fr; }
}
