/* ===================================================
   SEM AI Labs — Free Diagnostic  (diagnostic/index.php)
   Dark teal Style
   =================================================== */

/* Override CSS variables for diagnostic page */
.diagnostic-body {
    --color-primary:       #1a7a7a;
    --color-primary-dark:  #156060;
    --color-primary-light: #e4f4f4;
    --color-border:        #dde4e8;
    --color-bg:            #f4f6f7;
}

/* --- Page shell --- */
.diagnostic-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #f4f6f7;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

.diag-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Brand bar --- */
.diag-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #1a7a7a;
    border-bottom: 1px solid #156060;
    border-radius: 0 0 16px 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.diag-logo { height: 64px; filter: brightness(0) invert(1); }

.diag-brand-label {
    font-size: .75rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    text-transform: uppercase;
    letter-spacing: .07em;
}

/* --- Screen system --- */
.diag-screen {
    display: none;
    flex: 1;
    justify-content: center;
    align-items: flex-start;
    padding: 2.5rem 1rem 3rem;
}
.diag-screen.active {
    display: flex;
    animation: diagFadeIn .35s ease;
}

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

/* --- Card base --- */
.diag-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #dde4e8;
    box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 660px;
}

.diag-card-center {
    text-align: center;
}

/* ===================================================
   INTRO SCREEN
   =================================================== */

.diag-intro-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #e4f4f4;
    color: #1a7a7a;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .3rem .75rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
    border: 1px solid #a8d8d8;
}

.diag-h1 {
    font-size: 2rem;
    font-weight: 900;
    color: #0d1b2a;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -.02em;
}

.diag-intro-sub {
    font-size: .9375rem;
    color: #5a7a8a;
    line-height: 1.75;
    margin-bottom: .75rem;
}

.diag-intro-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin: 1.75rem 0;
    padding: 1.25rem 0;
    border-top: 1px solid #dde4e8;
    border-bottom: 1px solid #dde4e8;
}

.diag-stat { text-align: center; }

.diag-stat-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 900;
    color: #1a7a7a;
    line-height: 1;
}

.diag-stat-label {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #8a9aaa;
    margin-top: .3rem;
}

.diag-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #1a7a7a 0%, #156060 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .01em;
    box-shadow: 0 4px 20px rgba(26,122,122,.35);
    transition: transform .15s, box-shadow .15s;
    margin-top: .25rem;
}
.diag-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(26,122,122,.45);
}

.diag-already {
    text-align: center;
    margin-top: 1rem;
    font-size: .8125rem;
    color: #8a9aaa;
}
.diag-already a { color: #1a7a7a; text-decoration: none; }
.diag-already a:hover { text-decoration: underline; }

/* ===================================================
   QUESTION SCREEN
   =================================================== */

.diag-progress-wrap { margin-bottom: 1.5rem; }

.diag-progress-bar {
    height: 6px;
    background: #dde4e8;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: .5rem;
}

.diag-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a7a7a, #1e9090);
    border-radius: 999px;
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.diag-progress-label {
    font-size: .75rem;
    color: #8a9aaa;
    font-weight: 600;
    letter-spacing: .03em;
}

.diag-section-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #1a7a7a;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.diag-section-label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #1a7a7a;
    border-radius: 50%;
}

.diag-q-text {
    font-size: 1.1875rem;
    font-weight: 700;
    color: #0f1f33;
    line-height: 1.45;
    margin-bottom: 1.5rem;
}

/* Option cards */
.diag-options {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.diag-opt {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .875rem 1rem;
    border: 2px solid #dde4e8;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
    user-select: none;
    background: #fff;
}

.diag-opt:hover {
    border-color: #1a7a7a;
    background: #e4f4f4;
    box-shadow: 0 2px 12px rgba(26,122,122,.12);
}

.diag-opt.selected {
    border-color: #1a7a7a;
    background: #e4f4f4;
    box-shadow: 0 2px 16px rgba(26,122,122,.18);
}

/* Radio indicator */
.diag-opt-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #b8d0d8;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, background .15s;
    position: relative;
}

.diag-opt.selected .diag-opt-radio {
    border-color: #1a7a7a;
    background: #1a7a7a;
}

.diag-opt-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity .15s, transform .15s;
    transform: scale(.5);
}

.diag-opt.selected .diag-opt-dot {
    opacity: 1;
    transform: scale(1);
}

/* Option text */
.diag-opt-body { flex: 1; min-width: 0; }

.diag-opt-label {
    display: block;
    font-size: .9rem;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.4;
    transition: color .15s;
}

.diag-opt.selected .diag-opt-label {
    color: #1a7a7a;
    font-weight: 700;
}

.diag-opt-hint {
    display: block;
    font-size: .72rem;
    color: #8a9aaa;
    margin-top: .15rem;
}

/* Nav */
.diag-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #dde4e8;
}

.diag-q-counter {
    font-size: .78rem;
    color: #8a9aaa;
    font-weight: 600;
}

/* ===================================================
   LEAD CAPTURE SCREEN
   =================================================== */

.diag-score-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
}

/* Ring SVG */
.diag-ring {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 16px rgba(26,122,122,.25));
}

.diag-ring-bg {
    fill: none;
    stroke: #dde4e8;
    stroke-width: 10;
}

.diag-ring-fill {
    fill: none;
    stroke: #1a7a7a;
    stroke-width: 10;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset .9s cubic-bezier(.4, 0, .2, 1);
}

.diag-ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.diag-ring-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 900;
    color: #0d1b2a;
    line-height: 1;
}

.diag-ring-pct {
    display: block;
    font-size: .65rem;
    color: #8a9aaa;
    margin-top: .15rem;
    font-weight: 600;
}

/* Larger ring for results */
.diag-ring-lg {
    width: 160px;
    height: 160px;
}

.diag-lead-h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0d1b2a;
    text-align: center;
    margin-bottom: .5rem;
    letter-spacing: -.01em;
}

.diag-lead-sub {
    text-align: center;
    font-size: .875rem;
    color: #5a7a8a;
    line-height: 1.65;
    margin-bottom: 1.25rem;
}

/* Locked teaser */
.diag-teaser-locked {
    background: #f4f6f7;
    border: 1px solid #dde4e8;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.diag-teaser-locked-title {
    font-size: .8rem;
    font-weight: 700;
    color: #5a7a8a;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .6rem;
}

.diag-locked-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.diag-locked-list li {
    font-size: .875rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* Forms — intro and lead capture */
#diag-intro-form .req,
#diag-lead-form .req { color: #dc3545; }

/* Tighten form-row gap to match MA */
#diag-intro-form .form-row {
    gap: 12px;
    margin-bottom: 12px;
}
#diag-intro-form .form-row.single {
    grid-template-columns: 1fr;
}

#diag-intro-form .form-group,
#diag-lead-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#diag-intro-form .form-group label,
#diag-intro-form .form-group .form-label,
#diag-lead-form .form-group label,
#diag-lead-form .form-group .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #5a7a8a;
    text-transform: uppercase;
    letter-spacing: .04em;
}

#diag-intro-form input,
#diag-lead-form input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #dde4e8;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1a2d42;
    background: #f4f6f7;
    transition: border-color .15s, box-shadow .15s;
}
#diag-intro-form input[type=checkbox],
#diag-lead-form input[type=checkbox] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    padding: 0;
}
#diag-intro-form input:focus,
#diag-lead-form input:focus {
    outline: none;
    border-color: #1a7a7a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,122,122,.12);
}

/* Consent box — matches MA style */
.diag-intro-consent {
    background: #e4f4f4;
    border: 1px solid #a8d8d8;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    width: 100%;
    box-sizing: border-box;
}
.diag-intro-consent-title {
    font-size: 12px;
    font-weight: 700;
    color: #1a3a5c;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .6rem;
}
.diag-intro-consent-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.diag-intro-consent-item input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #1a7a7a;
    cursor: pointer;
}
.diag-intro-consent-item label {
    font-size: 13px;
    color: #1a2d42;
    line-height: 1.5;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}


.diag-consent {
    margin-top: 1rem;
    font-size: .78rem;
    color: #8a9aaa;
    line-height: 1.5;
}

.diag-consent-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    cursor: pointer;
}
.diag-consent-item input { width: auto; margin-top: .15rem; accent-color: #1a7a7a; }

/* ===================================================
   RESULTS SCREEN
   =================================================== */

.diag-results-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #dde4e8;
}

.diag-results-logo { height: 28px; margin: 0 auto .75rem; }

.diag-results-h2 {
    font-size: 1.35rem;
    font-weight: 900;
    color: #0d1b2a;
    margin-bottom: .25rem;
}

.diag-results-name {
    font-size: .875rem;
    color: #5a7a8a;
}

.diag-score-main {
    display: flex;
    justify-content: center;
    margin-bottom: .75rem;
    position: relative;
}

.diag-score-grade {
    text-align: center;
    font-size: .9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.diag-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #8a9aaa;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.diag-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dde4e8;
}

/* Heat map */
.diag-heatmap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) { .diag-heatmap { grid-template-columns: repeat(2, 1fr); } }

.diag-heat-cell {
    border-radius: 10px;
    padding: .75rem;
    text-align: center;
    border: 1px solid transparent;
}

.heat-red    { background: #fff5f5; border-color: #fca5a5; }
.heat-yellow { background: #f0f6fa; border-color: #a8c8d8; }
.heat-green  { background: #e4f4f4; border-color: #1a7a7a; }

.diag-heat-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .25rem;
    color: #475569;
}

.diag-heat-score {
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
    color: #0d1b2a;
}

/* Headlines */
.diag-headlines {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.diag-headline-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 1rem;
    background: #f4f6f7;
    border-radius: 10px;
    border-left: 3px solid #1a7a7a;
}

.diag-headline-num {
    width: 22px;
    height: 22px;
    background: #1a7a7a;
    color: #fff;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: .05rem;
}

.diag-headline-text {
    font-size: .875rem;
    color: #334155;
    line-height: 1.5;
    flex: 1;
}

/* Urgency */
.diag-urgency-box {
    padding: .875rem 1.1rem;
    background: #e4f4f4;
    border: 1px solid #a8d8d8;
    border-left: 4px solid #1a7a7a;
    border-radius: 0 10px 10px 0;
    font-size: .875rem;
    color: #156060;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

/* CTA box */
.diag-cta-box {
    background: linear-gradient(135deg, #1a7a7a 0%, #156060 100%);
    border-radius: 16px;
    padding: 1.75rem;
    text-align: center;
    margin-top: 1rem;
}

.diag-cta-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: .6rem;
    letter-spacing: -.01em;
}

.diag-cta-sub {
    font-size: .8375rem;
    color: rgba(255,255,255,.75);
    line-height: 1.65;
    margin-bottom: 1.25rem;
}

.diag-cta-box .btn.btn-primary {
    background: #fff;
    color: #1a7a7a;
    border-color: transparent;
    font-size: .9375rem;
    padding: .75rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    font-weight: 700;
}

.diag-cta-box .btn.btn-primary:hover {
    background: #e4f4f4;
    transform: translateY(-1px);
}

/* ===================================================
   LOADING / SCORING SCREEN
   =================================================== */

.diag-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #dde4e8;
    border-top-color: #1a7a7a;
    border-radius: 50%;
    animation: diagSpin .75s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.diag-scoring-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0d1b2a;
    margin-bottom: .4rem;
}

.diag-scoring-sub {
    font-size: .875rem;
    color: #8a9aaa;
}

/* ===================================================
   SHARED BUTTON OVERRIDES (inherit from style.css)
   =================================================== */

.diag-card .btn { border-radius: 10px; }
.diag-card .btn-primary { background: #1a7a7a; border-color: #1a7a7a; }
.diag-card .btn-primary:hover { background: #156060; border-color: #156060; }
.diag-card .btn-secondary { border-color: #dde4e8; }

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 700px) {
    .diag-card { padding: 1.75rem 1.25rem; border-radius: 16px; }
    .diag-h1 { font-size: 1.5rem; }
    .diag-brand { padding: .75rem 1.25rem; }
    .diag-stat-num { font-size: 1.35rem; }
    .diag-intro-stats { gap: 1.5rem; }
    .diag-q-text { font-size: 1rem; }
    .diag-ring-lg { width: 130px; height: 130px; }
    .diag-cta-box { padding: 1.25rem; }
    .diag-cta-title { font-size: .95rem; }
}

@media (max-width: 420px) {
    .diag-intro-stats { gap: 1rem; }
    .diag-stat-num { font-size: 1.25rem; }
}
