/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --success-hover: #059669;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --error: #ef4444;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Steps */
.step {
    display: none;
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: block;
}

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

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
    transform: translateY(-1px);
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Questions */
.question-card {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.question-number {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.question-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.option-btn {
    padding: 0.625rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.option-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.other-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.other-input.visible {
    display: block;
}

.other-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Summary */
.summary-box {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    white-space: pre-wrap;
    line-height: 1.8;
}

.summary-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

#modification-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* PRD */
.prd-box {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    line-height: 1.8;
    max-height: 600px;
    overflow-y: auto;
}

.prd-box h1, .prd-box h2, .prd-box h3 {
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prd-box h1:first-child {
    margin-top: 0;
}

.prd-box ul, .prd-box ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.prd-box li {
    margin-bottom: 0.5rem;
}

.prd-box code {
    background: var(--surface);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.prd-box pre {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.prd-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    padding: 1rem;
}

.progress-step {
    width: 36px;
    height: 36px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.3s;
}

.progress-step.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.progress-step.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.toast.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .step {
        padding: 1.5rem;
    }

    .step-header h2 {
        font-size: 1.25rem;
    }

    .summary-actions,
    .prd-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .progress-line {
        width: 30px;
    }
}
