/*
 * onboarding.css — styles for the post-create onboarding surfaces:
 *   - FatherAgent quick-control box (.faqb*)        → _fa_quick_box.html
 *   - Celebration overlay (.cel*)                    → _celebration.html
 *   - Next-steps strip (.next-steps-*, .next-step-*) → character_detail.html
 *
 * Loaded globally via base.html so it is cached once per session and every
 * page that uses the partials above shares the same rules.
 */

/* ── FatherAgent Quick Control Box ─────────────────────────────────── */
.faqb {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.faqb-avatar {
    font-size: 1.45rem;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(234, 83, 50, 0.12), rgba(245, 158, 11, 0.12));
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.faqb-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.faqb-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.faqb-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 0.93rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.faqb-input:focus {
    border-color: #EA5332;
    box-shadow: 0 0 0 3px rgba(234, 83, 50, 0.12);
}
.faqb-send {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #EA5332, #f59e0b);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.faqb-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(234, 83, 50, 0.3);
}
.faqb-send:focus-visible {
    outline: 3px solid rgba(234, 83, 50, 0.55);
    outline-offset: 2px;
}
.faqb-send[aria-busy="true"] {
    opacity: 0.6;
    cursor: wait;
}
.faqb-open {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.faqb-open:hover {
    color: #EA5332;
    border-color: #EA5332;
}
.faqb-open:focus-visible {
    outline: 3px solid rgba(234, 83, 50, 0.35);
    outline-offset: 2px;
}

/* ── Celebration Overlay ───────────────────────────────────────────── */
.cel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 30, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: cel-fade-in 0.25s ease;
}
.cel-overlay.cel-active { display: flex; }
.cel-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.cel-card {
    position: relative;
    max-width: 460px;
    width: calc(100% - 2rem);
    background: var(--card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 22px;
    padding: 2.25rem 1.75rem 1.75rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    text-align: center;
    outline: none;
    animation: cel-pop 0.5s cubic-bezier(.17, .67, .3, 1.33);
}
.cel-card:focus-visible {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(234, 83, 50, 0.5);
}
.cel-emoji {
    font-size: 3.8rem;
    line-height: 1;
    margin-bottom: 0.6rem;
    display: inline-block;
    animation: cel-wiggle 1.4s ease-in-out 0.2s infinite;
}
.cel-title {
    margin: 0 0 0.4rem;
    font-size: 1.55rem;
    font-weight: 800;
    background: linear-gradient(135deg, #EA5332, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.cel-subtitle {
    margin: 0 0 1.3rem;
    color: var(--text-secondary, #6b7280);
    font-size: 0.95rem;
}
.cel-btn {
    padding: 0.85rem 1.75rem;
    background: linear-gradient(135deg, #EA5332, #f59e0b);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(234, 83, 50, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cel-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(234, 83, 50, 0.45);
}
.cel-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

@keyframes cel-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes cel-pop {
    0%   { opacity: 0; transform: scale(0.85) translateY(20px); }
    100% { opacity: 1; transform: scale(1)    translateY(0);    }
}
@keyframes cel-wiggle {
    0%, 100% { transform: rotate(-6deg) scale(1);    }
    50%      { transform: rotate(6deg)  scale(1.08); }
}

/* ── Agent Health Strip ────────────────────────────────────────────── */
/* Persistent health indicator — always visible on the character detail
   page. The `.is-healthy` variant flips the orange "needs attention"
   gradient to a green "all systems go" tone when every onboarding step
   is complete. Never dismissable by the user. */
.next-steps-strip {
    margin: 0 0 1rem;
    background: linear-gradient(135deg, rgba(234, 83, 50, 0.06), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(234, 83, 50, 0.2);
    border-radius: 18px;
    padding: 1rem 1.25rem 1.25rem;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.next-steps-strip.is-healthy {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(34, 197, 94, 0.06));
    border-color: rgba(16, 185, 129, 0.35);
}
.next-steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}
.next-steps-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-primary);
}
.next-steps-title strong { color: #EA5332; }
.next-steps-strip.is-healthy .next-steps-title strong { color: #059669; }
.next-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.6rem;
}
.next-step-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.next-step-card:hover {
    border-color: #EA5332;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.next-step-card:focus-visible {
    outline: 3px solid rgba(234, 83, 50, 0.45);
    outline-offset: 2px;
}
.next-step-card.done {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.04);
}
.next-step-card[aria-busy="true"] {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}
.next-step-icon { font-size: 1.4rem; flex-shrink: 0; }
.next-step-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.next-step-title {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.next-step-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.next-step-check {
    font-size: 1.1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.next-step-card.done .next-step-check {
    color: #10b981;
    font-weight: 700;
}
.next-step-card.next-step-action .next-step-check {
    color: #EA5332;
    font-size: 0.9rem;
}
.next-step-card.next-step-error {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.04);
}
.next-step-card.next-step-error .next-step-check { color: #ef4444; }

/* ── Responsive & Motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .cel-overlay, .cel-card, .cel-emoji { animation: none; }
    .cel-canvas { display: none; }
    .next-step-card { transition: none; }
    .next-step-card:hover { transform: none; }
}

@media (max-width: 640px) {
    .faqb { border-radius: 14px; padding: 0.6rem 0.7rem; gap: 0.5rem; }
    .faqb-avatar { width: 34px; height: 34px; font-size: 1.2rem; }
    .faqb-open { display: none; }
    .cel-card { padding: 2rem 1.25rem 1.5rem; border-radius: 18px; }
    .cel-title { font-size: 1.4rem; }
    .cel-emoji { font-size: 3.2rem; }
    .next-steps-strip { padding: 0.85rem 0.95rem 1rem; }
    .next-steps-title { font-size: 0.95rem; }
}
