/* ============================================================
   Self-Assessment Wizard — page-specific styles.
   Reuses :root tokens, btn/btn-primary/eyebrow/lead from styles.css.
   ============================================================ */

/* Author-set display values (flex, grid, …) win over the user-agent's
   [hidden]{display:none}, so we re-assert it globally. */
[hidden] { display: none !important; }

/* ---------- Hero ---------- */
.assessment-hero {
    padding: 40px 0 16px;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(21, 96, 130, 0.08), transparent 65%),
                linear-gradient(180deg, #f4f6f8 0%, #ffffff 100%);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}
.assessment-hero h1 {
    background: linear-gradient(135deg, #0c1f2a 0%, #156082 60%, #1f7ba3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0;
    font-size: clamp(1.5rem, 2.8vw, 2rem);
}

/* ---------- Main ---------- */
.assessment-main {
    padding: 24px 0 40px;
    background: var(--color-bg);
}
.assessment-main > .container { max-width: 920px; }

/* ---------- Loading ---------- */
.assessment-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 80px 0;
    color: var(--color-text-muted);
}
.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Error ---------- */
.assessment-error {
    text-align: center;
    padding: 56px 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: #fff;
}
.assessment-error h2 { margin-bottom: 12px; }
.assessment-error p { color: var(--color-text-muted); margin-bottom: 24px; }

/* ---------- Wizard shell ---------- */
.wizard {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px 32px 20px;
    box-shadow: var(--shadow-sm);
}

/* ---------- Progress ---------- */
.wizard-progress { margin-bottom: 20px; }
.wizard-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--color-bg-alt);
    overflow: hidden;
}
.wizard-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 999px;
    transition: width 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.wizard-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}
.wizard-progress-meta span:last-child {
    color: var(--color-primary);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    font-weight: 600;
}

/* ---------- Step ---------- */
.wizard-step {
    animation: fade-in 240ms ease;
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.wizard-step h2 {
    font-size: 1.15rem;
    margin-bottom: 4px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.wizard-step .step-prompt {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    margin-bottom: 16px;
    line-height: 1.5;
}
.wizard-step .sub-prompt {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin: 14px 0 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.wizard-step .sub-prompt-detail {
    font-size: 0.92rem;
    color: var(--color-text);
    margin: 0 0 12px;
    line-height: 1.45;
}
.wizard-step .sub-prompt + .sub-prompt-detail { margin-top: -4px; }

/* ---------- Field group (label over input) ---------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}
.field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
}
.field .hint {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-weight: 400;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(21, 96, 130, 0.12);
}
.field textarea {
    resize: vertical;
    min-height: 100px;
}
.field.invalid input,
.field.invalid textarea { border-color: #c0392b; }

/* ---------- Option list (radios / checkboxes as cards) ---------- */
.options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.option:hover {
    border-color: var(--color-primary-light);
    background: rgba(21, 96, 130, 0.02);
}
.option input[type="radio"],
.option input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}
.option-label {
    font-size: 0.92rem;
    color: var(--color-text);
    line-height: 1.4;
}
.option.is-selected {
    border-color: var(--color-primary);
    background: rgba(21, 96, 130, 0.04);
}
.option.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.option.is-disabled:hover {
    border-color: var(--color-border);
    background: #fff;
}

/* Free-text follow-up next to an "Other" option (revealed when selected). */
.option-other-input {
    margin-top: 10px;
    margin-left: 32px;
    width: calc(100% - 32px);
}

/* ---------- Two-column layout for area steps (maturity + FTE side-by-side) ---------- */
/* Maturity labels are long ("Ad-hoc — kein definierter Prozess"), FTE labels
   are short ("10–30 %"), so the columns are asymmetric: 2:1 keeps the
   maturity rungs on a single line and avoids the cramped look. */
.area-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 720px) {
    .area-grid { grid-template-columns: 2fr 1fr; gap: 24px; }
}
.area-grid h3 {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ---------- Range slider (Q19 self-rating) ---------- */
.slider-field {
    margin: 28px 0;
    text-align: center;
}
.slider-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}
.slider-field input[type="range"] {
    margin-top: 14px;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--color-bg-alt);
    border-radius: 999px;
    outline: none;
}
.slider-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(21, 96, 130, 0.35);
    transition: background var(--transition), transform var(--transition);
}
.slider-field input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--color-primary-dark);
    transform: scale(1.08);
}
.slider-field input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(21, 96, 130, 0.35);
}
.slider-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 10px;
}

/* ---------- Consent / DSGVO checkbox ---------- */
.consent {
    margin-top: 14px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--color-bg-alt);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.consent input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--color-primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.consent label {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    cursor: pointer;
}
.consent a { color: var(--color-primary); text-decoration: underline; }

/* ---------- Step error message ---------- */
.step-error {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(192, 57, 43, 0.08);
    color: #c0392b;
    font-size: 0.9rem;
    border: 1px solid rgba(192, 57, 43, 0.2);
}

/* ---------- Action row ---------- */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.wizard-actions .btn-ghost svg { transition: transform var(--transition); }
.wizard-actions .btn-ghost:hover svg { transform: translateX(-3px); }
.wizard-actions [disabled] {
    opacity: 0.4;
    pointer-events: none;
}

/* ---------- Result card ---------- */
.result-card {
    background: #fff;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
}
.result-card h2 {
    color: var(--color-text);
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    margin: 4px 0 12px;
    letter-spacing: -0.01em;
}
.result-card p {
    color: var(--color-text-muted);
    font-size: 0.97rem;
    line-height: 1.6;
}

/* ---------- Gauge ---------- */
.gauge {
    position: relative;
    width: 280px;
    max-width: 100%;
    margin: 16px auto 8px;
    aspect-ratio: 5 / 3;
}
.gauge-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}
.gauge-value {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    line-height: 1;
}
.gauge-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.04em;
    display: block;
}
.gauge-max {
    font-size: 0.74rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-top: 6px;
    display: block;
    font-weight: 600;
}

.result-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.result-section h3 {
    color: var(--color-text);
    font-size: 1rem;
    margin-bottom: 6px;
    font-weight: 600;
}
.result-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .assessment-hero { padding: 64px 0 24px; }
    .assessment-main { padding: 36px 0 64px; }
    .wizard { padding: 24px 20px; border-radius: var(--radius-md); }
    .wizard-step { min-height: 200px; }
    .wizard-step h2 { font-size: 1.15rem; }
    .wizard-actions { flex-direction: column-reverse; align-items: stretch; }
    .wizard-actions .btn { justify-content: center; }
    .result-card { padding: 22px 20px; }
    .gauge { width: 240px; }
    .gauge-number { font-size: 2.4rem; }
}
