/* Plan & Generating views */

/* === Generating View === */
.generating-view {
    max-width: 560px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
}

.generating-header {
    text-align: center;
}

.generating-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.generating-empresa {
    color: var(--text-secondary);
    font-size: 1rem;
}

.generating-empresa strong {
    color: var(--accent);
}

/* Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Progress bar */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 100px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-purple));
    border-radius: 100px;
    transition: width 0.5s ease;
}

/* Checklist */
.sections-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.checklist-item__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.checklist-item__label {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.checklist-item__status {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* States */
.checklist-item--pending {
    opacity: 0.5;
}

.checklist-item--generating {
    opacity: 1;
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.checklist-item--generating .checklist-item__label {
    color: var(--text-primary);
}

.checklist-item--generating .checklist-item__status {
    color: var(--accent);
}

.checklist-item--done {
    opacity: 1;
    border-color: var(--accent-success);
}

.checklist-item--done .checklist-item__icon {
    color: var(--accent-success);
    font-weight: 700;
}

.checklist-item--done .checklist-item__label {
    color: var(--text-primary);
}

.checklist-item--done .checklist-item__status {
    color: var(--accent-success);
}

.checklist-item--error {
    opacity: 1;
    border-color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.05);
}

.checklist-item--error .checklist-item__icon {
    color: var(--accent-danger);
}

.checklist-item--error .checklist-item__status {
    color: var(--accent-danger);
    font-size: 0.75rem;
}

/* Fatal error */
.fatal-error {
    text-align: center;
    padding: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--accent-danger);
    border-radius: var(--radius);
}

.fatal-error__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.fatal-error h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--accent-danger);
}

.fatal-error p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* === Plan View === */
.plan {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.plan__header {
    text-align: center;
    padding: 2rem 0 3rem;
}

.plan__header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.plan__empresa {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.plan__empresa strong {
    color: var(--accent);
}

.plan__meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Plan sections */
.plan-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.plan-section__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.plan-section__icon {
    font-size: 1.25rem;
}

.plan-section__title {
    font-size: 1.125rem;
    font-weight: 600;
}

.plan-section__content {
    padding: 1.5rem;
}

.plan-section__json {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--bg-elevated);
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .generating-view {
        padding: 2rem 1rem;
    }

    .generating-header h2 {
        font-size: 1.25rem;
    }

    .plan {
        padding: 1rem;
    }

    .plan__header h1 {
        font-size: 1.5rem;
    }

    .plan-section__content {
        padding: 1rem;
    }
}