/* ============================================================
   STEP PAGE
   ============================================================ */

.step-hero {
    height: 260px;
    position: relative;
    background-color: var(--surface2);
    background-image: var(--hero-img);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

/* Darkening overlay — keeps text sharp, sits between image and content */
.step-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 0%, rgba(7,13,26,0.45) 25%, rgba(7,13,26,0.88) 60%, rgba(7,13,26,0.98) 100%);
    z-index: 1;
}

.step-hero .hero-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 1.75rem 3rem;
}

.step-hero h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.4rem, 3.5vw, 2.75rem);
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
    line-height: 1.1;
    opacity: 0.9;
}

.attribution {
    font-size: 0.76rem;
    color: var(--muted);
}

.attribution a { color: var(--accent); text-decoration: none; }
.attribution a:hover { text-decoration: underline; }

/* ---- BREADCRUMB ---- */
.steps-breadcrumb {
    padding: 0.65rem 3rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow-x: auto;
    background: var(--surface);
    scrollbar-width: none;
}

.steps-breadcrumb::-webkit-scrollbar { display: none; }

.step-crumb {
    font-size: 0.73rem;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.step-crumb:hover { color: var(--text); }
.step-crumb.current { color: var(--accent); font-weight: 500; }

.breadcrumb-scenario {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    opacity: 0.7;
    transition: opacity 0.15s, color 0.15s;
}

.breadcrumb-scenario:hover { color: var(--accent); opacity: 1; }

.crumb-sep { color: var(--border2); flex-shrink: 0; font-size: 0.7rem; }

/* ---- STATEMENT ---- */
.step-statement {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem 3rem;
    border-bottom: 1px solid var(--border);
    max-width: 1400px;
    margin: 0 auto;
}

.statement-body { flex: 1; min-width: 0; }

.statement-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.statement-title-row h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.1;
}

.step-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.step-description p {
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--text);
    margin-bottom: 0.8rem;
}

.step-description p.desc-participants {
    color: var(--text-dim);
    font-size: 0.83rem;
}

.step-description p:last-child { margin-bottom: 0; }

/* Stats */
.step-stats {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    min-width: 152px;
}

.stat {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    background: var(--surface);
    transition: background 0.15s;
    position: relative;
    overflow: hidden;
}

.stat:last-child { border-bottom: none; }
.stat:hover { background: var(--surface2); }

.stat-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.stat-value {
    display: block;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--yellow);
    letter-spacing: -0.02em;
}

/* ---- LAYOUT 2 COLONNES ---- */
.step-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 3rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

.step-resources,
.step-inputs { min-width: 0; }

.section { margin-bottom: 1.75rem; }

.section h3 {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.no-resources {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

/* Downloads */
.warning-box {
    background: rgba(229,96,96,0.06);
    border: 1px solid rgba(229,96,96,0.2);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    font-size: 0.74rem;
    color: #e08888;
    margin-bottom: 0.85rem;
    line-height: 1.55;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    margin-bottom: 0.5rem;
    transition: border-color 0.15s, background 0.15s;
}
.file-item:hover { border-color: var(--accent); background: var(--surface2); }

.file-icon-circle {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: 2px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: border-color 0.15s;
}
.file-item:hover .file-icon-circle { border-color: var(--accent); }

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.file-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}
.file-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    word-break: break-all;
}

/* Hints */
.hint-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.55rem;
    transition: border-color 0.15s;
}

.hint-item:has(.hint-toggle.open) { border-color: var(--border2); }

.hint-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--surface);
    border: none;
    cursor: pointer;
    font-size: 0.77rem;
    color: var(--muted);
    text-align: left;
    gap: 0.5rem;
    font-family: var(--font-body);
    transition: color 0.15s, background 0.15s;
}

.hint-toggle:hover, .hint-toggle.open { color: var(--text); background: var(--surface2); }

.hint-title { flex: 1; }

.toggle-icon {
    flex-shrink: 0;
    transition: transform 0.25s var(--ease-out);
    font-size: 0.6rem;
    color: var(--muted);
}

.hint-toggle.open .toggle-icon { transform: rotate(180deg); }

.hint-cost {
    font-family: var(--font-mono);
    color: var(--red);
    font-size: 0.68rem;
}

/* Smooth reveal for hints */
.hint-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease-out), padding 0.35s var(--ease-out);
    padding: 0 0.85rem;
    font-size: 0.82rem;
    line-height: 1.7;
    background: var(--surface2);
    border-top: 1px solid transparent;
    color: var(--text);
}

.hint-content.open {
    max-height: 800px;
    padding: 0.85rem;
    border-top-color: var(--border);
}

/* Code in hint content */
.hint-content code, .solution-content code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    color: var(--accent);
}

.hint-content pre, .solution-content pre {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    color: var(--text);
    line-height: 1.6;
}

/* ---- FORM ---- */
.report-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.1rem;
}

.report-card h3 {
    padding: 0.65rem 1rem;
    margin: 0;
    background: rgba(74,143,212,0.07);
    border-bottom: 1px solid rgba(74,143,212,0.18);
    color: var(--accent);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
}

.report-card form { padding: 1rem; }

.form-group { margin-bottom: 0.9rem; }

.form-group label {
    display: block;
    font-size: 0.81rem;
    color: var(--text);
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.question-unit { font-size: 0.7rem; color: var(--muted); }

.question-help {
    font-size: 0.7rem;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.input-group { position: relative; }

.flag-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.48rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.flag-input::placeholder { color: var(--muted); opacity: 0.5; font-style: italic; }

.flag-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,143,212,0.1);
}

.flag-input.multiline { resize: vertical; min-height: 68px; }
.vector-inputs .input-group { margin-bottom: 0.3rem; }

.question-choices { list-style: none; padding: 0; margin: 0.2rem 0 0; }

.choice-item {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: background 0.1s;
}

.choice-item:hover { background: rgba(255,255,255,0.025); }

.choice-input { margin-top: 0.2rem; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.choice-item label { cursor: pointer; line-height: 1.45; color: var(--text); }

.form-submit { margin-top: 0.9rem; }

.btn-submit {
    padding: 0.5rem 1.4rem;
    background: var(--accent-dim);
    border: 1px solid rgba(74,143,212,0.3);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.8rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    letter-spacing: 0.02em;
}

.btn-submit:hover {
    background: rgba(74,143,212,0.2);
    border-color: rgba(74,143,212,0.5);
}

.btn-submit:active { transform: translateY(1px); }

.field-feedback {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.3rem;
    min-height: 1em;
    letter-spacing: 0.02em;
}

.feedback-ok  { color: var(--green); }
.feedback-err { color: var(--red); }

.flag-input.input-correct { border-color: var(--green); box-shadow: 0 0 0 3px rgba(63,214,114,0.1); }
.flag-input.input-wrong   { border-color: var(--red);   box-shadow: 0 0 0 3px rgba(229,96,96,0.1); }

.question-info {
    font-size: 0.81rem;
    line-height: 1.65;
    padding: 0.65rem 0.85rem;
    background: var(--surface2);
    border-radius: var(--radius);
    color: var(--text);
    margin-bottom: 0.7rem;
    border-left: 2px solid var(--border2);
}

.question-danger {
    background: rgba(229,96,96,0.06);
    border: 1px solid rgba(229,96,96,0.22);
    border-left-color: var(--red);
    color: #e09090;
}

/* ---- SOLUTION CARD ---- */
.solution-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem 3rem;
}

.solution-card {
    background: var(--surface);
    border: 1px solid rgba(63,214,114,0.2);
    border-radius: var(--radius);
    overflow: hidden;
}

.solution-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(63,214,114,0.05);
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    transition: background 0.15s;
}

.solution-card-header:hover { background: rgba(63,214,114,0.1); }

.solution-card-header span {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--green);
    letter-spacing: 0.01em;
}

.btn-expand {
    font-size: 0.62rem;
    color: var(--green);
    opacity: 0.7;
    transition: transform 0.25s var(--ease-out);
    flex-shrink: 0;
}

.solution-card-header.open .btn-expand { transform: rotate(180deg); }

/* Smooth reveal for solution */
.solution-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-out), padding 0.4s var(--ease-out);
    padding: 0 1rem;
    border-top: 1px solid transparent;
}

.solution-card-body.open {
    max-height: 99999px;
    padding: 1.1rem 1rem;
    border-top-color: rgba(63,214,114,0.12);
}

/* Write-up */
.solution-content {
    font-size: 0.82rem;
    line-height: 1.85;
    color: var(--text);
    white-space: pre-wrap;
}
.solution-content.resolution-md { white-space: normal; }

/* Sol groups */
.sol-group { margin-bottom: 1rem; }
.sol-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem; }
.sol-answer { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.sol-answer code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.2rem 0.5rem;
}

.sol-answer pre {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
    width: 100%;
}

.sol-format { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); font-style: italic; }
.sol-vector-item { margin-bottom: 0.25rem; }

.sol-choices .choice-item.correct {
    color: var(--text);
    background: rgba(63,214,114,0.05);
}

.choice-mark { flex-shrink: 0; font-size: 0.7rem; margin-top: 0.15rem; color: var(--muted); }
.choice-item.correct .choice-mark { color: var(--green); }

.choice-justification {
    display: block;
    width: 100%;
    font-size: 0.73rem;
    color: var(--muted);
    padding-left: 1.2rem;
    font-style: italic;
    line-height: 1.5;
}

.choice-item.correct .choice-justification { color: var(--green); opacity: 0.7; }

.sol-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

.no-solution { font-size: 0.8rem; color: var(--muted); font-style: italic; margin: 0; }

/* Rendered markdown inside resolution box */
.resolution-md {
    white-space: normal;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}
.resolution-md h1, .resolution-md h2, .resolution-md h3, .resolution-md h4 {
    color: var(--text);
    margin: 1.1em 0 0.35em;
    font-family: var(--font-display);
    line-height: 1.25;
}
.resolution-md h1 { font-size: 1em; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.resolution-md h2 { font-size: 0.95em; font-weight: 600; }
.resolution-md h3 { font-size: 0.9em; font-weight: 600; }
.resolution-md h4 { font-size: 0.85em; font-weight: 500; color: var(--text-dim); }
.resolution-md p { margin: 0.6rem 0; line-height: 1.65; }
.resolution-md ul, .resolution-md ol { padding-left: 1.4rem; margin: 0.5rem 0; }
.resolution-md li { margin: 0.25rem 0; }
.resolution-md code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.1em 0.35em;
    color: var(--accent);
}
.resolution-md pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 0.8rem 0;
}
.resolution-md pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    font-size: 0.82rem;
}
.resolution-md img {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 0.6rem 0;
    display: block;
}
.resolution-md blockquote {
    border-left: 3px solid var(--accent);
    margin: 0.6rem 0;
    padding: 0.3rem 0.8rem;
    color: var(--text-dim);
}
.resolution-md table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 0.8rem 0;
}
.resolution-md th, .resolution-md td {
    border: 1px solid var(--border);
    padding: 0.4rem 0.7rem;
    text-align: left;
}
.resolution-md th { background: var(--surface2); font-weight: 600; }
.resolution-md hr { border: none; border-top: 2px dashed var(--border2); margin: 1.5rem 0; }
.resolution-md a { color: var(--accent); }
.resolution-md > *:first-child { margin-top: 0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .step-statement,
    .step-layout { padding-left: 1.25rem; padding-right: 1.25rem; }
    .step-statement { flex-direction: column; }
    .step-stats { flex-direction: row; min-width: 0; }
    .stat { border-bottom: none; border-right: 1px solid var(--border); flex: 1; }
    .stat:last-child { border-right: none; }
    .step-layout { grid-template-columns: 1fr; }
    .steps-breadcrumb { padding-left: 1.25rem; padding-right: 1.25rem; }
}
