/* ============================================================
   Site Auditor Pro — Stylesheet
   Inspired by line-up.tech audit design
   ============================================================ */

:root {
    --sa-red:     #e84040;
    --sa-orange:  #f59e0b;
    --sa-green:   #22c55e;
    --sa-dark:    #111827;
    --sa-gray:    #6b7280;
    --sa-light:   #f9fafb;
    --sa-border:  #e5e7eb;
    --sa-radius:  12px;
    --sa-shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
}

/* ── Wrap ── */
.sa-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--sa-dark);
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

/* ── Hero ── */
.sa-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}
.sa-badge {
    display: inline-block;
    border: 1.5px solid var(--sa-red);
    color: var(--sa-red);
    border-radius: 999px;
    padding: .3rem 1rem;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    letter-spacing: .03em;
}
.sa-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 1rem;
}
.sa-red { color: var(--sa-red); }
.sa-subtitle {
    color: var(--sa-gray);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    font-size: 1rem;
}

/* ── Form ── */
.sa-form {}
.sa-input-wrap {
    display: flex;
    gap: .5rem;
    max-width: 600px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}
#sa-url {
    flex: 1;
    min-width: 220px;
    padding: .8rem 1.2rem;
    border: 2px solid var(--sa-border);
    border-radius: var(--sa-radius);
    font-size: 1rem;
    outline: none;
    transition: border-color .2s;
}
#sa-url:focus { border-color: var(--sa-red); }
.sa-btn-primary {
    background: var(--sa-red);
    color: #fff;
    border: none;
    border-radius: var(--sa-radius);
    padding: .8rem 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    white-space: nowrap;
}
.sa-btn-primary:hover { opacity: .88; }
.sa-btn-primary:active { transform: scale(.97); }
.sa-form-note {
    color: var(--sa-gray);
    font-size: .8rem;
    margin-top: .75rem;
}

/* ── Loader ── */
.sa-loader {
    padding: 2rem 1rem;
}
.sa-loader-card {
    background: #fff;
    border: 1.5px solid var(--sa-border);
    border-radius: 20px;
    box-shadow: var(--sa-shadow);
    padding: 2.5rem 2rem;
    max-width: 540px;
    margin: 0 auto;
    text-align: center;
}
.sa-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid var(--sa-border);
    border-top-color: var(--sa-red);
    border-radius: 50%;
    animation: sa-spin .9s linear infinite;
    margin: 0 auto 1.2rem;
}
@keyframes sa-spin { to { transform: rotate(360deg); } }
.sa-loader-title {
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0 0 .25rem;
}
.sa-loader-sub {
    color: var(--sa-gray);
    font-size: .85rem;
    margin: 0 0 1.5rem;
}
.sa-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}
.sa-step {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
    color: var(--sa-gray);
    padding: .35rem 0;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity .4s ease, transform .4s ease;
}
.sa-step.visible {
    opacity: 1;
    transform: translateX(0);
}
.sa-step::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sa-border);
    flex-shrink: 0;
    transition: background .3s;
}
.sa-step.visible::before  { background: #22c55e; }
.sa-step.active::before   { background: var(--sa-red); animation: sa-pulse .7s ease-in-out infinite alternate; }
@keyframes sa-pulse { to { transform: scale(1.3); opacity: .7; } }

/* ── Results header ── */
.sa-results-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.5rem 0 .25rem;
}
.sa-results-url {
    text-align: center;
    color: var(--sa-gray);
    font-size: .85rem;
    margin-bottom: 1.5rem;
}

/* ── Score ring ── */
.sa-score-ring-wrap {
    position: relative;
    width: 150px;
    margin: 0 auto 0.5rem;
}
.sa-ring {
    width: 150px;
    height: 150px;
    transform: rotate(-90deg);
}
.sa-ring-bg {
    fill: none;
    stroke: var(--sa-border);
    stroke-width: 8;
}
.sa-ring-fill {
    fill: none;
    stroke: var(--sa-orange);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 1s ease, stroke .4s;
}
.sa-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.sa-ring-score {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}
.sa-ring-sub {
    font-size: .85rem;
    color: var(--sa-gray);
}
.sa-score-global-label {
    text-align: center;
    color: var(--sa-gray);
    font-size: .9rem;
    margin-bottom: 2rem;
}

/* score ring colors */
.ring-green  { stroke: var(--sa-green); }
.ring-orange { stroke: var(--sa-orange); }
.ring-red    { stroke: var(--sa-red); }
.text-green  { color: var(--sa-green); }
.text-orange { color: var(--sa-orange); }
.text-red    { color: var(--sa-red); }

/* ── Category cards ── */
.sa-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.sa-card {
    background: #fff;
    border: 1.5px solid var(--sa-border);
    border-radius: var(--sa-radius);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    box-shadow: var(--sa-shadow);
}
.sa-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.icon-bg-red    { background: #fef2f2; }
.icon-bg-green  { background: #f0fdf4; }
.icon-bg-orange { background: #fffbeb; }
.sa-card-info {}
.sa-card-label { font-size: .85rem; color: var(--sa-gray); margin-bottom: .1rem; }
.sa-card-score { font-size: 1.1rem; font-weight: 800; }

/* ── Priority actions ── */
.sa-section { margin-bottom: 2rem; }
.sa-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1rem;
}
.sa-action-card {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: var(--sa-radius);
    padding: 1rem 1.2rem;
    margin-bottom: .75rem;
}
.sa-action-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .25rem;
}
.sa-action-title { font-weight: 700; font-size: .95rem; }
.sa-action-points {
    background: #fef3c7;
    color: #92400e;
    font-size: .78rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 999px;
}
.sa-action-cat { font-size: .78rem; color: var(--sa-orange); margin-bottom: .4rem; font-weight: 600; }
.sa-action-detail { font-size: .88rem; color: var(--sa-dark); line-height: 1.55; }

/* ── Detail by category (accordion) ── */
.sa-detail-item {
    background: #fff;
    border: 1.5px solid var(--sa-border);
    border-radius: var(--sa-radius);
    margin-bottom: .75rem;
    overflow: hidden;
    box-shadow: var(--sa-shadow);
}
.sa-detail-header {
    display: flex;
    align-items: center;
    padding: .9rem 1.2rem;
    cursor: pointer;
    user-select: none;
    gap: .8rem;
}
.sa-detail-header:hover { background: var(--sa-light); }
.sa-detail-cat-icon { font-size: 1.1rem; width: 32px; text-align: center; }
.sa-detail-cat-info { flex: 1; }
.sa-detail-cat-label    { font-weight: 700; font-size: .95rem; }
.sa-detail-cat-question { font-size: .78rem; color: var(--sa-gray); }
.sa-detail-cat-score { font-weight: 800; font-size: 1rem; margin-right: .4rem; }
.sa-detail-chevron { color: var(--sa-gray); font-size: .75rem; transition: transform .25s; }
.sa-detail-chevron.open { transform: rotate(180deg); }

.sa-detail-body {
    border-top: 1.5px solid var(--sa-border);
    padding: 1rem 1.2rem;
    display: none;
}
.sa-detail-body.open { display: block; }

.sa-check {
    display: flex;
    gap: .6rem;
    margin-bottom: .6rem;
    font-size: .88rem;
    line-height: 1.45;
}
.sa-check-icon { flex-shrink: 0; margin-top: .05rem; font-size: 1rem; }
.sa-check-text {}
.sa-check-label { font-weight: 600; }
.sa-check-detail { color: var(--sa-gray); }

/* ── CTA ── */
.sa-cta {
    background: var(--sa-red);
    color: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    margin-top: 2.5rem;
}
.sa-cta h3 { font-size: 1.5rem; font-weight: 800; margin: 0 0 .5rem; }
.sa-cta p  { margin: 0 0 1.5rem; opacity: .92; }
.sa-cta-btns { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.sa-btn-white {
    background: #fff;
    color: var(--sa-red);
    border: none;
    border-radius: 999px;
    padding: .75rem 1.5rem;
    font-weight: 700;
    text-decoration: none;
    font-size: .95rem;
    cursor: pointer;
    transition: opacity .2s;
}
.sa-btn-white:hover { opacity: .88; }
.sa-btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,.7);
    border-radius: 999px;
    padding: .75rem 1.5rem;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    transition: background .2s;
}
.sa-btn-outline:hover { background: rgba(255,255,255,.1); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .sa-cards { grid-template-columns: 1fr 1fr; }
    .sa-cta { padding: 2rem 1.2rem; }
}
@media (max-width: 400px) {
    .sa-cards { grid-template-columns: 1fr; }
}
