/* ── Scroll Offset Fix ────────────────────────── */
[id] {
    scroll-margin-top: 5rem;
}

/* ── FAQ Smooth Animation ────────────────────── */
.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.faq-item.active .faq-answer-wrap {
    grid-template-rows: 1fr;
}

.faq-answer-inner {
    overflow: hidden;
    min-height: 0;
}

/* Flash auto-dismiss */
.flash-message {
    animation: flash-in 0.3s ease-out, flash-out 0.3s ease-in 4.7s forwards;
}

@keyframes flash-in {
    from { opacity: 0; transform: translateX(1rem); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes flash-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Admin tabs */
.tab-active {
    border-bottom-width: 2px;
    font-weight: 600;
}

/* Backlog toggle icon */
.toggle-icon {
    transition: transform 0.2s ease;
}

/* Progress bar animation */
.progress-fill {
    transition: width 0.5s ease;
}

/* Roadmap timeline */
.roadmap-line {
    position: absolute;
    left: 1.125rem;
    top: 2.5rem;
    bottom: 0;
    width: 2px;
}

/* ── Scroll Reveal System ──────────────────────── */
.reveal,
.reveal-left,
.reveal-scale {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.reveal {
    transform: translateY(24px);
}

.reveal-left {
    transform: translateX(-24px);
}

.reveal-scale {
    transform: scale(0.95);
}

.revealed {
    opacity: 1 !important;
    transform: translateY(0) translateX(0) scale(1) !important;
}

/* Stagger delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-left,
    .reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-blob,
    .btn-spinner svg,
    .badge-pulse {
        animation: none;
    }
    .faq-answer-wrap {
        transition: none;
    }
    .back-to-top,
    .floating-cta {
        transition: none;
    }
}

/* ── Hero Decorative ───────────────────────────── */
.hero-dot-pattern {
    background-image: radial-gradient(circle, #3b82f6 1px, transparent 1px);
    background-size: 24px 24px;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(10px, -15px); }
    66% { transform: translate(-8px, 10px); }
}

.hero-blob {
    animation: float 8s ease-in-out infinite;
}

.hero-blob-delayed {
    animation: float 10s ease-in-out infinite reverse;
}

/* ── Section Patterns ──────────────────────────── */
.grid-pattern {
    background-image:
        linear-gradient(rgba(59,130,246,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.06) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* ── Nav Enhancements ──────────────────────────── */
.nav-shadow {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.nav-link {
    position: relative;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #2563eb;
    border-radius: 1px;
    transition: width 0.2s ease;
}

.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: #2563eb;
}

/* ── Form Spinner ──────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-spinner svg {
    animation: spin 0.7s linear infinite;
}

/* ── Step Connector ────────────────────────────── */
.step-connector {
    background: linear-gradient(90deg, #bfdbfe, #60a5fa, #bfdbfe);
    height: 2px;
}

/* ── Hero Gradient Text ──────────────────────── */
.hero-gradient-text {
    background: linear-gradient(135deg, #1e3a8a, #2563eb, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ── "Mas Popular" Badge Pulse ───────────────── */
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

.badge-pulse {
    animation: badge-pulse 2s ease-in-out infinite;
}

/* ── Back-to-Top Button ──────────────────────── */
.back-to-top {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(8px);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ── Floating Mobile CTA ─────────────────────── */
.floating-cta {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(8px);
}

.floating-cta.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ── Mobile Menu Panel ───────────────────────── */
.mobile-menu-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.mobile-menu-panel.open {
    grid-template-rows: 1fr;
}

.mobile-menu-inner {
    overflow: hidden;
    min-height: 0;
}

/* ── Dashboard Card Shimmer ──────────────────── */
@keyframes shimmer-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.shimmer-overlay {
    animation: shimmer-slide 2s ease-in-out infinite;
}

/* ── Chat: Message Entrance Animation ─────── */
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-enter {
    animation: msgIn 0.2s ease-out both;
}

/* ── Chat: Avatar ─────────────────────────── */
.msg-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* ── Chat: Timestamp ──────────────────────── */
.msg-timestamp {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ── Chat: Copy Button (message level) ────── */
.msg-copy-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #6b7280;
    background: transparent;
    border: none;
}

.msg-copy-btn:hover {
    color: #374151;
    background: #f3f4f6;
}

.group:hover .msg-copy-btn {
    opacity: 1;
}

/* ── Chat: Code Block Copy Button ─────────── */
.chat-msg pre {
    position: relative;
}

.code-copy-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: #374151;
    color: #e5e7eb;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chat-msg pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: #4b5563;
}

/* ── Chat: Feedback Card ──────────────────── */
.feedback-card {
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 1rem;
    background: white;
}

/* ── Chat: Celebration Animation ──────────── */
@keyframes celebrate {
    0% { transform: scale(0.95); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.celebration {
    animation: celebrate 0.4s ease-out both;
}

/* ── Chat: Build Progress Bar ─────────────── */
.progress-bar {
    height: 4px;
    background: #dbeafe;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: #2563eb;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* ── Chat: Respect reduced motion ─────────── */
@media (prefers-reduced-motion: reduce) {
    .msg-enter,
    .celebration {
        animation: none;
    }
    .progress-bar-inner {
        transition: none;
    }
}
