/* Step-by-step lead quiz (quiz.js) — shared by the Mobile App, Web
   Development and Digital Marketing hero cards. Colors come from each page's
   own theme variables; web development overrides the accent below. */
.spq {
    --q-accent: var(--teal, #00e6cf);
    --q-accent-2: var(--violet, #a855f7);
    --q-grad: linear-gradient(120deg, var(--q-accent), var(--q-accent-2));
    --q-on-grad: #04100e;
    --q-text: var(--text, #f4f6f8);
    --q-muted: var(--text-muted, var(--text-mute, #94a3b8));
    --q-line: var(--border-strong, var(--border, rgba(255, 255, 255, 0.16)));
    --q-field: rgba(127, 127, 127, 0.07);
    --q-error: #ff6b7a;
    text-align: left;
}
.spq[data-quiz="web-development"] {
    --q-accent: var(--blue, #2563eb);
    --q-accent-2: var(--violet, #8b5cf6);
    --q-on-grad: #fff;
}

.spq-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.5rem; }
.spq-step-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--q-muted); }
.spq-step-pct { font-size: 0.72rem; font-weight: 700; color: var(--q-accent); }
.spq-track { height: 4px; border-radius: 4px; background: var(--q-line); overflow: hidden; margin-bottom: 1.2rem; }
.spq-fill { height: 100%; width: 0; border-radius: 4px; background: var(--q-grad); transition: width 0.4s ease; }

.spq-headline { margin: 0 0 0.4rem; font-size: clamp(1.45rem, 2.6vw, 1.75rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; color: var(--q-text); }
.spq-hl { background: var(--q-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spq-headline-sub { margin: 0 0 1.2rem; padding-bottom: 1.1rem; font-size: 0.84rem; color: var(--q-muted); border-bottom: 1px solid var(--q-line); }

.spq-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.spq-legend { display: block; width: 100%; padding: 0; margin: 0 0 0.9rem; font-size: 1.02rem; font-weight: 700; line-height: 1.45; color: var(--q-text); outline: none; }
.spq-legend .spq-req { color: var(--q-accent); }

.spq-options { display: flex; flex-direction: column; gap: 0.55rem; }
.spq-opt {
    position: relative; display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.9rem; border: 1.5px solid var(--q-line); border-radius: 12px;
    background: var(--q-field); color: var(--q-text); font-size: 0.88rem; line-height: 1.35;
    cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.spq-opt:hover { border-color: color-mix(in srgb, var(--q-accent) 60%, transparent); }
.spq-opt input { position: absolute; opacity: 0; pointer-events: none; }
.spq-mark {
    flex-shrink: 0; width: 20px; height: 20px; border: 1.5px solid var(--q-muted);
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.spq-opt--multi .spq-mark { border-radius: 6px; }
.spq-opt--single .spq-mark { border-radius: 50%; }
.spq-mark::after { content: ''; opacity: 0; transition: opacity 0.2s; }
.spq-opt--multi .spq-mark::after { width: 5px; height: 10px; border: solid var(--q-on-grad); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.spq-opt--single .spq-mark::after { width: 8px; height: 8px; border-radius: 50%; background: var(--q-on-grad); }
.spq-opt.is-checked { border-color: var(--q-accent); background: color-mix(in srgb, var(--q-accent) 12%, transparent); }
.spq-opt.is-checked .spq-mark { background: var(--q-accent); border-color: var(--q-accent); }
.spq-opt.is-checked .spq-mark::after { opacity: 1; }
.spq-opt input:focus-visible + .spq-mark { outline: 2px solid var(--q-accent); outline-offset: 2px; }

.spq-note { margin: 0.9rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--q-muted); }

.spq-fields { display: flex; flex-direction: column; gap: 0.85rem; }
.spq-field label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--q-text); }
.spq-field input {
    width: 100%; padding: 0.7rem 0.85rem; font: inherit; font-size: 0.9rem; color: var(--q-text);
    background: var(--q-field); border: 1.5px solid var(--q-line); border-radius: 10px; outline: none;
    transition: border-color 0.2s;
}
.spq-field input:focus { border-color: var(--q-accent); }
.spq-field input.is-invalid { border-color: var(--q-error); }
.spq-field-error { display: block; margin-top: 0.25rem; font-size: 0.74rem; color: var(--q-error); }

.spq-error { margin: 0.8rem 0 0; font-size: 0.8rem; color: var(--q-error); }
.spq-error:empty { display: none; }

.spq-bar { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.spq-back, .spq-next {
    border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 0.9rem; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: transform 0.2s, opacity 0.2s, filter 0.2s;
}
.spq-back { width: 48px; flex-shrink: 0; background: var(--q-field); color: var(--q-text); border: 1.5px solid var(--q-line); }
.spq-back:hover { border-color: var(--q-accent); }
.spq-next { flex: 1; padding: 0.85rem 1rem; background: var(--q-grad); color: var(--q-on-grad); }
.spq-next:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.spq-next:disabled, .spq-back:disabled { opacity: 0.55; cursor: default; }

.spq-success { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem 1.1rem; border-radius: 12px; background: color-mix(in srgb, var(--q-accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--q-accent) 35%, transparent); }
.spq-success-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--q-grad); color: var(--q-on-grad); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.spq-success p { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--q-text); }

/* ── Compact layout: the whole card should be visible on one screen ── */
.spq-progress-row { margin-bottom: 0.35rem; }
.spq-track { margin-bottom: 0.8rem; }
.spq-headline { font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.25; margin-bottom: 0.3rem; }
.spq-headline-sub { margin-bottom: 0.8rem; padding-bottom: 0.7rem; font-size: 0.78rem; }
.spq-legend { font-size: 0.95rem; line-height: 1.35; margin-bottom: 0.65rem; }
.spq-options { gap: 0.4rem; }
.spq-opt { padding: 0.5rem 0.75rem; font-size: 0.84rem; gap: 0.6rem; border-radius: 10px; }
.spq-mark { width: 18px; height: 18px; }
.spq-options--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spq-options--grid .spq-opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.spq-note { margin-top: 0.6rem; font-size: 0.74rem; line-height: 1.4; }
.spq-bar { margin-top: 0.9rem; }
.spq-next { padding: 0.7rem 1rem; }
.spq-back { width: 44px; }
.spq-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.7rem; }
.spq-field label { margin-bottom: 0.2rem; font-size: 0.76rem; }
.spq-field input { padding: 0.55rem 0.7rem; font-size: 0.86rem; }
.spq-field:last-child { grid-column: 1 / -1; }
@media (max-width: 480px) {
    .spq-options--grid { grid-template-columns: 1fr; }
    .spq-fields { grid-template-columns: 1fr; }
}

/* Keep the card at the top of the hero so it is in view without scrolling */
.dm-lead-card:has(.spq), .mh-lead-card:has(.spq) { align-self: start; }
@media (min-width: 961px) {
    .dm-lead-card:has(.spq) { margin-top: 0.75rem; }
}

/* The hero cards that hold the quiz: trim their own spacing too */
.mh-lead-card:has(.spq), .dm-lead-card:has(.spq), .hero-lead-card:has(.spq) { padding: 0; }
.mh-lead-card:has(.spq) h3, .dm-lead-card:has(.spq) h3, .hero-lead-card:has(.spq) h3 { font-size: 1.05rem; margin-bottom: 0.15rem; }
.mh-lead-card:has(.spq) .mh-lead-sub, .dm-lead-card:has(.spq) .dm-lead-sub, .hero-lead-card:has(.spq) .hero-lead-sub { margin-bottom: 0.7rem; font-size: 0.78rem; }
.mh-lead-card:has(.spq) .mh-lead-checks, .dm-lead-card:has(.spq) .dm-lead-checks { flex-direction: row; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.7rem; }
.mh-lead-card:has(.spq) .mh-lead-checks span, .dm-lead-card:has(.spq) .dm-lead-checks span { font-size: 0.72rem; }
.mh-lead-card:has(.spq) .mh-lead-note, .dm-lead-card:has(.spq) .dm-lead-note, .hero-lead-card:has(.spq) .hero-lead-note { margin-top: 0.5rem; }

/* ── Colored header strip on top, white panel below ── */
.spq {
    --q-strip: linear-gradient(135deg, #0d8f86 0%, #4f46c8 60%, #7c3aed 100%);
    --q-highlight: #ffe08a;
}
.spq[data-quiz="web-development"] { --q-strip: linear-gradient(135deg, #2563eb 0%, #5b4bdc 55%, #7c3aed 100%); }

.spq-card.spq-card { background: #fff; overflow: hidden; border-color: rgba(15, 23, 42, 0.12); }
.spq-card.spq-card::before { display: none; }

.spq-strip { background: var(--q-strip); color: #fff; padding: 1rem 1.3rem 1rem; }
.spq-strip h3 { margin: 0 0 0.15rem; font-size: 1.05rem; color: #fff; }
.spq-strip [class*="lead-sub"] { margin: 0 0 0.7rem; font-size: 0.78rem; color: rgba(255, 255, 255, 0.82); }
.spq-strip .spq-step-label { color: rgba(255, 255, 255, 0.85); }
.spq-strip .spq-step-pct { color: #fff; }
.spq-strip .spq-track { background: rgba(255, 255, 255, 0.28); margin-bottom: 0; }
.spq-strip .spq-fill { background: #fff; }
.spq-strip .spq-head:not(:empty) { margin-top: 0.8rem; }
.spq-strip .spq-headline { color: #fff; margin-bottom: 0.25rem; }
.spq-strip .spq-hl { background: none; color: var(--q-highlight); -webkit-text-fill-color: var(--q-highlight); }
.spq-strip .spq-headline-sub { margin: 0; padding: 0; border: 0; color: rgba(255, 255, 255, 0.82); }

.spq-panel {
    --q-text: #0f172a;
    --q-muted: #64748b;
    --q-line: rgba(15, 23, 42, 0.16);
    --q-field: #f8fafc;
    --q-error: #d93a4f;
    background: #fff; color: var(--q-text); padding: 1rem 1.3rem 1.1rem;
}
.spq-panel .spq-req { color: #7c3aed; }
.spq-panel .spq-opt:hover { background: #f1f5f9; }
.spq-panel .spq-field input { background: #fff; }

/* Trust lines and note under the form sit on the white card too */
.spq-card .mh-lead-checks, .spq-card .dm-lead-checks { padding: 0 1.3rem; margin-top: 0; }
.spq-card .mh-lead-checks span, .spq-card .dm-lead-checks span { color: #475569; }
.spq-card .mh-lead-note, .spq-card .dm-lead-note, .spq-card .hero-lead-note { padding: 0 1.3rem 1rem; margin-top: 0.6rem; color: #64748b; }
.spq-card .hero-lead-note { padding-top: 0; }

@media (prefers-reduced-motion: reduce) {
    .spq-fill, .spq-opt, .spq-next, .spq-back { transition: none; }
}
