/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Formulário */
.form-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.campos-tipo {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

/* Botão */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

/* Preview do documento */
.documento-preview {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.documento-conteudo {
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    color: #000;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem;
    border: 1px solid #ddd;
    background-color: white;
    position: relative;
}

/* Estilos do documento */
.documento-header {
    text-align: center;
    margin-bottom: 2rem;
}

.documento-titulo {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.documento-subtitulo {
    font-size: 1rem;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: bold;
}

.documento-conteudo p {
    margin-bottom: 1rem;
    text-align: justify;
}

.documento-assinatura {
    margin-top: 3rem;
    text-align: center;
}

.assinatura-linha {
    border-top: 2px solid #000;
    width: 300px;
    margin: 2rem auto 0.5rem auto;
}

.documento-rodape {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

/* Sistema de Organização */
.sistema-organizacao {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.sistema-organizacao h4 {
    color: #ecf0f1;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.sistema-organizacao .instrucoes p {
    margin: 0.8rem 0;
    line-height: 1.5;
}

.sistema-organizacao code {
    background: rgba(255,255,255,0.15);
    color: #ecf0f1;
    padding: 0.8rem;
    border-radius: 6px;
    display: block;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border-left: 4px solid #3498db;
}

.sistema-organizacao pre {
    background: rgba(255,255,255,0.1);
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border-left: 4px solid #e74c3c;
}

.preview-nome {
    background: rgba(255,255,255,0.2);
    color: #f1c40f;
    padding: 0.8rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    border: 2px dashed #f1c40f;
    text-align: center;
    font-weight: bold;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: #666;
    margin-top: 2rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .documento-conteudo {
        padding: 2rem;
        font-size: 0.9rem;
    }
    
    .assinatura-linha {
        width: 250px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .form-section h2 {
        font-size: 1.5rem;
    }
    
    .btn-primary {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }
    
    .documento-conteudo {
        padding: 1.5rem;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeIn 0.5s ease-out;
}

/* Estilos de validação */
input.error {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}