/* --------------------------------
   SITEAUDIT PRO — Frontend Styles
  -------------------------------- */

/* CSS Variables from WP settings */
:root {
  --sap-brand: #00D4AA;
  --sap-dark:  #1A1A2E;
  --sap-bg:    #F5F4F0;
  --sap-white: #FFFFFF;
  --sap-text:  #1A1A2E;
  --sap-muted: rgba(26,26,46,0.5);
  --sap-border:rgba(26,26,46,0.08);
  --sap-radius:1rem;
}

/* Base */
.sap-embed { font-family: Roboto,sans-serif; color: var(--sap-text); }
.sap-embed *, .sap-embed *::before, .sap-embed *::after { box-sizing: border-box; }

/* Hero */
.sap-hero { text-align: center; padding: 48px 24px 32px; }
.sap-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,212,170,0.12); border: 1px solid rgba(0,212,170,0.3); border-radius: 99px; padding: 6px 16px; font-size: 13px; font-weight: 500; color: #007A60; margin-bottom: 20px; }
.sap-pulse { width: 8px; height: 8px; background: var(--sap-brand); border-radius: 50%; display: inline-block; animation: sapPulse 1.5s ease-in-out infinite; }
@keyframes sapPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }
.sap-h2 { font-family: Roboto,sans-serif; font-size: clamp(1.8rem,5vw,3.5rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 16px; }
.sap-subtitle { color: var(--sap-muted); font-size: 1.05rem; max-width: 520px; margin: 0 auto; line-height: 1.65; font-weight: 300; }

/* Form wrap */
.sap-form-wrap { max-width: 680px; margin: 0 auto; padding: 0 16px 16px; }
.sap-card { background: var(--sap-white); border-radius: 24px; padding: 36px; box-shadow: 0 4px 40px rgba(26,26,46,0.09), 0 1px 4px rgba(26,26,46,0.04); border: 1px solid rgba(26,26,46,0.06); }
.sap-field { margin-bottom: 18px; }
.sap-label { display: block; font-size: 0.8125rem; font-weight: 500; color: rgba(26,26,46,0.65); margin-bottom: 7px; letter-spacing: 0.01em; }
.sap-req { color: #EF4444; }
.sap-opt { font-size: 11px; font-weight: 400; color: rgba(26,26,46,0.35); }
.sap-input-icon-wrap { position: relative; }
.sap-input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: rgba(26,26,46,0.3); pointer-events: none; }
.sap-input { width: 100%; padding: 0.75rem 1rem!important; background: #F5F4F0; border: 1.5px solid rgba(26,26,46,0.1); border-radius: 0.875rem; font-size: 0.9375rem; color: var(--sap-text); font-family: Roboto,sans-serif; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; outline: none; }
.sap-input::placeholder { color: rgba(26,26,46,0.3); }
.sap-input:focus { border-color: var(--sap-brand); background: #fff; box-shadow: 0 0 0 4px rgba(0,212,170,0.12); }
.sap-input.sap-error { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
.sap-input-pl { padding-left: 44px; }
.sap-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .sap-grid-2 { grid-template-columns: 1fr; } }
.sap-btn-submit { width: 100%; background: linear-gradient(135deg, #00cc79 0%, #00B894 100%); color: #fff; font-family: Roboto,sans-serif; font-weight: 700; font-size: 1.0625rem; padding: 1rem 2rem; border-radius: 1rem; border: none; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s; box-shadow: 0 4px 20px rgba(0,212,170,0.35); letter-spacing: -0.01em; display: flex; align-items: center; justify-content: center; gap: 10px; }
.sap-btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,212,170,0.45); }
.sap-btn-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.sap-trust { text-align: center; font-size: 12px; color: rgba(26,26,46,0.4); margin: 12px 0 0; }
.sap-trust-row { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-top: 16px; padding-bottom: 8px; font-size: 13px; color: rgba(26,26,46,0.5); }
.sap-trust-row span::before { content: '✓ '; color: var(--sap-brand); }

/* Scanning overlay */
#sapScanOverlay { position: fixed; inset: 0; background: rgba(245,244,240,0.94); backdrop-filter: blur(10px); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.sap-scan-box { max-width: 420px; width: 90%; text-align: center; }
.sap-scan-icon { width: 68px; height: 68px; background: var(--sap-dark); border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.sap-scan-spin { animation: sapSpin 1s linear infinite; }
@keyframes sapSpin { to { transform: rotate(360deg); } }
.sap-scan-steps { background: #fff; border-radius: 16px; padding: 20px 24px; text-align: left; box-shadow: 0 4px 24px rgba(26,26,46,0.08); margin-top: 24px; }
.sap-scan-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; color: rgba(26,26,46,0.45); transition: color 0.3s; }
.sap-scan-step.active { color: var(--sap-text); font-weight: 500; }
.sap-scan-step.done { color: #059669; }
.sap-scan-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(26,26,46,0.15); flex-shrink: 0; transition: background 0.3s; }
.sap-scan-step.active .sap-scan-dot { background: var(--sap-brand); animation: sapPulse 1s infinite; }
.sap-scan-step.done .sap-scan-dot { background: #059669; animation: none; }

/* Results section */
#sapResults { max-width: 960px; margin: 0 auto; padding: 0 16px 60px; animation: sapFadeUp 0.5s ease forwards; }
@keyframes sapFadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.sap-results-header { text-align: center; padding: 40px 0 32px; }
.sap-results-header h2 { font-family: Roboto,sans-serif; font-size: clamp(1.8rem,4vw,2.8rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; }
.sap-results-url { color: var(--sap-muted); font-size: 1rem; }

/* Score grid */
.sap-score-grid { display: grid; grid-template-columns: 220px 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 700px) { .sap-score-grid { grid-template-columns: 1fr; } }
.sap-overall-card { background: #fff; border-radius: 24px; padding: 32px 24px; text-align: center; box-shadow: 0 4px 32px rgba(26,26,46,0.08); border: 1px solid rgba(26,26,46,0.06); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sap-ring-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--sap-muted); margin-bottom: 20px; }
.sap-ring-wrap { position: relative; margin-bottom: 20px; }
.sap-ring { transform: rotate(-90deg); }
.sap-ring-bg { fill: none; stroke: #E5E3DC; stroke-width: 10; }
.sap-ring-fill { fill: none; stroke: var(--sap-brand); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1), stroke 0.5s; }
.sap-ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sap-ring-score { font-family: Roboto,sans-serif; font-size: 2.5rem; font-weight: 800; line-height: 1; }
.sap-ring-denom { font-size: 11px; color: var(--sap-muted); margin-top: 2px; }
.sap-grade-badge { padding: 4px 16px; border-radius: 99px; font-family: Roboto,sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.grade-a { background: #D1FAE5; color: #065F46; }
.grade-b { background: #DBEAFE; color: #1E3A8A; }
.grade-c { background: #FEF3C7; color: #92400E; }
.grade-d { background: #FEE2E2; color: #991B1B; }
.sap-grade-label { color: var(--sap-muted); font-size: 13px; margin-top: 8px; }

/* Category cards */
.sap-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 480px) { .sap-cat-grid { grid-template-columns: 1fr; } }
.sap-cat-card { background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 2px 16px rgba(26,26,46,0.06); border: 1px solid rgba(26,26,46,0.06); transition: transform 0.2s, box-shadow 0.2s; }
.sap-cat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(26,26,46,0.1); }
.sap-cat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sap-cat-label { display: flex; align-items: center; gap: 8px; }
.sap-cat-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.sap-cat-name { font-family: Roboto,sans-serif; font-weight: 700; font-size: 13px; }
.sap-cat-score { font-family: Roboto,sans-serif; font-weight: 700; font-size: 1.125rem; }
.sap-bar-track { height: 5px; background: rgba(26,26,46,0.08); border-radius: 99px; overflow: hidden; }
.sap-bar-fill { height: 100%; border-radius: 99px; transition: width 1.2s cubic-bezier(0.34,1.56,0.64,1); transition-delay: 0.4s; }

/* Detail panels */
.sap-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 700px) { .sap-detail-grid { grid-template-columns: 1fr; } }
.sap-panel { background: #fff; border-radius: 24px; padding: 28px; box-shadow: 0 4px 32px rgba(26,26,46,0.07); border: 1px solid rgba(26,26,46,0.06); }
.sap-panel-title { font-family: Roboto,sans-serif; font-weight: 700; font-size: 1.1rem; margin-bottom: 20px; }
.sap-panel-subtitle { color: var(--sap-muted); font-size: 13px; margin-top: -14px; margin-bottom: 20px; }

/* Check items */
.sap-check-cat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(26,26,46,0.3); padding: 12px 10px 4px; }
.sap-check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 13px; transition: background 0.15s; cursor: default; }
.sap-check:hover { background: rgba(26,26,46,0.025); }
.sap-check-dot { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; flex-shrink: 0; margin-top: 1px; font-weight: 700; }
.pass .sap-check-dot { background: #D1FAE5; color: #059669; }
.warn .sap-check-dot { background: #FEF3C7; color: #D97706; }
.fail .sap-check-dot { background: #FEE2E2; color: #DC2626; }

.sap-check-label { font-weight: 500; color: var(--sap-text); }
.fail .sap-check-label { color: #991B1B; }
.warn .sap-check-label { color: #92400E; }
.sap-check-note { font-size: 12px; color: rgba(26,26,46,0.4); margin-top: 2px; }

/* Recommendations */
.sap-rec { display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: #F5F4F0; border-radius: 12px; font-size: 13px; margin-bottom: 10px; }
.sap-rec-num { width: 22px; height: 22px; background: var(--sap-dark); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-family: Roboto,sans-serif; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.sap-rec-label { font-weight: 600; color: var(--sap-text); margin-bottom: 3px; }
.sap-rec-note { font-size: 12px; color: var(--sap-muted); margin-bottom: 5px; }
.sap-priority { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.p-high { background: #FEE2E2; color: #DC2626; }
.p-medium { background: #FEF3C7; color: #D97706; }
.p-low { background: #D1FAE5; color: #059669; }

/* Action buttons */
.sap-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 32px; }
.sap-btn-dl { background: var(--sap-dark); color: #fff; padding: 13px 28px; border-radius: 14px; font-family: Roboto,sans-serif; font-weight: 700; font-size: 15px; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.2s, background 0.2s; text-decoration: none; }
.sap-btn-dl:hover { transform: translateY(-2px); background: #2D2D4A; }
.sap-btn-again { background: transparent; color: var(--sap-text); border: 1.5px solid rgba(26,26,46,0.2); padding: 13px 28px; border-radius: 14px; font-family: Roboto,sans-serif; font-weight: 600; font-size: 15px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: border-color 0.2s, transform 0.2s; }
.sap-btn-again:hover { border-color: var(--sap-text); transform: translateY(-1px); }

/* CTA card */
.sap-cta-card { background: linear-gradient(135deg, var(--sap-dark) 0%, #2D2D4A 60%, var(--sap-dark) 100%); border-radius: 28px; padding: 48px 36px; text-align: center; position: relative; overflow: hidden; margin-bottom: 48px; }
.sap-cta-card::before { content: ''; position: absolute; top: -30%; right: -5%; width: 380px; height: 380px; background: radial-gradient(circle, rgba(0,212,170,0.18) 0%, transparent 65%); pointer-events: none; }
.sap-cta-card h3 { font-family: Roboto,sans-serif; font-size: clamp(1.3rem,3vw,2rem); font-weight: 800; color: #fff; margin: 0 0 12px; }
.sap-cta-card p { color: rgba(255,255,255,0.65); margin: 0 0 28px; max-width: 440px; margin-left: auto; margin-right: auto; line-height: 1.65; }
.sap-cta-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.sap-cta-primary { background: var(--sap-brand); color: #fff; padding: 13px 26px; border-radius: 12px; font-family: Roboto,sans-serif; font-weight: 700; font-size: 14px; text-decoration: none; display: inline-block; transition: transform 0.2s, box-shadow 0.2s; }
.sap-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,212,170,0.4); color: #fff; }
.sap-cta-ghost { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); border: 1.5px solid rgba(255,255,255,0.25); padding: 13px 26px; border-radius: 12px; font-family: Roboto,sans-serif; font-weight: 600; font-size: 14px; text-decoration: none; display: inline-block; transition: background 0.2s, border-color 0.2s, transform 0.2s; }
.sap-cta-ghost:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.5); transform: translateY(-1px); color: #fff; }

/* Toast */
.sap-toast { position: fixed; bottom: 24px; right: 24px; z-index: 99999; animation: sapToastIn 0.35s cubic-bezier(0.34,1.56,0.64,1); }
.sap-toast-inner { background: var(--sap-dark); color: #fff; padding: 14px 20px; border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; min-width: 260px; max-width: 380px; }
@keyframes sapToastIn { from{transform:translateY(24px) scale(0.95);opacity:0} to{transform:translateY(0) scale(1);opacity:1} }
