/* Deal tutorial — extends deal-wizard.css (tokens, topbar, rail, card, buttons). */

.tutorial {
    --you: var(--accent);
    --evenfi: var(--brand-ink);
    --together: var(--success);
}

.tutorial .wizard-shell {
    grid-template-columns: 260px minmax(0, 1fr);
    max-width: 1160px;
}

/* ── Rail ───────────────────────────────────────────── */

.tut-stepper .stepper-item a {
    align-items: flex-start;
}

.tut-stepper .stepper-dot {
    margin-top: 1px;
}

.tut-stepper .stepper-label {
    display: flex;
    flex-direction: column;
    padding-top: 3px;
    line-height: 1.3;
}

.tut-stepper .stepper-label small {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
}

.tut-stepper .stepper-item:not(:last-child)::after {
    top: 32px;
}

.tut-stepper .stepper-item.is-upcoming a:hover .stepper-dot {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Content ────────────────────────────────────────── */

.tut-content .page-header h1 {
    font-size: 2rem;
}

.tut-content .page-description {
    max-width: 62ch;
    font-size: 1.0625rem;
}

.tut-footnote {
    margin-top: 1.75rem;
    font-size: 0.8125rem;
    color: var(--text-3);
}

/* Overview phase cards */
.tut-phases {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.875rem;
    list-style: none;
}

.tut-phase-card {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    height: 100%;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tut-phase-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-pop);
    transform: translateY(-1px);
}

.tut-phase-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tut-phase-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
}

.tut-phase-meta {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
}

.tut-phase-card strong {
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}

.tut-phase-summary {
    font-size: 0.875rem;
    color: var(--text-2);
}

/* Steps */
.tut-steps {
    display: flex;
    flex-direction: column;
}

.tut-step {
    position: relative;
    padding-bottom: 2.25rem;
}

.tut-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 48px;
    bottom: 8px;
    width: 1px;
    background: var(--border-strong);
}

.tut-step:last-child {
    padding-bottom: 0.5rem;
}

.tut-step-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tut-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 5px var(--accent-soft);
}

.tut-step-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}

.tut-step-head h2 {
    font-size: 1.25rem;
    font-weight: 650;
}

.tut-step-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0 0 calc(39px + 1rem);
}

.tut-step-body > * {
    margin: 0;
}

/* Role rows: You / EvenFi / Together */
.tut-roles {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.tut-role {
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: baseline;
}

.tut-role dt {
    justify-self: start;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.tut-role dd {
    color: var(--text-2);
}

.tut-role--you dt { color: var(--you); background: color-mix(in srgb, var(--you) 11%, transparent); }
.tut-role--evenfi dt { color: var(--evenfi); background: color-mix(in srgb, var(--evenfi) 11%, transparent); }
.tut-role--together dt { color: var(--together); background: color-mix(in srgb, var(--together) 12%, transparent); }

.tut-terms {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 1.125rem;
    color: var(--text-2);
}

.tut-terms strong {
    color: var(--text);
}

.tut-facts {
    margin: 0;
}

.tut-cta-inline .btn {
    text-decoration: none;
}

.tut-subtitle {
    margin-top: 0.75rem !important;
    font-size: 1rem;
    font-weight: 600;
}

/* Form screenshots */
.tut-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1.25rem;
    list-style: none;
}

.tut-shot a {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s ease;
}

.tut-shot a {
    cursor: zoom-in;
}

.tut-shot a:hover {
    border-color: var(--accent);
}

.tut-shot a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tut-shot img {
    display: block;
    width: 100%;
    height: auto;
}

.tut-shot h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.tut-shot-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
}

.tut-shot p {
    font-size: 0.8125rem;
    color: var(--text-2);
}

/* Labels quoted from the form and the owner area */
.tut-ui {
    font-weight: 600;
    color: var(--text);
}

/* Link from a step to the owner-area page */
.tut-guide-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.tut-guide-link a:hover span {
    text-decoration: underline;
}

.tut-guide-link .tut-ui {
    color: inherit;
}

/* Overview: owner-area card under the phases */
.tut-owner-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.875rem;
    padding: 1.125rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tut-owner-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-pop);
    transform: translateY(-1px);
}

.tut-owner-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tut-owner-card .tut-phase-icon {
    flex-shrink: 0;
    margin-bottom: 0;
}

.tut-owner-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.tut-owner-card strong {
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}

.tut-owner-card > .icon {
    flex-shrink: 0;
    color: var(--accent);
}

/* Outcomes */
.tut-outcomes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.tut-outcome {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    border-radius: var(--radius);
}

.tut-outcome .icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.tut-outcome p {
    margin-top: 0.125rem;
    font-size: 0.875rem;
    color: var(--text-2);
}

.tut-outcome--yes { background: var(--success-soft); }
.tut-outcome--yes .icon, .tut-outcome--yes strong { color: var(--success); }
.tut-outcome--no { background: var(--danger-soft); }
.tut-outcome--no .icon, .tut-outcome--no strong { color: var(--danger); }

/* Highlight (reflection period) */
.tut-highlight {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    background: var(--accent-soft);
}

.tut-big {
    flex-shrink: 0;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    letter-spacing: -0.03em;
}

.tut-big span {
    font-size: 1.125rem;
    letter-spacing: 0;
}

.tut-highlight p:last-child {
    color: var(--text-2);
}

/* Callout */
.tut-callout {
    display: flex;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--text);
    font-size: 0.875rem;
}

.tut-callout .icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--accent);
}

.tut-callout strong {
    color: var(--accent);
    margin-right: 0.25rem;
}

/* FAQ */
.tut-faq {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.tut-faq details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.tut-faq details[open] {
    background: var(--surface-2);
}

.tut-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.125rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.tut-faq summary::-webkit-details-marker {
    display: none;
}

.tut-faq summary .icon {
    flex-shrink: 0;
    color: var(--text-3);
    transition: transform 0.2s ease;
}

.tut-faq details[open] summary .icon {
    transform: rotate(180deg);
}

.tut-faq summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius);
}

.tut-faq-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1.125rem 1.125rem;
    color: var(--text-2);
}

.tut-ready h2 {
    font-size: 1.125rem;
}

/* ── Screenshot viewer (tutorial.js) ────────────────── */

.tut-lightbox-open {
    overflow: hidden;
}

.tut-lightbox {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    overflow: hidden;
}

.tut-lightbox::backdrop {
    background: rgba(8, 11, 18, 0.82);
}

.tut-lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4.25rem 4.5rem 1.5rem;
}

.tut-lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.tut-lightbox-img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(95vw, 1400px, 100%);
    max-height: calc(90vh - 6rem);
    max-height: calc(90dvh - 6rem);
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
}

.tut-lightbox-caption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: 960px;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 0.875rem;
}

.tut-lightbox-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.tut-lightbox-desc {
    color: var(--text-2);
}

.tut-lightbox-counter {
    flex-shrink: 0;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tut-lightbox-btn {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-pop);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.tut-lightbox-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tut-lightbox-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tut-lightbox-btn[hidden] {
    display: none;
}

.tut-lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
}

.tut-lightbox-prev,
.tut-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.tut-lightbox-prev {
    left: 0.75rem;
}

.tut-lightbox-next {
    right: 0.75rem;
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 900px) {
    .tutorial .wizard-shell {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .tut-content .page-header h1 {
        font-size: 1.625rem;
    }

    .tut-step-body {
        margin-left: 0;
    }

    .tut-step:not(:last-child)::after {
        display: none;
    }

    .tut-role {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
    }

    .tut-gallery,
    .tut-outcomes {
        grid-template-columns: minmax(0, 1fr);
    }

    .tut-highlight {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .wizard-navigation .btn-primary {
        white-space: normal;
        text-align: center;
    }

    .tut-owner-card > .icon {
        display: none;
    }

    /* Viewer: image full width, arrows under it next to the caption */
    .tut-lightbox-stage {
        padding: 4rem 0.5rem 4.75rem;
    }

    .tut-lightbox-img {
        max-width: 100%;
        max-height: calc(100dvh - 13rem);
    }

    .tut-lightbox-caption {
        flex-direction: column;
        gap: 0.25rem;
    }

    .tut-lightbox-prev,
    .tut-lightbox-next {
        top: auto;
        bottom: 0.875rem;
        transform: none;
    }

    .tut-lightbox-prev {
        left: calc(50% - 56px);
    }

    .tut-lightbox-next {
        right: calc(50% - 56px);
    }
}
