/* =========================================================
   Security Scorecard Widget
   ========================================================= */

.sc-widget {
    font-family: inherit;
    background: #fff;
}

/* Quiz two-column layout */
.sc-quiz-layout {
    display: flex;
    align-items: stretch;
    min-height: 600px;
}

/* ---- Left panel ---- */

.sc-left {
    flex: 0 0 42%;
    display: flex;
    align-items: center;
    padding: 60px 48px;
    background: #fff;
}

.sc-left-inner {
    max-width: 400px;
}

.sc-headline {
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
    margin: 0 0 20px;
}

.sc-subtext {
    font-size: 16px;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 28px;
}

.sc-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sc-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #475569;
    font-style: italic;
}

.sc-features li::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    min-width: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234f46e5'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414L8.414 15l-4.121-4.121a1 1 0 011.414-1.414L8.414 12.172l6.879-6.879a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ---- Right panel ---- */

.sc-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 48px 40px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
}

/* ---- Progress ---- */

.sc-progress {
    margin-bottom: 28px;
}

.sc-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sc-progress-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sc-progress-pct {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.sc-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.sc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* ---- Card / Steps ---- */

.sc-card {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: 36px 40px;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}

.sc-step {
    display: none;
}

.sc-step--active {
    display: block;
    animation: scFadeIn 0.25s ease;
}

@keyframes scFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Badge ---- */

.sc-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 99px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 18px;
}

/* ---- Question text ---- */

.sc-question {
    font-size: clamp(17px, 2vw, 21px);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 24px;
}

/* ---- Options ---- */

.sc-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sc-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
}

.sc-option:hover {
    border-color: #a5b4fc;
    background: #f5f3ff;
}

.sc-option--selected {
    border-color: #4f46e5;
    background: #eef2ff;
}

.sc-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sc-option-text {
    font-size: 15px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
    padding-right: 14px;
}

.sc-option-radio {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}

.sc-option--selected .sc-option-radio {
    border-color: #4f46e5;
    background: #4f46e5;
}

.sc-option--selected .sc-option-radio::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

/* ---- Gate step ---- */

.sc-gate-subtext {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 24px;
}

.sc-gate-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sc-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sc-required {
    color: #ef4444;
}

.sc-field input {
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.sc-field input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.sc-field input.sc-field-error {
    border-color: #ef4444;
}

.sc-gate-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    border: 1px solid #fecaca;
}

/* ---- Navigation ---- */

.sc-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
}

.sc-btn-back {
    padding: 13px 28px;
    border: 1.5px solid #cbd5e1;
    border-radius: 99px;
    background: transparent;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.sc-btn-back:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.sc-btn-back:disabled,
.sc-btn-back[style*="visibility:hidden"] {
    opacity: 0;
    pointer-events: none;
}

.sc-btn-next {
    padding: 13px 36px;
    border: none;
    border-radius: 99px;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.sc-btn-next:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.sc-btn-next:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.sc-btn-next.sc-btn-submit {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

/* ---- Results ---- */

.sc-results {
    display: none;
}

.sc-results.sc-step--active {
    display: block;
}

.sc-results-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: #64748b;
}

.sc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: scSpin 0.7s linear infinite;
}

@keyframes scSpin {
    to { transform: rotate(360deg); }
}

/* Results content */

.sc-results-header {
    text-align: center;
    padding-bottom: 28px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 28px;
}

.sc-score-display {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}

.sc-score-number {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sc-score-max {
    font-size: 28px;
    font-weight: 600;
    color: #94a3b8;
}

.sc-score-band {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.sc-score-band--high     { background: #dcfce7; color: #15803d; }
.sc-score-band--moderate { background: #fef9c3; color: #a16207; }
.sc-score-band--elevated { background: #ffedd5; color: #c2410c; }
.sc-score-band--risk     { background: #fee2e2; color: #b91c1c; }

.sc-score-desc {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* Category scores */

.sc-categories-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 14px;
}

.sc-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.sc-category-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
}

.sc-category-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.sc-category-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.sc-category-score-label {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 99px;
}

.sc-rating--good     { background: #dcfce7; color: #15803d; }
.sc-rating--medium   { background: #fef9c3; color: #a16207; }
.sc-rating--attention{ background: #fee2e2; color: #b91c1c; }

.sc-category-bar-track {
    height: 4px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sc-category-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease 0.2s;
}

.sc-bar--good      { background: linear-gradient(90deg, #22c55e, #4ade80); }
.sc-bar--medium    { background: linear-gradient(90deg, #eab308, #facc15); }
.sc-bar--attention { background: linear-gradient(90deg, #ef4444, #f87171); }

.sc-category-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* CTA */

.sc-results-cta {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    text-align: center;
}

.sc-results-cta p {
    font-size: 14px;
    color: #475569;
    margin: 0 0 16px;
    line-height: 1.6;
}

.sc-results-cta a.sc-cta-btn {
    display: inline-block;
    padding: 14px 40px;
    border-radius: 99px;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    transition: opacity 0.15s, transform 0.1s;
}

.sc-results-cta a.sc-cta-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
    .sc-quiz-layout {
        flex-direction: column;
    }

    .sc-left {
        flex: none;
        padding: 40px 28px 32px;
        border-bottom: 1px solid #e2e8f0;
    }

    .sc-left-inner {
        max-width: 100%;
    }

    .sc-right {
        padding: 28px 20px 32px;
        border-left: none;
    }

    .sc-card {
        padding: 24px 20px;
    }
}

/* ==========================================================
   Full-width Results Page
   ========================================================== */

.sc-results-full {
    width: 100%;
    animation: scFadeIn 0.35s ease;
}

/* Loading state */
.sc-rf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
    color: #64748b;
}

/* ---- Results header ---- */

.sc-rf-header {
    text-align: center;
    padding: 56px 24px 40px;
    max-width: 640px;
    margin: 0 auto;
}

.sc-rf-tagline {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 6px;
}

.sc-rf-title {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 14px;
    line-height: 1.2;
}

.sc-rf-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px;
}

.sc-rf-body {
    font-size: 15px;
    color: #475569;
    line-height: 1.7;
    margin: 0;
}

.sc-rf-results-link {
    font-size: 13px;
    color: #64748b;
    margin: 16px 0 0;
}
.sc-rf-results-link a {
    color: #4f46e5;
    text-decoration: underline;
}

.sc-rf-band-desc {
    font-size: 15px;
    color: #475569;
    line-height: 1.7;
    margin: 16px 0 0;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Overview: chart + legend ---- */

.sc-rf-overview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    padding: 40px 24px 48px;
    max-width: 820px;
    margin: 0 auto;
}

/* Donut chart */
.sc-rf-chart-wrap {
    position: relative;
    width: 240px;
    min-width: 200px;
    height: 240px;
}

.sc-rf-chart-wrap canvas {
    display: block;
}

.sc-rf-chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.sc-rf-chart-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    display: block;
    margin-bottom: 2px;
}

.sc-rf-chart-pct {
    font-size: 36px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

/* Legend */
.sc-rf-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 260px;
}

.sc-rf-legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-rf-legend-dot {
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 50%;
}

.sc-rf-legend-name {
    flex: 1;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.sc-rf-legend-pct {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    min-width: 38px;
    text-align: right;
}

.sc-rf-legend-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
}

/* ---- Category cards ---- */

.sc-rf-cards-section {
    background: #f1f5f9;
    padding: 48px 24px;
}

.sc-rf-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
}

.sc-rf-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

.sc-rf-card-left {
    flex: 1;
}

.sc-rf-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.sc-rf-card-about {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 10px;
}

.sc-rf-card-blurb {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

.sc-rf-card-right {
    text-align: right;
    min-width: 90px;
}

.sc-rf-card-score-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    display: block;
    margin-bottom: 2px;
}

.sc-rf-card-pct {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    display: block;
    margin-bottom: 6px;
}

.sc-rf-card-pct--good      { color: #16a34a; }
.sc-rf-card-pct--medium    { color: #d97706; }
.sc-rf-card-pct--attention { color: #dc2626; }

.sc-rf-card-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---- CTA section ---- */

.sc-rf-cta-section {
    text-align: center;
    padding: 60px 24px;
    max-width: 540px;
    margin: 0 auto;
}

.sc-rf-cta-title {
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
}

.sc-rf-cta-subtitle {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 28px;
}

.sc-rf-cta-btn {
    display: inline-block;
    padding: 14px 44px;
    border-radius: 99px;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    transition: opacity 0.15s, transform 0.1s;
}

.sc-rf-cta-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.sc-rf-cta-sublabel {
    font-size: 13px;
    color: #94a3b8;
    margin: 16px 0 0;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .sc-rf-overview {
        flex-direction: column;
        gap: 32px;
    }

    .sc-rf-legend {
        width: 100%;
        min-width: 0;
    }

    .sc-rf-card {
        flex-direction: column;
        gap: 12px;
    }

    .sc-rf-card-right {
        text-align: left;
    }
}