/* =============================================
   SkillForge — CLAUDE.md Builder Wizard
   ============================================= */

.sf-wizard {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Intro screen ── */
.cmd-intro-inner {
    background: #ffffff;
    border: 1.5px solid #e5e0f5;
    border-radius: 20px;
    padding: 3rem 2.5rem 2.5rem;
    text-align: center;
    animation: sfFadeIn 0.3s ease;
    margin-bottom: 0;
}

.cmd-intro-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1523;
    margin: 0 0 0.6rem;
    line-height: 1.3;
}

.cmd-intro-body {
    font-size: 1.05rem;
    color: #6b7280;
    margin: 0 auto 2rem;
    line-height: 1.6;
    max-width: 480px;
}

/* ── Progress bar ── */
.sf-progress-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 2.5rem;
}

.sf-progress-bar {
    flex: 1;
    height: 8px;
    background: #e8e6f0;
    border-radius: 99px;
    overflow: hidden;
}

.sf-progress-fill {
    height: 100%;
    background: #7c3aed;
    border-radius: 99px;
    transition: width 0.4s ease;
    width: 0%;
}

.sf-progress-label {
    font-size: 15px;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 500;
    min-width: 90px;
    text-align: right;
}

/* ── Step container ── */
.sf-step {
    display: none;
}

.sf-step.active {
    display: block;
    animation: sfFadeIn 0.3s ease;
}

@keyframes sfFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sf-step-inner {
    background: #ffffff;
    border: 1.5px solid #e5e0f5;
    border-radius: 20px;
    padding: 2.5rem 2.5rem 2rem;
}

/* ── Emoji ── */
.sf-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1;
}

/* ── Question heading ── */
.sf-question {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1523;
    margin: 0 0 0.6rem;
    line-height: 1.3;
}

/* ── Hint text ── */
.sf-hint {
    font-size: 1.05rem;
    color: #6b7280;
    margin: 0 0 1.8rem;
    line-height: 1.6;
}

/* ── Text input ── */
.sf-input {
    width: 100%;
    font-size: 1.1rem;
    padding: 0.9rem 1.1rem;
    border: 2px solid #e5e0f5;
    border-radius: 12px;
    color: #1a1523;
    background: #faf9fc;
    margin-bottom: 1.2rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.sf-input:focus {
    border-color: #7c3aed;
    background: #fff;
}

/* ── Textarea ── */
.sf-textarea {
    width: 100%;
    font-size: 1.05rem;
    padding: 0.9rem 1.1rem;
    border: 2px solid #e5e0f5;
    border-radius: 12px;
    color: #1a1523;
    background: #faf9fc;
    margin-bottom: 1.2rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
    font-family: inherit;
}

.sf-textarea:focus {
    border-color: #7c3aed;
    background: #fff;
}

/* ── Next button ── */
.sf-btn-next {
    display: block;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    background: #7c3aed;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
    margin-top: 0.5rem;
}

.sf-btn-next:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.sf-btn-next:active {
    transform: translateY(0);
}

/* ── Skip button ── */
.sf-btn-skip {
    display: block;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 500;
    color: #9ca3af;
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 0.7rem 1.5rem;
    cursor: pointer;
    transition: color 0.15s;
    font-family: inherit;
    margin-top: 0.3rem;
    text-align: center;
}

.sf-btn-skip:hover {
    color: #6b7280;
}

/* ── Back button ── */
.sf-nav-back {
    margin-top: 1rem;
    text-align: center;
}

.sf-btn-back {
    font-size: 0.95rem;
    font-weight: 500;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    font-family: inherit;
    padding: 0.5rem 1rem;
}

.sf-btn-back:hover {
    color: #6b7280;
}

/* ── Checkbox grid (tech stack) ── */
.sf-check-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 1.4rem;
}

.sf-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1a1523;
    background: #faf9fc;
    border: 2px solid #e5e0f5;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.3;
    user-select: none;
}

.sf-check-label:hover {
    border-color: #7c3aed;
    background: #f3f0fd;
}

.sf-check-label input[type="checkbox"] {
    accent-color: #7c3aed;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

/* ── Checkbox list (prohibitions / sub-rules) ── */
.sf-check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

.sf-check-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 1rem;
    color: #1a1523;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    background: #faf9fc;
    border: 2px solid #e5e0f5;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s;
    user-select: none;
}

.sf-check-list-item:hover {
    border-color: #c4b5fd;
}

.sf-check-list-item input[type="checkbox"] {
    accent-color: #7c3aed;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

/* ── Section divider label ── */
.sf-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin: 1.4rem 0 0.6rem;
}

/* ── Small form label ── */
.sf-form-label-sm {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 4px;
}

/* ── Form group ── */
.sf-form-group {
    margin-bottom: 1rem;
}

.sf-form-group .sf-input {
    margin-bottom: 0;
}

/* ── Toggle row (label + Yes/No buttons) ── */
.sf-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.85rem 1rem;
    background: #faf9fc;
    border: 2px solid #e5e0f5;
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.sf-toggle-label {
    font-size: 1rem;
    font-weight: 500;
    color: #1a1523;
    line-height: 1.4;
}

.sf-toggle-group {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.sf-toggle-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    background: #ffffff;
    border: 2px solid #e5e0f5;
    border-radius: 8px;
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.sf-toggle-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.sf-toggle-btn.selected {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #5b21b6;
}

/* ── Sub-toggle (nested under a toggle) ── */
.sf-sub-toggle-wrap {
    display: none;
    margin-bottom: 0.75rem;
    padding: 0.9rem 1rem 0.9rem 1.2rem;
    background: #f8f7ff;
    border-radius: 10px;
    border-left: 3px solid #7c3aed;
}

/* ── Custom prohibition rows ── */
.sf-custom-container {
    margin-top: 4px;
}

.sf-custom-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.sf-custom-row .sf-input {
    flex: 1;
    margin-bottom: 0;
}

.sf-remove-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: transparent;
    border: 2px solid #e5e0f5;
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
    padding: 0;
    line-height: 1;
}

.sf-remove-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fff5f5;
}

.sf-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #7c3aed;
    background: transparent;
    border: 2px dashed #c4b5fd;
    border-radius: 10px;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.sf-add-btn:hover {
    border-color: #7c3aed;
    background: #f3f0fd;
}

/* ── Sub-rules detail ── */
.sf-subrules-detail {
    display: none;
    margin-top: 1rem;
    animation: sfFadeIn 0.25s ease;
}

/* ── Output box ── */
.sf-output-inner {
    padding-bottom: 2.5rem;
}

.sf-output-box {
    background: #faf9fc;
    border: 2px solid #e5e0f5;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.sf-output-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    background: #f0ecfd;
    border-bottom: 1.5px solid #e5e0f5;
}

.sf-output-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #5b21b6;
}

.sf-copy-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: #7c3aed;
    background: #ffffff;
    border: 1.5px solid #c4b5fd;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.sf-copy-btn:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
}

.sf-output-text {
    font-size: 0.92rem;
    line-height: 1.8;
    color: #1a1523;
    padding: 1.5rem;
    white-space: pre-wrap;
    font-family: 'Space Mono', 'Courier New', monospace;
    max-height: 420px;
    overflow-y: auto;
}

/* ── Output action buttons ── */
.sf-output-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.sf-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: #7c3aed;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.4rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.sf-btn-download:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.sf-btn-download:active {
    transform: translateY(0);
}

.sf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    padding: 0.85rem 1.4rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, border-color 0.15s, color 0.15s;
    font-family: inherit;
    text-decoration: none;
    border: 2px solid transparent;
}

.sf-btn-ghost {
    background: none;
    border-color: #7c3aed;
    color: #7c3aed;
}

.sf-btn-ghost:hover {
    background: #f3eeff;
}

.cmd-next-steps {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.cmd-next-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sf-btn-restart {
    font-size: 0.95rem;
    font-weight: 500;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    font-family: inherit;
    padding: 0.5rem 0;
    display: block;
    margin-top: 1.5rem;
}

.sf-btn-restart:hover {
    color: #6b7280;
}

/* ── Install guide ── */
.sf-install-guide {
    background: #f8faff;
    border: 1.5px solid #dbeafe;
    border-radius: 16px;
    padding: 1.8rem 2rem;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}

.sf-install-guide h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1523;
    margin: 0 0 1.2rem;
}

.sf-install-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.9rem;
}

.sf-install-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.sf-install-body {
    font-size: 1rem;
    color: #374151;
    line-height: 1.6;
}

.sf-install-body code {
    background: #ede9fe;
    color: #5b21b6;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .cmd-intro-inner,
    .sf-step-inner {
        padding: 1.8rem 1.4rem 1.5rem;
    }
    .cmd-intro-heading,
    .sf-question {
        font-size: 1.35rem;
    }
    .sf-check-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sf-toggle-row {
        flex-wrap: wrap;
    }
    .sf-install-guide {
        padding: 1.4rem 1.2rem;
    }
    .sf-output-actions {
        flex-direction: column;
    }
    .sf-btn-download {
        justify-content: center;
    }
}
