* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1f3a93 0%, #0f1e47 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.document-selector {
    display: flex;
    background: #f5f5f5;
    padding: 0;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: #f5f5f5;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: white;
    border-bottom: 3px solid #667eea;
    color: #667eea;
}

.form-section {
    display: none;
    padding: 40px;
}

.form-section.active {
    display: block;
}

.form-section h2 {
    color: #1f3a93;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.form-section h3 {
    color: #667eea;
    margin: 30px 0 20px 0;
    font-size: 1.3em;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

#servicios-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.servicio-item {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.servicio-item input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
}

.servicio-item button {
    padding: 10px 15px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
}

.servicio-item button:hover {
    background: #e84343;
}

.btn-add {
    display: block;
    width: 100%;
    padding: 12px;
    background: #22a6b3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 20px;
}

.btn-add:hover {
    background: #1b8a96;
}

.btn-generate {
    display: block;
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    margin-top: 30px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .servicio-item {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.8em;
    }
}

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

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}
