/* ══════════════════════════════════════════════════════════════════════════════
   ONBOARDING WIDGET — Neobrutalist editorial checklist
   Design: stamped paper card · hero percentage · numbered steps · ink stamps
   Aligned with dashboard tokens: --ink, --paper, --cream, --yellow, --muted, --stone
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
    --onb-ink: #0d0d0d;
    --onb-paper: #fffdf7;
    --onb-cream: #f5f0e8;
    --onb-yellow: #fef08a;
    --onb-yellow-soft: #fef9c3;
    --onb-muted: #78716c;
    --onb-stone: #e7e0d3;
    --onb-success: #16a34a;
    --onb-stamp: #b91c1c;
    --onb-mono: 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
}

/* ── Keyframes ───────────────────────────────────────────────────────────── */
@keyframes onbSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes onbStepIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes onbPulseShadow {
    0%, 100% { box-shadow: 4px 4px 0 var(--onb-ink); }
    50%      { box-shadow: 6px 6px 0 var(--onb-ink); }
}
@keyframes onbStripes {
    from { background-position: 0 0; }
    to   { background-position: 24px 0; }
}
@keyframes onbStampDrop {
    0%   { opacity: 0; transform: rotate(-8deg) scale(2); }
    60%  { opacity: 1; transform: rotate(-14deg) scale(0.92); }
    100% { opacity: 1; transform: rotate(-10deg) scale(1); }
}
@keyframes onbArrowDrift {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(4px); }
}

/* ── Card shell ──────────────────────────────────────────────────────────── */
.onb-card {
    position: relative;
    background: var(--onb-paper);
    border: 2.5px solid var(--onb-ink);
    box-shadow: 6px 6px 0 var(--onb-ink);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--onb-ink);
    animation: onbSlideUp .45s cubic-bezier(.25,.46,.45,.94) both;
    overflow: hidden;
    /* subtle paper grid */
    background-image:
        linear-gradient(rgba(13,13,13,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13,13,13,.025) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* corner tag — editorial flourish */
.onb-card::before {
    content: "№ 01 — BENVENUTO";
    position: absolute;
    top: 0;
    right: 0;
    background: var(--onb-ink);
    color: var(--onb-yellow);
    font-family: var(--onb-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 5px 12px 6px;
}

.onb-card-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
}

@media (max-width: 900px) {
    .onb-card-grid { grid-template-columns: 1fr; }
}

/* ── Left column — hero percentage ───────────────────────────────────────── */
.onb-hero {
    padding: 32px 28px 24px;
    border-right: 2.5px solid var(--onb-ink);
    background: var(--onb-cream);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

@media (max-width: 900px) {
    .onb-hero { border-right: none; border-bottom: 2.5px solid var(--onb-ink); }
}

.onb-eyebrow {
    font-family: var(--onb-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--onb-ink);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.onb-eyebrow::before {
    content: "";
    width: 14px;
    height: 2px;
    background: var(--onb-ink);
    display: inline-block;
}

.onb-pct-block {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 0.9;
    margin-top: 4px;
}

.onb-pct-num {
    font-size: 88px;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--onb-ink);
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
}

.onb-pct-sign {
    font-size: 32px;
    font-weight: 800;
    color: var(--onb-ink);
    transform: translateY(-12px);
}

.onb-pct-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--onb-muted);
    margin-top: -4px;
}

/* progress rail with animated diagonal stripes */
.onb-rail {
    width: 100%;
    height: 14px;
    background: var(--onb-paper);
    border: 2px solid var(--onb-ink);
    overflow: hidden;
    margin-top: 10px;
    position: relative;
}

.onb-rail-fill {
    height: 100%;
    background-color: var(--onb-ink);
    background-image: repeating-linear-gradient(
        45deg,
        var(--onb-ink) 0,
        var(--onb-ink) 6px,
        #1f1f1f 6px,
        #1f1f1f 12px
    );
    background-size: 24px 24px;
    animation: onbStripes 1.6s linear infinite;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.onb-rail-fill::after {
    content: "";
    position: absolute;
    right: -1px;
    top: -4px;
    bottom: -4px;
    width: 4px;
    background: var(--onb-yellow);
}

.onb-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--onb-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--onb-ink);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 6px;
}

.onb-meta-dot {
    width: 4px;
    height: 4px;
    background: var(--onb-ink);
    display: inline-block;
}

.onb-meta-muted { color: var(--onb-muted); }

/* decorative underline */
.onb-hero::after {
    content: "";
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 16px;
    height: 6px;
    background: var(--onb-yellow);
    z-index: 0;
    opacity: 0.6;
    mix-blend-mode: multiply;
    display: none;
}

/* ── Right column — checklist body ───────────────────────────────────────── */
.onb-body {
    padding: 28px 30px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.onb-body-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 2px dashed var(--onb-ink);
    flex-wrap: wrap;
}

.onb-chip {
    font-family: var(--onb-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 10px 5px;
    background: var(--onb-yellow);
    border: 2px solid var(--onb-ink);
    color: var(--onb-ink);
}

.onb-body-headline {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--onb-ink);
    line-height: 1.2;
    flex: 1;
    min-width: 200px;
}

.onb-body-headline em {
    font-style: italic;
    background: var(--onb-yellow);
    padding: 0 4px;
    font-weight: 800;
}

/* ── Steps list ──────────────────────────────────────────────────────────── */
.onb-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.onb-step {
    display: grid;
    grid-template-columns: 32px 40px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--onb-paper);
    border: 2px solid var(--onb-ink);
    box-shadow: 3px 3px 0 var(--onb-ink);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    animation: onbStepIn 0.35s ease both;
}

.onb-step:nth-child(1) { animation-delay: 0.05s; }
.onb-step:nth-child(2) { animation-delay: 0.10s; }
.onb-step:nth-child(3) { animation-delay: 0.15s; }
.onb-step:nth-child(4) { animation-delay: 0.20s; }
.onb-step:nth-child(5) { animation-delay: 0.25s; }
.onb-step:nth-child(6) { animation-delay: 0.30s; }
.onb-step:nth-child(7) { animation-delay: 0.35s; }

.onb-step-num {
    font-family: var(--onb-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--onb-muted);
    letter-spacing: -0.02em;
    text-align: center;
    line-height: 1;
}

.onb-step-check {
    width: 36px;
    height: 36px;
    border: 2px solid var(--onb-ink);
    background: var(--onb-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.onb-step-check svg {
    width: 20px;
    height: 20px;
    stroke: var(--onb-ink);
    stroke-width: 3;
    fill: none;
    stroke-linecap: square;
    stroke-linejoin: miter;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.onb-step-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.onb-step-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--onb-ink);
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.25;
}

.onb-step-desc {
    font-size: 12px;
    color: var(--onb-muted);
    line-height: 1.4;
    margin: 0;
}

.onb-step-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Step — COMPLETED ────────────────────────────────────────────────────── */
.onb-step.completed {
    background: var(--onb-cream);
}

.onb-step.completed .onb-step-num {
    color: var(--onb-ink);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.onb-step.completed .onb-step-check {
    background: var(--onb-ink);
}
.onb-step.completed .onb-step-check svg {
    stroke: var(--onb-yellow);
    opacity: 1;
}

.onb-step.completed .onb-step-title {
    color: var(--onb-muted);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: var(--onb-ink);
}

.onb-step.completed .onb-step-desc {
    opacity: 0.6;
}

.onb-stamp {
    font-family: var(--onb-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    padding: 5px 10px 6px;
    color: var(--onb-stamp);
    border: 2px solid var(--onb-stamp);
    background: transparent;
    transform: rotate(-8deg);
    text-transform: uppercase;
    display: inline-block;
    animation: onbStampDrop 0.45s cubic-bezier(.6,-0.3,.3,1.2) both;
    animation-delay: 0.2s;
    box-shadow: 2px 2px 0 rgba(185, 28, 28, 0.15);
}

/* ── Step — NEXT (active) ────────────────────────────────────────────────── */
.onb-step.next {
    background: var(--onb-yellow-soft);
    border-color: var(--onb-ink);
    animation: onbStepIn 0.35s ease both, onbPulseShadow 2.4s ease-in-out infinite 0.6s;
    z-index: 1;
}

.onb-step.next .onb-step-num {
    color: var(--onb-ink);
}

.onb-step.next .onb-step-check {
    background: var(--onb-paper);
    border-style: dashed;
}

.onb-step.next .onb-step-title {
    color: var(--onb-ink);
}

.onb-step.next .onb-step-desc {
    color: #57534e;
}

/* highlighter band under the active title */
.onb-step.next .onb-step-title {
    position: relative;
    display: inline-block;
    width: fit-content;
}
.onb-step.next .onb-step-title::before {
    content: "";
    position: absolute;
    left: -2px;
    right: -2px;
    bottom: 1px;
    height: 7px;
    background: var(--onb-yellow);
    z-index: -1;
    transform: skewX(-8deg);
}

/* "up next" pill */
.onb-next-pill {
    font-family: var(--onb-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    padding: 3px 8px 4px;
    background: var(--onb-ink);
    color: var(--onb-yellow);
    text-transform: uppercase;
    margin-right: 6px;
}

/* ── CTA button ──────────────────────────────────────────────────────────── */
.onb-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--onb-yellow);
    background: var(--onb-ink);
    border: 2px solid var(--onb-ink);
    box-shadow: 3px 3px 0 var(--onb-ink);
    padding: 7px 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
    white-space: nowrap;
}

.onb-cta:hover {
    background: #1a1a1a;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--onb-ink);
}
.onb-cta:hover .onb-cta-arrow {
    animation: onbArrowDrift 0.8s ease-in-out infinite;
}
.onb-cta:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.onb-cta-arrow {
    display: inline-block;
    font-weight: 800;
    transition: transform 0.2s ease;
}

/* ── Video link ──────────────────────────────────────────────────────────── */
.onb-video {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--onb-ink);
    background: var(--onb-paper);
    border: 2px solid var(--onb-ink);
    padding: 5px 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    cursor: pointer;
    font-family: var(--onb-mono);
    transition: all 0.15s ease;
    white-space: nowrap;
}
.onb-video:hover {
    background: var(--onb-yellow);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.onb-foot {
    padding: 0 30px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.onb-foot-note {
    font-family: var(--onb-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--onb-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.onb-hide-btn {
    background: transparent;
    border: 2px solid transparent;
    color: var(--onb-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 5px 10px;
    font-family: var(--onb-mono);
    transition: all 0.15s ease;
}
.onb-hide-btn:hover {
    color: var(--onb-ink);
    border-color: var(--onb-ink);
    background: var(--onb-paper);
}

/* ═══ Streak counter (topbar) ════════════════════════════════════════════ */
.onb-streak {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px 6px;
    background: var(--onb-ink);
    border: 2px solid var(--onb-ink);
    box-shadow: 3px 3px 0 var(--onb-yellow);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    position: relative;
}

.onb-streak-fire {
    font-size: 13px;
    line-height: 1;
    filter: drop-shadow(0 0 3px rgba(252, 211, 77, 0.6));
}

.onb-streak-count {
    color: var(--onb-yellow);
    font-weight: 800;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.onb-streak-label {
    color: #a8a29e;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--onb-mono);
}

/* ═══ Video modal ════════════════════════════════════════════════════════ */
.onb-video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 13, 13, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: onbSlideUp 0.2s ease both;
}

.onb-video-modal {
    background: var(--onb-paper);
    border: 2.5px solid var(--onb-ink);
    box-shadow: 8px 8px 0 var(--onb-yellow);
    padding: 0;
    width: 90%;
    max-width: 780px;
    overflow: hidden;
    position: relative;
}

.onb-video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 2px solid var(--onb-ink);
    background: var(--onb-cream);
}

.onb-video-modal-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--onb-ink);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.onb-video-modal-close {
    width: 32px;
    height: 32px;
    border: 2px solid var(--onb-ink);
    background: var(--onb-paper);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--onb-ink);
    transition: all 0.15s;
    font-family: inherit;
}
.onb-video-modal-close:hover {
    background: var(--onb-yellow);
    box-shadow: 2px 2px 0 var(--onb-ink);
}

.onb-video-modal iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
    background: #000;
}
